| | 1 | | using NLightning.Domain.Bitcoin.Transactions.Enums; |
| | 2 | | using NLightning.Domain.Bitcoin.Transactions.Interfaces; |
| | 3 | | using NLightning.Domain.Bitcoin.ValueObjects; |
| | 4 | | using NLightning.Domain.Crypto.ValueObjects; |
| | 5 | | using NLightning.Domain.Money; |
| | 6 | |
|
| | 7 | | namespace NLightning.Domain.Bitcoin.Transactions.Outputs; |
| | 8 | |
|
| | 9 | | /// <summary> |
| | 10 | | /// Represents the information needed to construct a to_local output in a commitment transaction. |
| | 11 | | /// This follows the BOLT #3 specification for to_local outputs. |
| | 12 | | /// </summary> |
| | 13 | | public class ToLocalOutputInfo : IOutputInfo |
| | 14 | | { |
| | 15 | | /// <summary> |
| | 16 | | /// Gets the amount of the output. |
| | 17 | | /// </summary> |
| 64 | 18 | | public LightningMoney Amount { get; } |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Gets the type of the output. |
| | 22 | | /// </summary> |
| 0 | 23 | | public OutputType OutputType => OutputType.ToLocal; |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// Gets the remote's revocation public key. |
| | 27 | | /// </summary> |
| 60 | 28 | | public CompactPubKey RevocationPubKey { get; } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Gets the local's delayed payment public key. |
| | 32 | | /// </summary> |
| 60 | 33 | | public CompactPubKey LocalDelayedPaymentPubKey { get; } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Gets the CSV delay for the to_local output. |
| | 37 | | /// </summary> |
| 60 | 38 | | public ushort ToSelfDelay { get; } |
| | 39 | |
|
| | 40 | | /// <summary> |
| | 41 | | /// Gets or sets the transaction ID of the output once it's created. |
| | 42 | | /// </summary> |
| 0 | 43 | | public TxId? TransactionId { get; set; } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// Gets or sets the index of the output in the transaction once it's created. |
| | 47 | | /// </summary> |
| 0 | 48 | | public ushort? Index { get; set; } |
| | 49 | |
|
| | 50 | | /// <summary> |
| | 51 | | /// Creates a new instance of ToLocalOutputInfo. |
| | 52 | | /// </summary> |
| 64 | 53 | | public ToLocalOutputInfo(LightningMoney amount, CompactPubKey localDelayedPaymentPubKey, |
| 64 | 54 | | CompactPubKey revocationPubKey, ushort toSelfDelay) |
| | 55 | | { |
| 64 | 56 | | Amount = amount; |
| 64 | 57 | | RevocationPubKey = revocationPubKey; |
| 64 | 58 | | LocalDelayedPaymentPubKey = localDelayedPaymentPubKey; |
| 64 | 59 | | ToSelfDelay = toSelfDelay; |
| 64 | 60 | | } |
| | 61 | | } |