Task IBrokerClient.Send(NewTransactionEvent transactionEvent) { CheckAndOpenConnection(); string jsonMsg = transactionEvent.ToJson(Networks.GetFromCryptoCode(transactionEvent.CryptoCode).JsonSerializerSettings); var body = Encoding.UTF8.GetBytes(jsonMsg); var conf = (transactionEvent.BlockId == null ? "unconfirmed" : "confirmed"); var routingKey = $"transactions.{transactionEvent.CryptoCode}.{conf}"; string msgIdHash = HashMessageId($"{transactionEvent.TrackedSource}-{transactionEvent.TransactionData.Transaction.GetHash()}-{(transactionEvent.TransactionData.BlockId?.ToString() ?? string.Empty)}"); ValidateMessageId(msgIdHash); IBasicProperties props = Channel.CreateBasicProperties(); props.MessageId = msgIdHash; props.ContentType = typeof(NewTransactionEvent).ToString(); props.Headers = new Dictionary <string, object>(); props.Headers.Add("CryptoCode", transactionEvent.CryptoCode); Channel.BasicPublish( exchange: NewTransactionExchange, routingKey: routingKey, basicProperties: props, body: body); return(Task.CompletedTask); }
public void InitLitecoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("LTC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Litecoin", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://live.blockcypher.com/ltc/tx/{0}/" : "http://explorer.litecointools.com/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, UriScheme = "litecoin", CryptoImagePath = "imlegacy/litecoin.svg", LightningImagePath = "imlegacy/litecoin-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("2'") : new KeyPath("1'"), //https://github.com/pooler/electrum-ltc/blob/0d6989a9d2fb2edbea421c116e49d1015c7c5a91/electrum_ltc/constants.py ElectrumMapping = NetworkType == NetworkType.Mainnet ? new Dictionary <uint, DerivationType>() { { 0x0488b21eU, DerivationType.Legacy }, { 0x049d7cb2U, DerivationType.SegwitP2SH }, { 0x04b24746U, DerivationType.Segwit }, } : new Dictionary <uint, DerivationType>() { { 0x043587cfU, DerivationType.Legacy }, { 0x044a5262U, DerivationType.SegwitP2SH }, { 0x045f1cf6U, DerivationType.Segwit } } }); }
public void InitTerracoin() { //not needed: NBitcoin.Altcoins.Terracoin.Instance.EnsureRegistered(); var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("TRC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Terracoin", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://insight.terracoin.io/tx/{0}" : "https://test-insight.terracoin.io/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "terracoin", DefaultRateRules = new[] { "TRC_X = TRC_BTC * BTC_X", "TRC_BTC = coingecko(TRC_BTC)" }, CryptoImagePath = "imlegacy/terracoin.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), //https://github.com/satoshilabs/slips/blob/master/slip-0044.md CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("83'") : new KeyPath("1'"), MinFee = Money.Satoshis(0.0001m) }); }
public void InitVeles() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("VLS"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Veles", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://explorer.veles.network/tx/{0}" : "https://blockstream.info/testnet/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "veles", CryptoImagePath = "imlegacy/veles.svg", LightningImagePath = "imlegacy/veles-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("0'") : new KeyPath("1'"), SupportRBF = true, ElectrumMapping = NetworkType == NetworkType.Mainnet ? new Dictionary <uint, DerivationType>() { { 0x0488b21eU, DerivationType.Legacy }, // xpub { 0x049d7cb2U, DerivationType.SegwitP2SH }, // ypub { 0x4b24746U, DerivationType.Segwit }, //zpub } : new Dictionary <uint, DerivationType>() { { 0x043587cfU, DerivationType.Legacy }, { 0x044a5262U, DerivationType.SegwitP2SH }, { 0x045f1cf6U, DerivationType.Segwit } } }); }
public void InitGroestlcoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("GRS"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Groestlcoin", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://chainz.cryptoid.info/grs/tx.dws?{0}.htm" : "https://chainz.cryptoid.info/grs-test/tx.dws?{0}.htm", NBXplorerNetwork = nbxplorerNetwork, UriScheme = "groestlcoin", DefaultRateRules = new[] { "GRS_X = GRS_BTC * BTC_X", "GRS_BTC = bittrex(GRS_BTC)" }, CryptoImagePath = "imlegacy/groestlcoin.png", LightningImagePath = "imlegacy/groestlcoin-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("17'") : new KeyPath("1'"), SupportRBF = true, SupportPayJoin = true }); }
private static ExplorerClient CreateNBXClient(Network network) { NBXplorerNetworkProvider provider = new NBXplorerNetworkProvider(network.ChainName); ExplorerClient client = new NBXplorer.ExplorerClient(provider.GetFromCryptoCode(network.NetworkSet.CryptoCode)); return(client); }
public void InitThought() { //not needed: NBitcoin.Altcoins.Thought.Instance.EnsureRegistered(); var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("THT"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Thought", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://exp.thought.live/insight/tx/{0}" : "https://ext.thought.live/insight/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, UriScheme = "thought", DefaultRateRules = new[] { "THT_X = THT_BTC * BTC_X", "THT_BTC = coinall(THT_BTC)" }, CryptoImagePath = "imlegacy/thought.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), //https://github.com/satoshilabs/slips/blob/master/slip-0044.md CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("5'") : new KeyPath("1'") }); }
public void InitBitcoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("BTC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Bitcoin", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://www.smartbit.com.au/tx/{0}" : "https://testnet.smartbit.com.au/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "bitcoin", CryptoImagePath = "imlegacy/bitcoin.svg", LightningImagePath = "imlegacy/bitcoin-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("0'") : new KeyPath("1'"), SupportRBF = true, //https://github.com/spesmilo/electrum/blob/11733d6bc271646a00b69ff07657119598874da4/electrum/constants.py ElectrumMapping = NetworkType == NetworkType.Mainnet ? new Dictionary <uint, DerivationType>() { { 0x0488b21eU, DerivationType.Legacy }, // xpub { 0x049d7cb2U, DerivationType.SegwitP2SH }, // ypub { 0x4b24746U, DerivationType.Segwit }, //zpub } : new Dictionary <uint, DerivationType>() { { 0x043587cfU, DerivationType.Legacy }, { 0x044a5262U, DerivationType.SegwitP2SH }, { 0x045f1cf6U, DerivationType.Segwit } } }); }
public void InitDash() { //not needed: NBitcoin.Altcoins.Dash.Instance.EnsureRegistered(); var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("DASH"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Dash", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://insight.dash.org/insight/tx/{0}" : "https://testnet-insight.dashevo.org/insight/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "DASH_X = DASH_BTC * BTC_X", "DASH_BTC = bitfinex(DSH_BTC)" }, CryptoImagePath = "imlegacy/dash.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), //https://github.com/satoshilabs/slips/blob/master/slip-0044.md CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("5'") : new KeyPath("1'") }); }
public ExplorerClient GetClient(string cryptoCode) { if (_clients.ContainsKey(cryptoCode)) { return(_clients[cryptoCode]); } _logger.LogWarning($"Creating NBXplorer Client {cryptoCode}"); var client = new ExplorerClient(_nbXplorerNetworkProvider.GetFromCryptoCode(cryptoCode), _options.Uri); if (string.IsNullOrEmpty(_options.CookieFile) && !_options.UseDefaultCookie) { _logger.LogWarning($"Connecting to NBXplorer @{_options.Uri} with no auth"); client.SetNoAuth(); } else if (string.IsNullOrEmpty(_options.CookieFile) && _options.UseDefaultCookie) { _logger.LogWarning( $"Connecting to NBXplorer @{_options.Uri} with default cookie {client.Network.DefaultSettings.DefaultCookieFile}"); client.SetCookieAuth(client.Network.DefaultSettings.DefaultCookieFile); } else { _logger.LogWarning( $"Connecting to NBXplorer @{_options.Uri} with auth cookie {_options.CookieFile}"); client.SetCookieAuth(_options.CookieFile); } _clients.AddOrReplace(cryptoCode, client); return(client); }
public void InitChaincoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("CHC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Chaincoin", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://explorer.chaincoin.org/Explorer/Transaction/{0}" : "https://test.explorer.chaincoin.org/Explorer/Transaction/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, UriScheme = "chaincoin", DefaultRateRules = new[] { "CHC_X = CHC_BTC * BTC_X", "CHC_BTC = txbit(CHC_X)" }, CryptoImagePath = "imlegacy/chaincoin.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), //https://github.com/satoshilabs/slips/blob/master/slip-0044.md CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("711'") : new KeyPath("1'") }); }
public void InitLiquidAssets() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("LBTC"); Add(new ElementsBTCPayNetwork() { CryptoCode = "USDt", NetworkCryptoCode = "LBTC", ShowSyncSummary = false, DefaultRateRules = new[] { "USDT_UST = 1", "USDT_X = USDT_BTC * BTC_X", "USDT_BTC = bitfinex(UST_BTC)", }, AssetId = new uint256("ce091c998b83c78bb71a632313ba3760f1763d9cfcffae02258ffa9865a37bd2"), DisplayName = "Liquid Tether", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://blockstream.info/liquid/tx/{0}" : "https://blockstream.info/testnet/liquid/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, UriScheme = "liquidnetwork", CryptoImagePath = "imlegacy/liquid-tether.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("1776'") : new KeyPath("1'"), SupportRBF = true }); Add(new ElementsBTCPayNetwork() { CryptoCode = "ETB", NetworkCryptoCode = "LBTC", ShowSyncSummary = false, DefaultRateRules = new[] { "ETB_X = ETB_BTC * BTC_X", "ETB_BTC = bitpay(ETB_BTC)" }, Divisibility = 2, AssetId = new uint256("aa775044c32a7df391902b3659f46dfe004ccb2644ce2ddc7dba31e889391caf"), DisplayName = "Ethiopian Birr", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://blockstream.info/liquid/tx/{0}" : "https://blockstream.info/testnet/liquid/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, UriScheme = "liquidnetwork", CryptoImagePath = "imlegacy/etb.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("1776'") : new KeyPath("1'"), SupportRBF = true }); }
public void InitLitecoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("LTC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://live.blockcypher.com/ltc/tx/{0}/" : "http://explorer.litecointools.com/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "litecoin", CryptoImagePath = "imlegacy/litecoin-symbol.svg", LightningImagePath = "imlegacy/ltc-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("2'") : new KeyPath("1'") }); }
public void InitDogecoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("DOGE"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://dogechain.info/tx/{0}" : "https://dogechain.info/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "dogecoin", DefaultRateProvider = new CoinAverageRateProviderDescription("DOGE"), CryptoImagePath = "imlegacy/dogecoin.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("3'") : new KeyPath("1'") }); }
public void InitBitcoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("BTC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://www.smartbit.com.au/tx/{0}" : "https://testnet.smartbit.com.au/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "bitcoin", CryptoImagePath = "imlegacy/bitcoin-symbol.svg", LightningImagePath = "imlegacy/btc-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("0'") : new KeyPath("1'") }); }
public void InitActinium() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("ACM"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Actinium", BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://explorer.actinium.org/tx/{0}/" : "https://test-explorer.actinium.org/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "Actinium", CryptoImagePath = "imlegacy/actinium.svg", LightningImagePath = "imlegacy/actinium-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("2'") : new KeyPath("1'") }); }
public void InitLitecoin() { NBXplorer.Altcoins.Litecoin.Networks.EnsureRegistered(); var ltcRate = new CoinAverageRateProvider("LTC"); var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("LTC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, BlockExplorerLink = NBXplorerNetworkProvider.ChainType == ChainType.Main ? "https://live.blockcypher.com/ltc/tx/{0}/" : "http://explorer.litecointools.com/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "litecoin", DefaultRateProvider = ltcRate, CryptoImagePath = "imlegacy/litecoin-symbol.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NBXplorerNetworkProvider.ChainType) }); }
public void InitBitcoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("BTC"); var coinaverage = new CoinAverageRateProvider("BTC"); var bitpay = new BitpayRateProvider(new Bitpay(new Key(), new Uri("https://bitpay.com/"))); var btcRate = new FallbackRateProvider(new IRateProvider[] { coinaverage, bitpay }); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, BlockExplorerLink = NBXplorerNetworkProvider.ChainType == ChainType.Main? "https://www.smartbit.com.au/tx/{0}" : "https://testnet.smartbit.com.au/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "bitcoin", DefaultRateProvider = btcRate, CryptoImagePath = "imlegacy/bitcoin-symbol.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NBXplorerNetworkProvider.ChainType) }); }
public void InitUfo() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("UFO"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Ufo", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://chainz.cryptoid.info/ufo/tx.dws?{0}" : "https://chainz.cryptoid.info/ufo/tx.dws?{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "UFO_X = UFO_BTC * BTC_X", "UFO_BTC = coinexchange(UFO_BTC)" }, CryptoImagePath = "imlegacy/ufo.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("202'") : new KeyPath("1'") }); }
public void InitFeathercoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("FTC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Feathercoin", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://explorer.feathercoin.com/tx/{0}" : "https://explorer.feathercoin.com/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "FTC_X = FTC_BTC * BTC_X", "FTC_BTC = bittrex(FTC_BTC)" }, CryptoImagePath = "imlegacy/feathercoin.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("8'") : new KeyPath("1'") }); }
public void InitDogecoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("DOGE"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Dogecoin", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://dogechain.info/tx/{0}" : "https://dogechain.info/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "DOGE_X = DOGE_BTC * BTC_X", "DOGE_BTC = bittrex(DOGE_BTC)" }, CryptoImagePath = "imlegacy/dogecoin.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("3'") : new KeyPath("1'") }); }
public void InitAlthash() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("HTML"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Htmlcoin", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://explorer.htmlcoin.com/api/tx/{0}" : "https://explorer.htmlcoin.com/api/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "HTML_X = HTML_USD", "HTML_USD = hitbtc(HTML_USD)" }, CryptoImagePath = "imlegacy/althash.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("172'") : new KeyPath("1'") }); }
public void InitBPlus() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("XBC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "BPlus", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://chainz.cryptoid.info/xbc/tx.dws?{0}" : "https://chainz.cryptoid.info/xbc/tx.dws?{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "XBC_X = XBC_BTC * BTC_X", "XBC_BTC = cryptopia(XBC_BTC)" }, CryptoImagePath = "imlegacy/xbc.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("65'") : new KeyPath("1'") }); }
public void InitMonetaryUnit() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("MUE"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "MonetaryUnit", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://explorer.monetaryunit.org/#/MUE/mainnet/tx/{0}" : "https://explorer.monetaryunit.org/#/MUE/mainnet/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "MUE_X = MUE_BTC * BTC_X", "MUE_BTC = bittrex(MUE_BTC)" }, CryptoImagePath = "imlegacy/monetaryunit.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("31'") : new KeyPath("1'") }); }
public void InitPolis() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("POLIS"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Polis", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://blockbook.polispay.org/tx/{0}" : "https://blockbook.polispay.org/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "POLIS_X = POLIS_BTC * BTC_X", "POLIS_BTC = polispay(POLIS_BTC)" }, CryptoImagePath = "imlegacy/polis.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("1997'") : new KeyPath("1'") }); }
public void InitBitcore() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("BTX"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "BitCore", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://explorer.bitcore.cc/tx/{0}" : "https://explorer.bitcore.cc/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, DefaultRateRules = new[] { "BTX_X = BTX_BTC * BTC_X", "BTX_BTC = hitbtc(BTX_BTC)" }, CryptoImagePath = "imlegacy/bitcore.svg", LightningImagePath = "imlegacy/bitcore-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("160'") : new KeyPath("1'") }); }
private static ExplorerClient GetNetwork(CommandLineExConfigurationProvider config, NBXplorerNetworkProvider networkProvider, string cryptoCode, string validValues) { var network = networkProvider.GetFromCryptoCode(cryptoCode); if (network == null) { throw new NotSupportedException($"{cryptoCode} in --chains is not supported, valid value: {validValues}"); } Uri uri = null; if (!config.TryGet($"explorerurl", out var uriStr)) { uri = network.DefaultSettings.DefaultUrl; } else { uri = new Uri(uriStr, UriKind.Absolute); } return(new ExplorerClient(network, uri)); }
public void InitBitcoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("BTC"); var coinaverage = new CoinAverageRateProviderDescription("BTC"); var bitpay = new BitpayRateProviderDescription(); var btcRate = new FallbackRateProviderDescription(new RateProviderDescription[] { coinaverage, bitpay }); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://www.smartbit.com.au/tx/{0}" : "https://testnet.smartbit.com.au/tx/{0}", NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork, NBXplorerNetwork = nbxplorerNetwork, UriScheme = "bitcoin", DefaultRateProvider = btcRate, CryptoImagePath = "imlegacy/bitcoin-symbol.svg", LightningImagePath = "imlegacy/btc-lightning.svg", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("0'") : new KeyPath("1'") }); }
public void InitViacoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("VIA"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Viacoin", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://explorer.viacoin.org/tx/{0}" : "https://explorer.viacoin.org/tx/{0}", NBXplorerNetwork = nbxplorerNetwork, UriScheme = "viacoin", DefaultRateRules = new[] { "VIA_X = VIA_BTC * BTC_X", "VIA_BTC = bittrex(VIA_BTC)" }, CryptoImagePath = "imlegacy/viacoin.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("14'") : new KeyPath("1'") }); }
public void InitNewyorkcoin() { var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("NYC"); Add(new BTCPayNetwork() { CryptoCode = nbxplorerNetwork.CryptoCode, DisplayName = "Newyorkcoin", BlockExplorerLink = NetworkType == ChainName.Mainnet ? "https://chainz.cryptoid.info/nyc/tx.dws?{0}.htm" : "https://chainz.cryptoid.info/nyc/tx.dws?{0}htm", NBXplorerNetwork = nbxplorerNetwork, UriScheme = "newyorkcoin", DefaultRateRules = new[] { "NYC_X = NYC_BTC * BTC_X", "NYC_BTC = southxchange(NYC_BTC)" }, CryptoImagePath = "imlegacy/newyorkcoin.png", DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType), CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("3'") : new KeyPath("1'") }); }