Open wallet with BIP21 links (#1565)

* Open wallet with BIP21 links

https://i.imgur.com/IWefMKB.gifv

* remove debugger;

* Move to settings
This commit is contained in:
Andrew Camilleri
2020-05-12 15:32:33 +02:00
committed by GitHub
parent f7d70daff3
commit 8ca2824b00
4 changed files with 48 additions and 12 deletions

View File

@@ -388,7 +388,7 @@ namespace BTCPayServer.Controllers
[Route("{walletId}/send")]
public async Task<IActionResult> WalletSend(
[ModelBinder(typeof(WalletIdModelBinder))]
WalletId walletId, string defaultDestination = null, string defaultAmount = null)
WalletId walletId, string defaultDestination = null, string defaultAmount = null, string bip21 = null)
{
if (walletId?.StoreId == null)
return NotFound();
@@ -416,6 +416,10 @@ namespace BTCPayServer.Controllers
},
CryptoCode = walletId.CryptoCode
};
if (!string.IsNullOrEmpty(bip21))
{
LoadFromBIP21(model, bip21, network);
}
var feeProvider = _feeRateProvider.CreateFeeProvider(network);
var recommendedFees =
new[]
@@ -1173,6 +1177,8 @@ namespace BTCPayServer.Controllers
var store = (await Repository.FindStore(walletId.StoreId, GetUserId()));
var vm = new WalletSettingsViewModel()
{
StoreName = store.StoreName,
UriScheme = derivationSchemeSettings.Network.UriScheme,
Label = derivationSchemeSettings.Label,
DerivationScheme = derivationSchemeSettings.AccountDerivation.ToString(),
DerivationSchemeInput = derivationSchemeSettings.AccountOriginal,