mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 23:54:26 +01:00
27 lines
611 B
C#
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());
|
|
}
|
|
}
|