btcpayserver/BTCPayServer/Models/WalletViewModels/WalletSettingsViewModel.cs
Andrew Camilleri 4176f3659b
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
2020-10-21 14:03:11 +02:00

37 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
namespace BTCPayServer.Models.WalletViewModels
{
public class WalletSettingsViewModel
{
public string Label { get; set; }
[DisplayName("Derivation scheme")]
public string DerivationScheme { get; set; }
public string DerivationSchemeInput { get; set; }
[Display(Name = "Is signing key")]
public string SelectedSigningKey { get; set; }
public bool IsMultiSig => AccountKeys.Count > 1;
public List<WalletSettingsAccountKeyViewModel> AccountKeys { get; set; } = new List<WalletSettingsAccountKeyViewModel>();
public bool NBXSeedAvailable { get; set; }
public string StoreName { get; set; }
public string UriScheme { get; set; }
}
public class WalletSettingsAccountKeyViewModel
{
[JsonProperty("ExtPubKey")]
[DisplayName("Account key")]
public string AccountKey { get; set; }
[DisplayName("Master fingerprint")]
[Validation.HDFingerPrintValidator]
public string MasterFingerprint { get; set; }
[DisplayName("Account key path")]
[Validation.KeyPathValidator]
public string AccountKeyPath { get; set; }
}
}