2018-01-12 11:54:57 +09:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using NBitcoin;
|
|
|
|
|
using NBXplorer;
|
|
|
|
|
|
|
|
|
|
namespace BTCPayServer
|
|
|
|
|
{
|
|
|
|
|
public partial class BTCPayNetworkProvider
|
|
|
|
|
{
|
|
|
|
|
public void InitBitcoin()
|
|
|
|
|
{
|
|
|
|
|
var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("BTC");
|
|
|
|
|
Add(new BTCPayNetwork()
|
|
|
|
|
{
|
|
|
|
|
CryptoCode = nbxplorerNetwork.CryptoCode,
|
2018-07-16 23:25:28 -05:00
|
|
|
|
DisplayName = "Bitcoin",
|
2019-05-31 01:26:41 -04:00
|
|
|
|
BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://blockstream.info/tx/{0}" : "https://blockstream.info/testnet/tx/{0}",
|
2018-01-12 11:54:57 +09:00
|
|
|
|
NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork,
|
|
|
|
|
NBXplorerNetwork = nbxplorerNetwork,
|
|
|
|
|
UriScheme = "bitcoin",
|
2018-07-16 23:29:55 -05:00
|
|
|
|
CryptoImagePath = "imlegacy/bitcoin.svg",
|
|
|
|
|
LightningImagePath = "imlegacy/bitcoin-lightning.svg",
|
2018-04-19 16:54:25 +09:00
|
|
|
|
DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType),
|
2019-05-08 15:24:20 +09:00
|
|
|
|
CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("0'") : new KeyPath("1'"),
|
2019-05-09 09:05:18 +02:00
|
|
|
|
SupportRBF = true,
|
2019-05-09 09:20:51 +02:00
|
|
|
|
//https://github.com/spesmilo/electrum/blob/11733d6bc271646a00b69ff07657119598874da4/electrum/constants.py
|
|
|
|
|
ElectrumMapping = NetworkType == NetworkType.Mainnet
|
2019-05-09 19:05:08 +09:00
|
|
|
|
? new Dictionary<uint, DerivationType>()
|
2019-05-09 09:20:51 +02:00
|
|
|
|
{
|
2019-05-09 19:05:08 +09:00
|
|
|
|
{0x0488b21eU, DerivationType.Legacy }, // xpub
|
|
|
|
|
{0x049d7cb2U, DerivationType.SegwitP2SH }, // ypub
|
|
|
|
|
{0x4b24746U, DerivationType.Segwit }, //zpub
|
2019-05-09 09:20:51 +02:00
|
|
|
|
}
|
2019-05-09 19:05:08 +09:00
|
|
|
|
: new Dictionary<uint, DerivationType>()
|
2019-05-09 09:20:51 +02:00
|
|
|
|
{
|
2019-05-09 19:05:08 +09:00
|
|
|
|
{0x043587cfU, DerivationType.Legacy},
|
|
|
|
|
{0x044a5262U, DerivationType.SegwitP2SH},
|
|
|
|
|
{0x045f1cf6U, DerivationType.Segwit}
|
2019-05-09 09:20:51 +02:00
|
|
|
|
}
|
2018-01-12 11:54:57 +09:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|