btcpayserver/BTCPayServer/Data/Payouts/BitcoinLike/PayoutTransactionOnChainBlob.cs

29 lines
1.1 KiB
C#
Raw Normal View History

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
{
[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; }
public string ProofType { get; } = Type;
public const string Type = "PayoutTransactionOnChainBlob";
[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(); } }
}
}