mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
WalletPSBTReady show the summary of the transaction, signing with the seed respect the keypath of the wallet settings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user