Class TxAddOutputPayload
- Namespace
- NLightning.Bolts.BOLT2.Payloads
- Assembly
- NLightning.Bolts.dll
Represents a tx_add_output payload.
public class TxAddOutputPayload : IMessagePayload
- Inheritance
-
TxAddOutputPayload
- Implements
- Inherited Members
Remarks
The tx_add_output payload is used to add an output to the transaction.
Constructors
TxAddOutputPayload(ChannelId, ulong, ulong, byte[])
Initializes a new instance of the TxAddOutputPayload class.
public TxAddOutputPayload(ChannelId channelId, ulong serialId, ulong sats, byte[] script)
Parameters
channelId
ChannelIdThe channel id.
serialId
ulongThe serial id.
sats
ulongThe sats amount.
script
byte[]The spending script.
Exceptions
- ArgumentException
Script length is out of bounds.
Properties
ChannelId
The channel id.
public ChannelId ChannelId { get; }
Property Value
Sats
The sats amount.
public ulong Sats { get; }
Property Value
Script
The spending script.
public byte[] Script { get; }
Property Value
- byte[]
SerialId
The serial id.
public ulong SerialId { get; }
Property Value
Methods
DeserializeAsync(Stream)
Deserialize a TxAddOutputPayload from a stream.
public static Task<TxAddOutputPayload> DeserializeAsync(Stream stream)
Parameters
stream
StreamThe stream to deserialize from.
Returns
- Task<TxAddOutputPayload>
The deserialized TxAddOutputPayload.
Exceptions
- PayloadSerializationException
Error deserializing Payload
SerializeAsync(Stream)
Serializes the message payload to a stream.
public Task SerializeAsync(Stream stream)
Parameters
stream
StreamThe stream to serialize to.
Returns
- Task
A task that represents the asynchronous operation.