| | | 1 | | namespace NLightning.Domain.Protocol.Payloads; |
| | | 2 | | |
| | | 3 | | using Channels.ValueObjects; |
| | | 4 | | using Interfaces; |
| | | 5 | | using Money; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Represents the payload for the update_add_htlc message. |
| | | 9 | | /// </summary> |
| | | 10 | | /// <remarks> |
| | | 11 | | /// Initializes a new instance of the TxAckRbfPayload class. |
| | | 12 | | /// </remarks> |
| | | 13 | | /// <param name="channelId">The channel ID.</param> |
| | 28 | 14 | | public class UpdateAddHtlcPayload( |
| | 28 | 15 | | LightningMoney amount, |
| | 28 | 16 | | ChannelId channelId, |
| | 28 | 17 | | uint cltvExpiry, |
| | 28 | 18 | | ulong id, |
| | 28 | 19 | | ReadOnlyMemory<byte> paymentHash, |
| | 28 | 20 | | ReadOnlyMemory<byte>? onionRoutingPacket = null) |
| | | 21 | | : IChannelMessagePayload |
| | | 22 | | { |
| | | 23 | | /// <summary> |
| | | 24 | | /// Gets the channel ID. |
| | | 25 | | /// </summary> |
| | 52 | 26 | | public ChannelId ChannelId { get; } = channelId; |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Offer Id |
| | | 30 | | /// </summary> |
| | | 31 | | /// <remarks> |
| | | 32 | | /// This should be 0 for the first offer for the channel and must be incremented by 1 for each successive offer |
| | | 33 | | /// </remarks> |
| | 52 | 34 | | public ulong Id { get; } = id; |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// AmountSats offered for this Htlc |
| | | 38 | | /// </summary> |
| | 52 | 39 | | public LightningMoney Amount { get; } = amount; |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// The payment hash |
| | | 43 | | /// </summary> |
| | 52 | 44 | | public ReadOnlyMemory<byte> PaymentHash { get; } = paymentHash; |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// The Cltv Expiration |
| | | 48 | | /// </summary> |
| | 52 | 49 | | public uint CltvExpiry { get; } = cltvExpiry; |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// |
| | | 53 | | /// </summary> |
| | 48 | 54 | | public ReadOnlyMemory<byte>? OnionRoutingPacket { get; } = onionRoutingPacket; |
| | | 55 | | } |