mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-12 10:30:47 +01:00
make sure link provider is per payment method of liquid assets. Also remove ETB as it has been unused. Also hide the send button as it is not supported thrrough BTCPay
41 lines
1.7 KiB
C#
41 lines
1.7 KiB
C#
using BTCPayServer.Hosting;
|
|
using BTCPayServer.Payments;
|
|
using BTCPayServer.Services;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using NBitcoin;
|
|
using NBitcoin.Altcoins;
|
|
using NBitcoin.Altcoins.Elements;
|
|
using NBXplorer;
|
|
|
|
namespace BTCPayServer.Plugins.Altcoins;
|
|
public partial class AltcoinsPlugin
|
|
{
|
|
public void InitLiquid(IServiceCollection services, NBXplorer.NBXplorerNetwork nbxplorerNetwork)
|
|
{
|
|
var network = new ElementsBTCPayNetwork()
|
|
{
|
|
AssetId = ChainName == ChainName.Mainnet ? ElementsParams<Liquid>.PeggedAssetId : ElementsParams<Liquid.LiquidRegtest>.PeggedAssetId,
|
|
CryptoCode = "LBTC",
|
|
NetworkCryptoCode = "LBTC",
|
|
DisplayName = "Liquid Bitcoin",
|
|
DefaultRateRules = new[]
|
|
{
|
|
"LBTC_X = LBTC_BTC * BTC_X",
|
|
"LBTC_BTC = 1",
|
|
},
|
|
NBXplorerNetwork = nbxplorerNetwork,
|
|
CryptoImagePath = "imlegacy/liquid.png",
|
|
DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(ChainName),
|
|
CoinType = ChainName == ChainName.Mainnet ? new KeyPath("1776'") : new KeyPath("1'"),
|
|
SupportRBF = true,
|
|
SupportLightning = false,
|
|
SupportPayJoin = false,
|
|
VaultSupported = false,
|
|
ReadonlyWallet = true
|
|
}.SetDefaultElectrumMapping(ChainName);
|
|
|
|
var blockExplorerLink = ChainName == ChainName.Mainnet ? "https://liquid.network/tx/{0}" : "https://liquid.network/testnet/tx/{0}";
|
|
services.AddBTCPayNetwork(network)
|
|
.AddTransactionLinkProvider(PaymentTypes.CHAIN.GetPaymentMethodId(nbxplorerNetwork.CryptoCode), new DefaultTransactionLinkProvider(blockExplorerLink));
|
|
}
|
|
}
|