Support electrum segwit xpub format

This commit is contained in:
nicolas.dorier
2017-12-06 18:08:21 +09:00
parent a52a1901c4
commit 24ce325e31
6 changed files with 143 additions and 104 deletions

View File

@@ -1,5 +1,6 @@
using BTCPayServer.Services.Invoices;
using BTCPayServer.Validations;
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -10,6 +11,21 @@ namespace BTCPayServer.Models.StoreViewModels
{
public class StoreViewModel
{
class Format
{
public string Name { get; set; }
public string Value { get; set; }
}
public StoreViewModel()
{
var btcPay = new Format { Name = "BTCPay", Value = "BTCPay" };
DerivationSchemeFormat = btcPay.Value;
DerivationSchemeFormats = new SelectList(new Format[]
{
btcPay,
new Format { Name = "Electrum", Value = "Electrum" },
}, nameof(btcPay.Value), nameof(btcPay.Name), btcPay);
}
public string Id { get; set; }
[Display(Name = "Store Name")]
[Required]
@@ -29,12 +45,20 @@ namespace BTCPayServer.Models.StoreViewModels
set;
}
[DerivationStrategyValidator]
public string DerivationScheme
{
get; set;
}
[Display(Name = "Derivation Scheme format")]
public string DerivationSchemeFormat
{
get;
set;
}
public SelectList DerivationSchemeFormats { get; set; }
[Display(Name = "Payment invalid if transactions fails to confirm after ... minutes")]
[Range(10, 60 * 24 * 31)]
public int MonitoringExpiration