Class CommitmentTransactionModel
- Namespace
- NLightning.Domain.Bitcoin.Transactions.Models
- Assembly
- NLightning.Domain.dll
Represents a commitment transaction in the domain model. This class encapsulates the logical structure of a Lightning Network commitment transaction as defined by BOLT specifications, without dependencies on specific Bitcoin libraries.
public class CommitmentTransactionModel
- Inheritance
-
CommitmentTransactionModel
- Inherited Members
Constructors
CommitmentTransactionModel(CommitmentNumber, LightningMoney, FundingOutputInfo, AnchorOutputInfo?, AnchorOutputInfo?, ToLocalOutputInfo?, ToRemoteOutputInfo?, IEnumerable<OfferedHtlcOutputInfo>?, IEnumerable<ReceivedHtlcOutputInfo>?)
Creates a new instance of CommitmentTransactionModel.
public CommitmentTransactionModel(CommitmentNumber commitmentNumber, LightningMoney fee, FundingOutputInfo fundingOutput, AnchorOutputInfo? localAnchorOutput = null, AnchorOutputInfo? remoteAnchorOutput = null, ToLocalOutputInfo? toLocalOutput = null, ToRemoteOutputInfo? toRemoteOutput = null, IEnumerable<OfferedHtlcOutputInfo>? offeredHtlcOutputs = null, IEnumerable<ReceivedHtlcOutputInfo>? receivedHtlcOutputs = null)
Parameters
commitmentNumber
CommitmentNumberfee
LightningMoneyfundingOutput
FundingOutputInfolocalAnchorOutput
AnchorOutputInforemoteAnchorOutput
AnchorOutputInfotoLocalOutput
ToLocalOutputInfotoRemoteOutput
ToRemoteOutputInfoofferedHtlcOutputs
IEnumerable<OfferedHtlcOutputInfo>receivedHtlcOutputs
IEnumerable<ReceivedHtlcOutputInfo>
Properties
CommitmentNumber
Gets the commitment number for this transaction.
public CommitmentNumber CommitmentNumber { get; }
Property Value
Fee
Gets the total fee for this transaction.
public LightningMoney Fee { get; }
Property Value
FundingOutput
Gets the funding outpoint that this commitment transaction spends.
public FundingOutputInfo FundingOutput { get; }
Property Value
LocalAnchorOutput
Gets the local anchor output, if present.
public AnchorOutputInfo? LocalAnchorOutput { get; }
Property Value
OfferedHtlcOutputs
Gets the list of offered HTLC outputs.
public IReadOnlyList<OfferedHtlcOutputInfo> OfferedHtlcOutputs { get; }
Property Value
ReceivedHtlcOutputs
Gets the list of received HTLC outputs.
public IReadOnlyList<ReceivedHtlcOutputInfo> ReceivedHtlcOutputs { get; }
Property Value
RemoteAnchorOutput
Gets the remote anchor output, if present.
public AnchorOutputInfo? RemoteAnchorOutput { get; }
Property Value
ToLocalOutput
Gets the to_local output, if present.
public ToLocalOutputInfo? ToLocalOutput { get; }
Property Value
ToRemoteOutput
Gets the to_remote output, if present.
public ToRemoteOutputInfo? ToRemoteOutput { get; }
Property Value
TransactionId
Gets or sets the transaction ID after the transaction is constructed.
public TxId? TransactionId { get; set; }
Property Value
- TxId?
Methods
GetAllOutputs()
Gets all outputs of this commitment transaction.
public IEnumerable<IOutputInfo> GetAllOutputs()
Returns
GetLockTime()
Gets the Bitcoin locktime for this commitment transaction, derived from the commitment number.
public BitcoinLockTime GetLockTime()
Returns
GetSequence()
Gets the Bitcoin sequence for this commitment transaction, derived from the commitment number.
public BitcoinSequence GetSequence()