diff --git a/BTCPayServer/BTCPayNetworkProvider.cs b/BTCPayServer/BTCPayNetworkProvider.cs index 5a1d154a2..db9466e8c 100644 --- a/BTCPayServer/BTCPayNetworkProvider.cs +++ b/BTCPayServer/BTCPayNetworkProvider.cs @@ -8,6 +8,10 @@ namespace BTCPayServer { public class BTCPayNetworkProvider { + static BTCPayNetworkProvider() + { + NBXplorer.Altcoins.Litecoin.Networks.EnsureRegistered(); + } Dictionary _Networks = new Dictionary(); public BTCPayNetworkProvider(Network network) { @@ -20,6 +24,13 @@ namespace BTCPayServer NBitcoinNetwork = Network.Main, UriScheme = "bitcoin", }); + Add(new BTCPayNetwork() + { + CryptoCode = "LTC", + BlockExplorerLink = "https://live.blockcypher.com/ltc/tx/{0}/", + NBitcoinNetwork = NBXplorer.Altcoins.Litecoin.Networks.Mainnet, + UriScheme = "litecoin", + }); } if (network == Network.TestNet) @@ -31,6 +42,13 @@ namespace BTCPayServer NBitcoinNetwork = Network.TestNet, UriScheme = "bitcoin", }); + Add(new BTCPayNetwork() + { + CryptoCode = "LTC", + BlockExplorerLink = "http://explorer.litecointools.com/tx/{0}", + NBitcoinNetwork = NBXplorer.Altcoins.Litecoin.Networks.Testnet, + UriScheme = "litecoin", + }); } if (network == Network.RegTest) @@ -42,10 +60,17 @@ namespace BTCPayServer NBitcoinNetwork = Network.RegTest, UriScheme = "bitcoin" }); + Add(new BTCPayNetwork() + { + CryptoCode = "LTC", + BlockExplorerLink = "http://explorer.litecointools.com/tx/{0}", + NBitcoinNetwork = NBXplorer.Altcoins.Litecoin.Networks.Regtest, + UriScheme = "litecoin", + }); } } - [Obsolete("Should not be needed")] + [Obsolete("To use only for legacy stuff")] public BTCPayNetwork BTC { get diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 8fc598f96..70acf6e25 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -24,7 +24,7 @@ - +