Altcoin - Add Chaincoin (#1636)

* Altcoin - Add Chaincoin

* Image

* Altcoin - Rating CHC

* Altcoin - Chaincoin insertion

* Revert

* Fix large diff

* Unit Test revert
This commit is contained in:
Peter Williams 2020-06-22 15:41:20 +10:00 committed by GitHub
parent 15b8a159f5
commit e751be21ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,33 @@
using NBitcoin;
namespace BTCPayServer
{
public partial class BTCPayNetworkProvider
{
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'")
});
}
}
}

View File

@ -60,6 +60,7 @@ namespace BTCPayServer
InitViacoin();
InitMonero();
InitPolis();
InitChaincoin();
// Assume that electrum mappings are same as BTC if not specified
foreach (var network in _Networks.Values.OfType<BTCPayNetwork>())

View File

@ -1266,6 +1266,13 @@
"symbol":null,
"crypto":true
},
{
"name":"CHC",
"code":"CHC",
"divisibility":8,
"symbol":null,
"crypto":true
},
{
"name":"Satoshis",
"code":"SATS",

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB