Add QR code scan/show for PSBT + Import wallet via QR (#1931)

* Add PSBT QR code scan/show

This PR introduces support to show and read PSBTs in BC-UR format via animated QR codes.  This allows you to use BTCPay with HW devices such as Cobo Vault and Blue wallet to sign transactions without ever exposing the keys outside of that device.
Spec: https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md
I've also bumped the QR code library we sue as it had a bug with large datasets.

* Reuse same code for all and allow wallet import via QR code scan

* remove unecessary js vendor files

* Allow export wallet from settings via QR

* formatting

* bundle

* fix wallet receive bundle
This commit is contained in:
Andrew Camilleri
2020-10-21 14:03:11 +02:00
committed by GitHub
parent 5979fe5eef
commit 4176f3659b
23 changed files with 480 additions and 10581 deletions

View File

@@ -80,6 +80,7 @@ namespace BTCPayServer.Controllers
{
vm.Decoded = psbt.ToString();
vm.PSBT = psbt.ToBase64();
vm.PSBTHex = psbt.ToHex();
}
return View(nameof(WalletPSBT), vm ?? new WalletPSBTViewModel() { CryptoCode = walletId.CryptoCode });
@@ -104,6 +105,8 @@ namespace BTCPayServer.Controllers
ModelState.AddModelError(nameof(vm.PSBT), "Invalid PSBT");
return View(vm);
}
vm.PSBTHex = psbt.ToHex();
var res = await TryHandleSigningCommands(walletId, psbt, command, new SigningContextModel(psbt));
if (res != null)
{
@@ -117,6 +120,7 @@ namespace BTCPayServer.Controllers
ModelState.Remove(nameof(vm.FileName));
ModelState.Remove(nameof(vm.UploadedPSBTFile));
vm.PSBT = psbt.ToBase64();
vm.PSBTHex = psbt.ToHex();
vm.FileName = vm.UploadedPSBTFile?.FileName;
return View(vm);