mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-28 02:14:23 +01:00
Add sats as a native currency
This will allow you to create an invoice where its primary currency is denominated in sats
This commit is contained in:
@@ -21,6 +21,11 @@ namespace BTCPayServer
|
||||
UriScheme = "bitcoin",
|
||||
CryptoImagePath = "imlegacy/bitcoin.svg",
|
||||
LightningImagePath = "imlegacy/bitcoin-lightning.svg",
|
||||
DefaultRateRules = new[]
|
||||
{
|
||||
"SATS_X = SATS_BTC * BTC_X",
|
||||
"BTC_SATS = sats(BTC_SATS);",
|
||||
},
|
||||
DefaultSettings = BTCPayDefaultSettings.GetDefaultSettings(NetworkType),
|
||||
CoinType = NetworkType == NetworkType.Mainnet ? new KeyPath("0'") : new KeyPath("1'"),
|
||||
SupportRBF = true,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -98,6 +98,12 @@ namespace BTCPayServer.Services.Rates
|
||||
{
|
||||
AddCurrency(_CurrencyProviders, network.CryptoCode, 8, network.CryptoCode);
|
||||
}
|
||||
|
||||
_CurrencyProviders.TryAdd("SATS",
|
||||
new NumberFormatInfo()
|
||||
{
|
||||
CurrencySymbol = "sats", CurrencyDecimalDigits = 0, CurrencyPositivePattern = 3
|
||||
});
|
||||
}
|
||||
return _CurrencyProviders.TryGet(currency.ToUpperInvariant());
|
||||
}
|
||||
@@ -189,6 +195,15 @@ namespace BTCPayServer.Services.Rates
|
||||
}
|
||||
}
|
||||
|
||||
dico.TryAdd("SATS", new CurrencyData()
|
||||
{
|
||||
Code = "SATS",
|
||||
Crypto = true,
|
||||
Divisibility = 0,
|
||||
Name = "Satoshis",
|
||||
Symbol = "Sats",
|
||||
});
|
||||
|
||||
return dico.Values.ToArray();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user