mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
Add support for groestlcoin
This commit is contained in:
parent
17e914778d
commit
5feb520843
33
BTCPayServer/BTCPayNetworkProvider.Groestlcoin.cs
Normal file
33
BTCPayServer/BTCPayNetworkProvider.Groestlcoin.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NBitcoin;
|
||||||
|
|
||||||
|
namespace BTCPayServer
|
||||||
|
{
|
||||||
|
public partial class BTCPayNetworkProvider
|
||||||
|
{
|
||||||
|
public void InitGroestlcoin()
|
||||||
|
{
|
||||||
|
|
||||||
|
var nbxplorerNetwork = NBXplorerNetworkProvider.GetFromCryptoCode("GRS");
|
||||||
|
Add(new BTCPayNetwork()
|
||||||
|
{
|
||||||
|
CryptoCode = nbxplorerNetwork.CryptoCode,
|
||||||
|
BlockExplorerLink = NetworkType == NetworkType.Mainnet ? "https://chainz.cryptoid.info/grs/tx.dws?{0}.htm" : "https://chainz.cryptoid.info/grs-test/tx.dws?{0}.htm",
|
||||||
|
NBitcoinNetwork = nbxplorerNetwork.NBitcoinNetwork,
|
||||||
|
NBXplorerNetwork = nbxplorerNetwork,
|
||||||
|
UriScheme = "groestlcoin",
|
||||||
|
DefaultRateRules = new[]
|
||||||
|
{
|
||||||
|
"GRS_X = GRS_BTC * BTC_X",
|
||||||
|
"GRS_BTC = bittrex(GRS_BTC)"
|
||||||
|
},
|
||||||
|
CryptoImagePath = "imlegacy/groestlcoin.png",
|
||||||
|
DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType),
|
||||||
|
CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("17'") : new KeyPath("1'")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -52,6 +52,7 @@ namespace BTCPayServer
|
|||||||
InitMonacoin();
|
InitMonacoin();
|
||||||
InitPolis();
|
InitPolis();
|
||||||
InitFeathercoin();
|
InitFeathercoin();
|
||||||
|
InitGroestlcoin();
|
||||||
InitUfo();
|
InitUfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<Version>1.0.2.34</Version>
|
<Version>1.0.2.35</Version>
|
||||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -40,10 +40,10 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.0" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.NetCore.Analyzers" Version="2.6.0" />
|
<PackageReference Include="Microsoft.NetCore.Analyzers" Version="2.6.0" />
|
||||||
<PackageReference Include="NBitcoin" Version="4.1.1.10" />
|
<PackageReference Include="NBitcoin" Version="4.1.1.18" />
|
||||||
<PackageReference Include="NBitpayClient" Version="1.0.0.28" />
|
<PackageReference Include="NBitpayClient" Version="1.0.0.29" />
|
||||||
<PackageReference Include="DBreeze" Version="1.87.0" />
|
<PackageReference Include="DBreeze" Version="1.87.0" />
|
||||||
<PackageReference Include="NBXplorer.Client" Version="1.0.2.10" />
|
<PackageReference Include="NBXplorer.Client" Version="1.0.2.11" />
|
||||||
<PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" />
|
<PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" />
|
||||||
<PackageReference Include="NicolasDorier.CommandLine.Configuration" Version="1.0.0.3" />
|
<PackageReference Include="NicolasDorier.CommandLine.Configuration" Version="1.0.0.3" />
|
||||||
<PackageReference Include="NicolasDorier.StandardConfiguration" Version="1.0.0.14" />
|
<PackageReference Include="NicolasDorier.StandardConfiguration" Version="1.0.0.14" />
|
||||||
|
@ -78,7 +78,7 @@ namespace BTCPayServer.Controllers
|
|||||||
var wallet = _WalletProvider.GetWallet(network);
|
var wallet = _WalletProvider.GetWallet(network);
|
||||||
if (wallet == null)
|
if (wallet == null)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
var payment = PaymentMessage.Load(Request.Body);
|
var payment = PaymentMessage.Load(Request.Body, network.NBitcoinNetwork);
|
||||||
var unused = wallet.BroadcastTransactionsAsync(payment.Transactions);
|
var unused = wallet.BroadcastTransactionsAsync(payment.Transactions);
|
||||||
await _InvoiceRepository.AddRefundsAsync(invoiceId, payment.RefundTo.Select(p => new TxOut(p.Amount, p.Script)).ToArray(), network.NBitcoinNetwork);
|
await _InvoiceRepository.AddRefundsAsync(invoiceId, payment.RefundTo.Select(p => new TxOut(p.Amount, p.Script)).ToArray(), network.NBitcoinNetwork);
|
||||||
return new PaymentAckActionResult(payment.CreateACK(invoiceId + " is currently processing, thanks for your purchase..."));
|
return new PaymentAckActionResult(payment.CreateACK(invoiceId + " is currently processing, thanks for your purchase..."));
|
||||||
|
@ -72,7 +72,7 @@ namespace BTCPayServer
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var data = Encoders.Base58Check.DecodeData(parts[i]);
|
var data = Network.GetBase58CheckEncoder().DecodeData(parts[i]);
|
||||||
if (data.Length < 4)
|
if (data.Length < 4)
|
||||||
continue;
|
continue;
|
||||||
var prefix = Utils.ToUInt32(data, false);
|
var prefix = Utils.ToUInt32(data, false);
|
||||||
@ -80,7 +80,7 @@ namespace BTCPayServer
|
|||||||
for (int ii = 0; ii < 4; ii++)
|
for (int ii = 0; ii < 4; ii++)
|
||||||
data[ii] = standardPrefix[ii];
|
data[ii] = standardPrefix[ii];
|
||||||
|
|
||||||
var derivationScheme = new BitcoinExtPubKey(Encoders.Base58Check.EncodeData(data), Network).ToString();
|
var derivationScheme = new BitcoinExtPubKey(Network.GetBase58CheckEncoder().EncodeData(data), Network).ToString();
|
||||||
electrumMapping.TryGetValue(prefix, out string[] labels);
|
electrumMapping.TryGetValue(prefix, out string[] labels);
|
||||||
if (labels != null)
|
if (labels != null)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="order-details">
|
<div class="order-details">
|
||||||
@if (Model.AvailableCryptos.Count > 1)
|
@if (Model.AvailableCryptos.Count > 0)
|
||||||
{
|
{
|
||||||
<div class="currency-selection">
|
<div class="currency-selection">
|
||||||
<div class="single-item-order__left">
|
<div class="single-item-order__left">
|
||||||
|
BIN
BTCPayServer/wwwroot/imlegacy/groestlcoin.png
Normal file
BIN
BTCPayServer/wwwroot/imlegacy/groestlcoin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 93 KiB |
13
README.md
13
README.md
@ -20,6 +20,19 @@ This solution is for you if:
|
|||||||
* You want to become a payment processor yourself and offer a BTCPay hosted solution to merchants
|
* You want to become a payment processor yourself and offer a BTCPay hosted solution to merchants
|
||||||
* You want a way to support currencies other than those offered by Bitpay
|
* You want a way to support currencies other than those offered by Bitpay
|
||||||
|
|
||||||
|
## We support altcoins!
|
||||||
|
|
||||||
|
In addition to Bitcoin, we support the following crypto currencies:
|
||||||
|
|
||||||
|
* BGold
|
||||||
|
* Dogecoin
|
||||||
|
* Feathercoin
|
||||||
|
* Groestlcoin
|
||||||
|
* Litecoin
|
||||||
|
* Monacoin
|
||||||
|
* Polis
|
||||||
|
* UFO
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Please check out our [complete documentation](https://github.com/btcpayserver/btcpayserver-doc) for more details.
|
Please check out our [complete documentation](https://github.com/btcpayserver/btcpayserver-doc) for more details.
|
||||||
|
Loading…
Reference in New Issue
Block a user