| | 1 | | namespace NLightning.Domain.Protocol.Payloads; |
| | 2 | |
|
| | 3 | | using Bitcoin.ValueObjects; |
| | 4 | | using Channels.ValueObjects; |
| | 5 | | using Interfaces; |
| | 6 | | using Messages; |
| | 7 | | using Money; |
| | 8 | |
|
| | 9 | | /// <summary> |
| | 10 | | /// Represents a tx_add_output payload. |
| | 11 | | /// </summary> |
| | 12 | | /// <remarks> |
| | 13 | | /// The tx_add_output payload is used to add an output to the transaction. |
| | 14 | | /// </remarks> |
| | 15 | | /// <seealso cref="TxAddOutputMessage"/> |
| | 16 | | /// <seealso cref="Channels.ValueObjects.ChannelId"/> |
| | 17 | | public class TxAddOutputPayload : IChannelMessagePayload |
| | 18 | | { |
| | 19 | | /// <summary> |
| | 20 | | /// The channel id. |
| | 21 | | /// </summary> |
| 8 | 22 | | public ChannelId ChannelId { get; } |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// The serial id. |
| | 26 | | /// </summary> |
| 8 | 27 | | public ulong SerialId { get; } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// The sats amount. |
| | 31 | | /// </summary> |
| 8 | 32 | | public LightningMoney Amount { get; } |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// The spending script. |
| | 36 | | /// </summary> |
| 12 | 37 | | public BitcoinScript Script { get; } |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// Initializes a new instance of the <see cref="TxAddOutputPayload"/> class. |
| | 41 | | /// </summary> |
| | 42 | | /// <param name="channelId">The channel id.</param> |
| | 43 | | /// <param name="serialId">The serial id.</param> |
| | 44 | | /// <param name="amount">The sats amount.</param> |
| | 45 | | /// <param name="script">The spending script.</param> |
| | 46 | | /// <exception cref="ArgumentException">ScriptPubKey length is out of bounds.</exception> |
| 8 | 47 | | public TxAddOutputPayload(LightningMoney amount, ChannelId channelId, BitcoinScript script, ulong serialId) |
| | 48 | | { |
| 8 | 49 | | ChannelId = channelId; |
| 8 | 50 | | SerialId = serialId; |
| 8 | 51 | | Amount = amount; |
| 8 | 52 | | Script = script; |
| 8 | 53 | | } |
| | 54 | | } |