| | | 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_remote output in a commitment transaction. |
| | | 11 | | /// This follows the BOLT #3 specification for to_remote outputs. |
| | | 12 | | /// </summary> |
| | | 13 | | public class ToRemoteOutputInfo : IOutputInfo |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Gets the amount of the output. |
| | | 17 | | /// </summary> |
| | 72 | 18 | | public LightningMoney Amount { get; } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Gets the type of the output. |
| | | 22 | | /// </summary> |
| | 0 | 23 | | public OutputType OutputType => OutputType.ToRemote; |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Gets the remote's payment public key. |
| | | 27 | | /// </summary> |
| | 68 | 28 | | public CompactPubKey RemotePaymentPubKey { get; } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Gets whether this to_remote output should use anchors. |
| | | 32 | | /// </summary> |
| | 0 | 33 | | public bool UseAnchors { get; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Gets or sets the transaction ID of the output once it's created. |
| | | 37 | | /// </summary> |
| | 0 | 38 | | public TxId? TransactionId { get; set; } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// Gets or sets the index of the output in the transaction once it's created. |
| | | 42 | | /// </summary> |
| | 0 | 43 | | public ushort? Index { get; set; } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// Creates a new instance of ToRemoteOutputInfo. |
| | | 47 | | /// </summary> |
| | 72 | 48 | | public ToRemoteOutputInfo(LightningMoney amount, CompactPubKey remotePaymentPubKey, bool useAnchors = false) |
| | | 49 | | { |
| | 72 | 50 | | Amount = amount; |
| | 72 | 51 | | RemotePaymentPubKey = remotePaymentPubKey; |
| | 72 | 52 | | UseAnchors = useAnchors; |
| | 72 | 53 | | } |
| | | 54 | | } |