Files
2023-02-09 15:43:55 +01:00

27 lines
611 B
C#

using NBitcoin;
using Newtonsoft.Json;
using WalletWasabi.Affiliation.Serialization;
namespace WalletWasabi.Affiliation.Models.CoinjoinRequest;
public record Output
{
public Output(long amount, byte[] script_pubkey)
{
Amount = amount;
ScriptPubkey = script_pubkey;
}
[JsonProperty(PropertyName = "amount")]
public long Amount { get; }
[JsonProperty(PropertyName = "script_pubkey")]
[JsonConverter(typeof(AffiliationByteArrayJsonConverter))]
public byte[] ScriptPubkey { get; }
public static Output FromTxOut(TxOut txOut)
{
return new Output(txOut.Value, txOut.ScriptPubKey.ToBytes());
}
}