WalletPSBTReady show the summary of the transaction, signing with the seed respect the keypath of the wallet settings

This commit is contained in:
nicolas.dorier
2019-05-15 15:00:09 +09:00
parent 210d680b21
commit a68915d6cf
9 changed files with 232 additions and 101 deletions

View File

@@ -1,4 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using NBitcoin;
namespace BTCPayServer.Models.WalletViewModels
{
@@ -12,6 +15,29 @@ namespace BTCPayServer.Models.WalletViewModels
[Display(Name = "Optional seed passphrase")]
public string Passphrase { get; set; }
public bool Send { get; set; }
public ExtKey GetExtKey(Network network)
{
ExtKey extKey = null;
try
{
var mnemonic = new Mnemonic(SeedOrKey);
extKey = mnemonic.DeriveExtKey(Passphrase);
}
catch (Exception)
{
}
if (extKey == null)
{
try
{
extKey = ExtKey.Parse(SeedOrKey, network);
}
catch (Exception)
{
}
}
return extKey;
}
}
}