2018-01-08 22:45:09 +09:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2019-05-08 20:37:37 +02:00
|
|
|
using Microsoft.AspNetCore.Http;
|
2018-04-12 11:48:33 +09:00
|
|
|
using NBitcoin;
|
2018-01-08 22:45:09 +09:00
|
|
|
|
|
|
|
namespace BTCPayServer.Models.StoreViewModels
|
|
|
|
{
|
|
|
|
public class DerivationSchemeViewModel
|
|
|
|
{
|
2020-04-13 08:48:35 +02:00
|
|
|
|
2020-08-03 10:12:21 +02:00
|
|
|
[Display(Name = "Derivation scheme")]
|
2021-02-11 11:48:54 +01:00
|
|
|
public string DerivationScheme { get; set; }
|
2018-01-08 22:45:09 +09:00
|
|
|
|
2019-12-10 21:22:46 +09:00
|
|
|
public List<(string KeyPath, string Address, RootedKeyPath RootedKeyPath)> AddressSamples
|
2018-01-08 22:45:09 +09:00
|
|
|
{
|
|
|
|
get; set;
|
2019-12-10 21:22:46 +09:00
|
|
|
} = new List<(string KeyPath, string Address, RootedKeyPath RootedKeyPath)>();
|
2020-04-29 00:57:41 +09:00
|
|
|
|
2018-03-21 02:48:11 +09:00
|
|
|
public string CryptoCode { get; set; }
|
2018-12-26 14:04:00 +09:00
|
|
|
public string KeyPath { get; set; }
|
2021-02-11 11:48:54 +01:00
|
|
|
[Display(Name = "Root fingerprint")]
|
2019-05-10 01:05:37 +09:00
|
|
|
public string RootFingerprint { get; set; }
|
2018-02-07 21:59:16 +09:00
|
|
|
public bool Confirmation { get; set; }
|
|
|
|
|
2021-02-11 11:48:54 +01:00
|
|
|
[Display(Name = "Wallet file")]
|
2020-06-28 17:55:27 +09:00
|
|
|
public IFormFile WalletFile { get; set; }
|
2021-02-11 11:48:54 +01:00
|
|
|
[Display(Name = "Wallet file content")]
|
2020-10-21 14:03:11 +02:00
|
|
|
public string WalletFileContent { get; set; }
|
2019-05-09 16:11:09 +09:00
|
|
|
public string Config { get; set; }
|
2019-05-10 01:05:37 +09:00
|
|
|
public string Source { get; set; }
|
2021-02-11 11:48:54 +01:00
|
|
|
[Display(Name = "Derivation scheme format")]
|
2019-05-25 12:53:03 +09:00
|
|
|
public string DerivationSchemeFormat { get; set; }
|
2021-02-11 11:48:54 +01:00
|
|
|
[Display(Name = "Account key")]
|
2019-05-10 19:30:10 +09:00
|
|
|
public string AccountKey { get; set; }
|
2019-05-25 02:45:36 +00:00
|
|
|
public BTCPayNetwork Network { get; set; }
|
2021-02-11 11:48:54 +01:00
|
|
|
[Display(Name = "Can use hot wallet")]
|
2019-12-18 22:28:03 +09:00
|
|
|
public bool CanUseHotWallet { get; set; }
|
2021-02-11 11:48:54 +01:00
|
|
|
[Display(Name = "Can use RPC import")]
|
2020-04-13 08:48:35 +02:00
|
|
|
public bool CanUseRPCImport { get; set; }
|
2021-09-04 22:07:09 +09:00
|
|
|
public bool SupportSegwit { get; set; }
|
|
|
|
public bool SupportTaproot { get; set; }
|
|
|
|
[Display(Name = "Is taproot activated")]
|
|
|
|
public bool IsTaprootActivated { get; set; }
|
2019-12-10 21:22:46 +09:00
|
|
|
public RootedKeyPath GetAccountKeypath()
|
|
|
|
{
|
|
|
|
if (KeyPath != null && RootFingerprint != null &&
|
|
|
|
NBitcoin.KeyPath.TryParse(KeyPath, out var p) &&
|
|
|
|
HDFingerprint.TryParse(RootFingerprint, out var fp))
|
|
|
|
{
|
|
|
|
return new RootedKeyPath(fp, p);
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2018-01-08 22:45:09 +09:00
|
|
|
}
|
|
|
|
}
|