2018-01-12 11:54:57 +09:00
|
|
|
using System.Collections.Generic;
|
2018-02-13 03:27:36 +09:00
|
|
|
using NBitcoin;
|
2018-01-12 11:54:57 +09:00
|
|
|
using NBXplorer;
|
|
|
|
|
|
|
|
namespace BTCPayServer
|
|
|
|
{
|
|
|
|
public partial class BTCPayNetworkProvider
|
|
|
|
{
|
|
|
|
public void InitLitecoin()
|
|
|
|
{
|
|
|
|
var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("LTC");
|
|
|
|
Add(new BTCPayNetwork()
|
|
|
|
{
|
|
|
|
CryptoCode = nbxplorerNetwork.CryptoCode,
|
2018-07-16 23:25:28 -05:00
|
|
|
DisplayName = "Litecoin",
|
2021-01-27 14:39:38 +09:00
|
|
|
BlockExplorerLink = NetworkType == ChainName.Mainnet
|
2019-05-09 09:20:51 +02:00
|
|
|
? "https://live.blockcypher.com/ltc/tx/{0}/"
|
|
|
|
: "http://explorer.litecointools.com/tx/{0}",
|
2018-01-12 11:54:57 +09:00
|
|
|
NBXplorerNetwork = nbxplorerNetwork,
|
|
|
|
UriScheme = "litecoin",
|
2020-01-13 22:20:45 +09:00
|
|
|
DefaultRateRules = new[]
|
|
|
|
{
|
|
|
|
"LTC_X = LTC_BTC * BTC_X",
|
|
|
|
"LTC_BTC = coingecko(LTC_BTC)"
|
|
|
|
},
|
2018-07-16 23:29:55 -05:00
|
|
|
CryptoImagePath = "imlegacy/litecoin.svg",
|
|
|
|
LightningImagePath = "imlegacy/litecoin-lightning.svg",
|
2018-04-19 16:54:25 +09:00
|
|
|
DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType),
|
2021-01-27 14:39:38 +09:00
|
|
|
CoinType = NetworkType == ChainName.Mainnet ? new KeyPath("2'") : new KeyPath("1'"),
|
2019-05-09 09:20:51 +02:00
|
|
|
//https://github.com/pooler/electrum-ltc/blob/0d6989a9d2fb2edbea421c116e49d1015c7c5a91/electrum_ltc/constants.py
|
2021-01-27 14:39:38 +09:00
|
|
|
ElectrumMapping = NetworkType == ChainName.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 },
|
|
|
|
{0x049d7cb2U, DerivationType.SegwitP2SH },
|
|
|
|
{0x04b24746U, DerivationType.Segwit },
|
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
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|