2021-04-13 10:36:49 +02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Globalization;
|
|
|
|
using NBitcoin;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Data
|
|
|
|
{
|
2021-12-31 16:59:02 +09:00
|
|
|
public class PayoutTransactionOnChainBlob : IPayoutProof
|
2021-04-13 10:36:49 +02:00
|
|
|
{
|
|
|
|
[JsonConverter(typeof(NBitcoin.JsonConverters.UInt256JsonConverter))]
|
|
|
|
public uint256 TransactionId { get; set; }
|
|
|
|
[JsonProperty(ItemConverterType = typeof(NBitcoin.JsonConverters.UInt256JsonConverter), NullValueHandling = NullValueHandling.Ignore)]
|
|
|
|
public HashSet<uint256> Candidates { get; set; } = new HashSet<uint256>();
|
|
|
|
|
|
|
|
[JsonIgnore] public string LinkTemplate { get; set; }
|
2021-06-10 11:43:45 +02:00
|
|
|
public string ProofType { get; } = "PayoutTransactionOnChainBlob";
|
|
|
|
|
2021-04-13 10:36:49 +02:00
|
|
|
[JsonIgnore]
|
|
|
|
public string Link
|
|
|
|
{
|
|
|
|
get { return Id != null ? string.Format(CultureInfo.InvariantCulture, LinkTemplate, Id) : null; }
|
|
|
|
}
|
|
|
|
public bool? Accounted { get; set; }//nullable to be backwards compatible. if null, accounted is true
|
|
|
|
[JsonIgnore]
|
|
|
|
public string Id { get { return TransactionId?.ToString(); } }
|
|
|
|
}
|
|
|
|
}
|