2019-05-11 00:29:29 +09:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-05-12 13:13:52 +09:00
|
|
|
|
using NBitcoin;
|
2019-05-11 00:29:29 +09:00
|
|
|
|
|
|
|
|
|
namespace BTCPayServer.Models.WalletViewModels
|
|
|
|
|
{
|
|
|
|
|
public class WalletPSBTViewModel
|
|
|
|
|
{
|
|
|
|
|
public string Decoded { get; set; }
|
2019-05-13 08:55:26 +09:00
|
|
|
|
string _FileName;
|
|
|
|
|
public string FileName
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return string.IsNullOrEmpty(_FileName) ? "psbt-export.psbt" : _FileName;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_FileName = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-05-11 00:29:29 +09:00
|
|
|
|
public string PSBT { get; set; }
|
2019-05-12 00:05:30 +09:00
|
|
|
|
public List<string> Errors { get; set; } = new List<string>();
|
2019-05-12 13:13:52 +09:00
|
|
|
|
|
|
|
|
|
internal PSBT GetPSBT(Network network)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return NBitcoin.PSBT.Parse(PSBT, network);
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2019-05-11 00:29:29 +09:00
|
|
|
|
}
|
|
|
|
|
}
|