Allow entry in wallet send via fiat (#1891)

* Allow entry in wallet send via fiat

closes #1890
https://i.imgur.com/RUrSqD7.gif

* fix min amount in wallet send

* Add divisibility when setting amount from fiat
This commit is contained in:
Andrew Camilleri
2020-09-11 09:23:08 +02:00
committed by GitHub
parent e051581c39
commit fa46252c65
4 changed files with 46 additions and 11 deletions

View File

@@ -471,6 +471,8 @@ namespace BTCPayServer.Controllers
model.FeeSatoshiPerByte = model.RecommendedSatoshiPerByte.LastOrDefault()?.FeeRate;
model.SupportRBF = network.SupportRBF;
model.CryptoDivisibility = network.Divisibility;
using (CancellationTokenSource cts = new CancellationTokenSource())
{
try
@@ -480,7 +482,7 @@ namespace BTCPayServer.Controllers
if (result.BidAsk != null)
{
model.Rate = result.BidAsk.Center;
model.Divisibility = _currencyTable.GetNumberFormatInfo(currencyPair.Right, true).CurrencyDecimalDigits;
model.FiatDivisibility = _currencyTable.GetNumberFormatInfo(currencyPair.Right, true).CurrencyDecimalDigits;
model.Fiat = currencyPair.Right;
}
else