| | 1 | | namespace NLightning.Domain.Protocol.Payloads; |
| | 2 | |
|
| | 3 | | using Interfaces; |
| | 4 | | using Money; |
| | 5 | | using ValueObjects; |
| | 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(LightningMoney amount, ChannelId channelId, uint cltvExpiry, ulong id, |
| 28 | 15 | | ReadOnlyMemory<byte> paymentHash, ReadOnlyMemory<byte>? onionRoutingPacket = null) |
| | 16 | | : IMessagePayload |
| | 17 | | { |
| | 18 | | /// <summary> |
| | 19 | | /// Gets the channel ID. |
| | 20 | | /// </summary> |
| 52 | 21 | | public ChannelId ChannelId { get; } = channelId; |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// Offer Id |
| | 25 | | /// </summary> |
| | 26 | | /// <remarks> |
| | 27 | | /// This should be 0 for the first offer for the channel and must be incremented by 1 for each successive offer |
| | 28 | | /// </remarks> |
| 52 | 29 | | public ulong Id { get; } = id; |
| | 30 | |
|
| | 31 | | /// <summary> |
| | 32 | | /// AmountSats offered for this Htlc |
| | 33 | | /// </summary> |
| 52 | 34 | | public LightningMoney Amount { get; } = amount; |
| | 35 | |
|
| | 36 | | /// <summary> |
| | 37 | | /// The payment hash |
| | 38 | | /// </summary> |
| 52 | 39 | | public ReadOnlyMemory<byte> PaymentHash { get; } = paymentHash; |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// The Cltv Expiration |
| | 43 | | /// </summary> |
| 52 | 44 | | public uint CltvExpiry { get; } = cltvExpiry; |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// |
| | 48 | | /// </summary> |
| 48 | 49 | | public ReadOnlyMemory<byte>? OnionRoutingPacket { get; } = onionRoutingPacket; |
| | 50 | | } |