mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-26 15:41:29 +01:00
37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
|
using BTCPayServer.Hosting;
|
||
|
using BTCPayServer.Payments;
|
||
|
using BTCPayServer.Services;
|
||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
using NBitcoin;
|
||
|
using NBXplorer;
|
||
|
|
||
|
namespace BTCPayServer.Plugins.Altcoins;
|
||
|
|
||
|
public partial class AltcoinsPlugin
|
||
|
{
|
||
|
public void InitDogecoin(IServiceCollection services)
|
||
|
{
|
||
|
var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("DOGE");
|
||
|
var network = new BTCPayNetwork()
|
||
|
{
|
||
|
CryptoCode = nbxplorerNetwork.CryptoCode,
|
||
|
DisplayName = "Dogecoin",
|
||
|
NBXplorerNetwork = nbxplorerNetwork,
|
||
|
DefaultRateRules = new[]
|
||
|
{
|
||
|
"DOGE_X = DOGE_BTC * BTC_X",
|
||
|
"DOGE_BTC = bittrex(DOGE_BTC)"
|
||
|
},
|
||
|
CryptoImagePath = "imlegacy/dogecoin.png",
|
||
|
DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(ChainName),
|
||
|
CoinType = ChainName == ChainName.Mainnet ? new KeyPath("3'") : new KeyPath("1'")
|
||
|
}.SetDefaultElectrumMapping(ChainName);
|
||
|
|
||
|
var blockExplorerLink = ChainName == ChainName.Mainnet ? "https://dogechain.info/tx/{0}" : "https://dogechain.info/tx/{0}";
|
||
|
services.AddBTCPayNetwork(network)
|
||
|
.AddTransactionLinkProvider(new PaymentMethodId(nbxplorerNetwork.CryptoCode, PaymentTypes.BTCLike), new DefaultTransactionLinkProvider(blockExplorerLink));
|
||
|
}
|
||
|
}
|
||
|
|