< Summary - Combined Code Coverage

Information
Class: NLightning.Application.Protocol.Factories.MessageFactory
Assembly: NLightning.Application
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Application/Protocol/Factories/MessageFactory.cs
Tag: 36_15743069263
Line coverage
0%
Covered lines: 0
Uncovered lines: 127
Coverable lines: 127
Total lines: 815
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 32
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Application/Protocol/Factories/MessageFactory.cs

#LineLine coverage
 1using Microsoft.Extensions.Options;
 2
 3namespace NLightning.Application.Protocol.Factories;
 4
 5using Domain.Bitcoin.ValueObjects;
 6using Domain.Channels.ValueObjects;
 7using Domain.Crypto.ValueObjects;
 8using Domain.Money;
 9using Domain.Node.Options;
 10using Domain.Protocol.Interfaces;
 11using Domain.Protocol.Messages;
 12using Domain.Protocol.Models;
 13using Domain.Protocol.Payloads;
 14using Domain.Protocol.Tlv;
 15using Domain.Protocol.ValueObjects;
 16
 17/// <summary>
 18/// Factory for creating messages.
 19/// </summary>
 20public class MessageFactory : IMessageFactory
 21{
 22    private readonly NodeOptions _nodeOptions;
 23    private readonly BitcoinNetwork _bitcoinNetwork;
 24
 025    public MessageFactory(IOptions<NodeOptions> nodeOptions)
 26    {
 027        _nodeOptions = nodeOptions.Value;
 028        _bitcoinNetwork = _nodeOptions.BitcoinNetwork;
 029    }
 30
 31    #region Init Message
 32
 33    /// <summary>
 34    /// Create an Init message.
 35    /// </summary>
 36    /// <returns>The Init message.</returns>
 37    /// <seealso cref="InitMessage"/>
 38    /// <seealso cref="InitPayload"/>
 39    public InitMessage CreateInitMessage()
 40    {
 41        // Get features from options
 042        var features = _nodeOptions.Features.GetNodeFeatures();
 043        var payload = new InitPayload(features);
 44
 045        return new InitMessage(payload, _nodeOptions.Features.GetInitTlvs());
 46    }
 47
 48    #endregion
 49
 50    #region Control Messages
 51
 52    /// <summary>
 53    /// Create a Warning message.
 54    /// </summary>
 55    /// <param name="message">The message to be sent.</param>
 56    /// <param name="channelId">The channel id, if any.</param>
 57    /// <returns>The Warning message.</returns>
 58    /// <seealso cref="WarningMessage"/>
 59    /// <seealso cref="ChannelId"/>
 60    /// <seealso cref="ErrorPayload"/>
 61    public WarningMessage CreateWarningMessage(string message, ChannelId? channelId)
 62    {
 063        var payload = channelId is null ? new ErrorPayload(message) : new ErrorPayload(channelId, message);
 064        return new WarningMessage(payload);
 65    }
 66
 67    /// <summary>
 68    /// Create a Warning message.
 69    /// </summary>
 70    /// <param name="data">The data to be sent.</param>
 71    /// <param name="channelId">The channel id, if any.</param>
 72    /// <returns>The Warning message.</returns>
 73    /// <seealso cref="WarningMessage"/>
 74    /// <seealso cref="ChannelId"/>
 75    /// <seealso cref="ErrorPayload"/>
 76    public WarningMessage CreateWarningMessage(byte[] data, ChannelId? channelId)
 77    {
 078        var payload = channelId is null ? new ErrorPayload(data) : new ErrorPayload(channelId.Value, data);
 079        return new WarningMessage(payload);
 80    }
 81
 82    /// <summary>
 83    /// Create a Stfu message.
 84    /// </summary>
 85    /// <param name="channelId">The channel id, if any.</param>
 86    /// <param name="initiator">If we are the sender of the message.</param>
 87    /// <returns>The Stfu message.</returns>
 88    /// <seealso cref="StfuMessage"/>
 89    /// <seealso cref="ChannelId"/>
 90    /// <seealso cref="StfuPayload"/>
 91    public StfuMessage CreateStfuMessage(ChannelId channelId, bool initiator)
 92    {
 093        var payload = new StfuPayload(channelId, initiator);
 094        return new StfuMessage(payload);
 95    }
 96
 97    /// <summary>
 98    /// Create an Error message.
 99    /// </summary>
 100    /// <param name="message">The message to be sent.</param>
 101    /// <param name="channelId">The channel id, if any.</param>
 102    /// <returns>The Error message.</returns>
 103    /// <seealso cref="ErrorMessage"/>
 104    /// <seealso cref="ChannelId"/>
 105    /// <seealso cref="ErrorPayload"/>
 106    public ErrorMessage CreateErrorMessage(string message, ChannelId? channelId)
 107    {
 0108        var payload = channelId is null ? new ErrorPayload(message) : new ErrorPayload(channelId.Value, message);
 0109        return new ErrorMessage(payload);
 110    }
 111
 112    /// <summary>
 113    /// Create an Error message.
 114    /// </summary>
 115    /// <param name="data">The data to be sent.</param>
 116    /// <param name="channelId">The channel id, if any.</param>
 117    /// <returns>The Error message.</returns>
 118    /// <seealso cref="ErrorMessage"/>
 119    /// <seealso cref="ChannelId"/>
 120    /// <seealso cref="ErrorPayload"/>
 121    public ErrorMessage CreateErrorMessage(byte[] data, ChannelId? channelId)
 122    {
 0123        var payload = channelId is null ? new ErrorPayload(data) : new ErrorPayload(channelId.Value, data);
 0124        return new ErrorMessage(payload);
 125    }
 126
 127    /// <summary>
 128    /// Create a Ping message.
 129    /// </summary>
 130    /// <returns>The Ping message.</returns>
 131    /// <seealso cref="PingMessage"/>
 132    /// <seealso cref="PingPayload"/>
 133    public PingMessage CreatePingMessage()
 134    {
 0135        return new PingMessage();
 136    }
 137
 138    /// <summary>
 139    /// Create a Pong message.
 140    /// </summary>
 141    /// <param name="pingMessage">The ping message we're responding to</param>
 142    /// <returns>The Pong message.</returns>
 143    /// <seealso cref="PongMessage"/>
 144    /// <seealso cref="PongPayload"/>
 145    public PongMessage CreatePongMessage(IMessage pingMessage)
 146    {
 0147        if (pingMessage is not PingMessage ping)
 148        {
 0149            throw new ArgumentException("Ping message is required", nameof(pingMessage));
 150        }
 151
 0152        return new PongMessage(ping.Payload.NumPongBytes);
 153    }
 154
 155    #endregion
 156
 157    #region Interactive Transaction Construction
 158
 159    /// <summary>
 160    /// Create a TxAddInput message.
 161    /// </summary>
 162    /// <param name="channelId">The channel id.</param>
 163    /// <param name="serialId">The serial id.</param>
 164    /// <param name="prevTx">The previous transaction.</param>
 165    /// <param name="prevTxVout">The previous transaction vout.</param>
 166    /// <param name="sequence">The sequence number.</param>
 167    /// <returns>The TxAddInput message.</returns>
 168    /// <seealso cref="TxAddInputMessage"/>
 169    /// <seealso cref="ChannelId"/>
 170    /// <seealso cref="TxAddInputPayload"/>
 171    public TxAddInputMessage CreateTxAddInputMessage(ChannelId channelId, ulong serialId, byte[] prevTx,
 172                                                     uint prevTxVout,
 173                                                     uint sequence)
 174    {
 0175        var payload = new TxAddInputPayload(channelId, serialId, prevTx, prevTxVout, sequence);
 176
 0177        return new TxAddInputMessage(payload);
 178    }
 179
 180    /// <summary>
 181    /// Create a TxAddOutput message.
 182    /// </summary>
 183    /// <param name="channelId">The channel id.</param>
 184    /// <param name="serialId">The serial id.</param>
 185    /// <param name="amount">The number of satoshis.</param>
 186    /// <param name="script">The script.</param>
 187    /// <returns>The TxAddOutput message.</returns>
 188    /// <seealso cref="TxAddOutputMessage"/>
 189    /// <seealso cref="ChannelId"/>
 190    /// <seealso cref="TxAddOutputPayload"/>
 191    public TxAddOutputMessage CreateTxAddOutputMessage(ChannelId channelId, ulong serialId, LightningMoney amount,
 192                                                       BitcoinScript script)
 193    {
 0194        var payload = new TxAddOutputPayload(amount, channelId, script, serialId);
 195
 0196        return new TxAddOutputMessage(payload);
 197    }
 198
 199    /// <summary>
 200    /// Create a TxRemoveInput message.
 201    /// </summary>
 202    /// <param name="channelId">The channel id.</param>
 203    /// <param name="serialId">The serial id.</param>
 204    /// <returns>The TxRemoveInput message.</returns>
 205    /// <seealso cref="TxRemoveInputMessage"/>
 206    /// <seealso cref="ChannelId"/>
 207    /// <seealso cref="TxRemoveInputPayload"/>
 208    public TxRemoveInputMessage CreateTxRemoveInputMessage(ChannelId channelId, ulong serialId)
 209    {
 0210        var payload = new TxRemoveInputPayload(channelId, serialId);
 211
 0212        return new TxRemoveInputMessage(payload);
 213    }
 214
 215    /// <summary>
 216    /// Create a TxRemoveOutput message.
 217    /// </summary>
 218    /// <param name="channelId">The channel id.</param>
 219    /// <param name="serialId">The serial id.</param>
 220    /// <returns>The TxRemoveOutput message.</returns>
 221    /// <seealso cref="TxRemoveOutputMessage"/>
 222    /// <seealso cref="ChannelId"/>
 223    /// <seealso cref="TxRemoveOutputPayload"/>
 224    public TxRemoveOutputMessage CreateTxRemoveOutputMessage(ChannelId channelId, ulong serialId)
 225    {
 0226        var payload = new TxRemoveOutputPayload(channelId, serialId);
 227
 0228        return new TxRemoveOutputMessage(payload);
 229    }
 230
 231    /// <summary>
 232    /// Create a TxComplete message.
 233    /// </summary>
 234    /// <param name="channelId">The channel id.</param>
 235    /// <returns>The TxComplete message.</returns>
 236    /// <seealso cref="TxCompleteMessage"/>
 237    /// <seealso cref="ChannelId"/>
 238    /// <seealso cref="TxCompletePayload"/>
 239    public TxCompleteMessage CreateTxCompleteMessage(ChannelId channelId)
 240    {
 0241        var payload = new TxCompletePayload(channelId);
 242
 0243        return new TxCompleteMessage(payload);
 244    }
 245
 246    /// <summary>
 247    /// Create a TxSignatures message.
 248    /// </summary>
 249    /// <param name="channelId">The channel id.</param>
 250    /// <param name="txId">The transaction id.</param>
 251    /// <param name="witnesses">The witnesses.</param>
 252    /// <returns>The TxSignatures message.</returns>
 253    /// <seealso cref="TxSignaturesMessage"/>
 254    /// <seealso cref="ChannelId"/>
 255    /// <seealso cref="TxSignaturesPayload"/>
 256    public TxSignaturesMessage CreateTxSignaturesMessage(ChannelId channelId, byte[] txId, List<Witness> witnesses)
 257    {
 0258        var payload = new TxSignaturesPayload(channelId, txId, witnesses);
 259
 0260        return new TxSignaturesMessage(payload);
 261    }
 262
 263    /// <summary>
 264    /// Create a TxInitRbf message.
 265    /// </summary>
 266    /// <param name="channelId">The channel id.</param>
 267    /// <param name="locktime">The locktime.</param>
 268    /// <param name="feerate">The feerate</param>
 269    /// <param name="fundingOutputContrubution">The output contribution.</param>
 270    /// <param name="requireConfirmedInputs">How many confirmed inputs we need.</param>
 271    /// <returns>The TxInitRbf message.</returns>
 272    /// <seealso cref="TxInitRbfMessage"/>
 273    /// <seealso cref="ChannelId"/>
 274    /// <seealso cref="TxInitRbfPayload"/>
 275    public TxInitRbfMessage CreateTxInitRbfMessage(ChannelId channelId, uint locktime, uint feerate,
 276                                                   long fundingOutputContrubution, bool requireConfirmedInputs)
 277    {
 0278        FundingOutputContributionTlv? fundingOutputContributionTlv = null;
 0279        RequireConfirmedInputsTlv? requireConfirmedInputsTlv = null;
 280
 0281        if (fundingOutputContrubution > 0)
 282        {
 0283            fundingOutputContributionTlv = new FundingOutputContributionTlv(fundingOutputContrubution);
 284        }
 285
 0286        if (requireConfirmedInputs)
 287        {
 0288            requireConfirmedInputsTlv = new RequireConfirmedInputsTlv();
 289        }
 290
 0291        var payload = new TxInitRbfPayload(channelId, locktime, feerate);
 292
 0293        return new TxInitRbfMessage(payload, fundingOutputContributionTlv, requireConfirmedInputsTlv);
 294    }
 295
 296    /// <summary>
 297    /// Create a TxAckRbf message.
 298    /// </summary>
 299    /// <param name="channelId">The channel id.</param>
 300    /// <param name="fundingOutputContrubution">The output contribution.</param>
 301    /// <param name="requireConfirmedInputs">How many confirmed inputs we need.</param>
 302    /// <returns>The TxAckRbf message.</returns>
 303    /// <seealso cref="TxAckRbfMessage"/>
 304    /// <seealso cref="ChannelId"/>
 305    /// <seealso cref="TxAckRbfPayload"/>
 306    /// <seealso cref="TlvStream"/>
 307    /// <seealso cref="FundingOutputContributionTlv"/>
 308    /// <seealso cref="RequireConfirmedInputsTlv"/>
 309    public TxAckRbfMessage CreateTxAckRbfMessage(ChannelId channelId, long fundingOutputContrubution,
 310                                                 bool requireConfirmedInputs)
 311    {
 0312        FundingOutputContributionTlv? fundingOutputContributionTlv = null;
 0313        RequireConfirmedInputsTlv? requireConfirmedInputsTlv = null;
 314
 0315        if (fundingOutputContrubution > 0)
 316        {
 0317            fundingOutputContributionTlv = new FundingOutputContributionTlv(fundingOutputContrubution);
 318        }
 319
 0320        if (requireConfirmedInputs)
 321        {
 0322            requireConfirmedInputsTlv = new RequireConfirmedInputsTlv();
 323        }
 324
 0325        var payload = new TxAckRbfPayload(channelId);
 326
 0327        return new TxAckRbfMessage(payload, fundingOutputContributionTlv, requireConfirmedInputsTlv);
 328    }
 329
 330    /// <summary>
 331    /// Create a TxAbort message.
 332    /// </summary>
 333    /// <param name="channelId">The channel id.</param>
 334    /// <param name="data">The data.</param>
 335    /// <returns>The TxAbort message.</returns>
 336    /// <seealso cref="TxAbortMessage"/>
 337    /// <seealso cref="ChannelId"/>
 338    /// <seealso cref="TxAbortPayload"/>
 339    public TxAbortMessage CreateTxAbortMessage(ChannelId channelId, byte[] data)
 340    {
 0341        var payload = new TxAbortPayload(channelId, data);
 342
 0343        return new TxAbortMessage(payload);
 344    }
 345
 346    #endregion
 347
 348    #region Channel Messages
 349
 350    /// <summary>
 351    /// Create a ChannelReady message.
 352    /// </summary>
 353    /// <param name="channelId">The channel id.</param>
 354    /// <param name="secondPerCommitmentPoint">The second per commitment point.</param>
 355    /// <param name="shortChannelId">The channel's shortChannelId.</param>
 356    /// <returns>The ChannelReady message.</returns>
 357    /// <seealso cref="ChannelReadyMessage"/>
 358    /// <seealso cref="ChannelId"/>
 359    /// <seealso cref="CompactPubKey"/>
 360    /// <seealso cref="ShortChannelId"/>
 361    /// <seealso cref="ChannelReadyPayload"/>
 362    public ChannelReadyMessage CreateChannelReadyMessage(ChannelId channelId, CompactPubKey secondPerCommitmentPoint,
 363                                                         ShortChannelId? shortChannelId = null)
 364    {
 0365        var payload = new ChannelReadyPayload(channelId, secondPerCommitmentPoint);
 366
 0367        return new ChannelReadyMessage(payload,
 0368                                       shortChannelId is null ? null : new ShortChannelIdTlv(shortChannelId.Value));
 369    }
 370
 371    /// <summary>
 372    /// Create a Shutdown message.
 373    /// </summary>
 374    /// <param name="channelId">The channel id.</param>
 375    /// <param name="scriptPubkey">The ScriptPubKey to send closing funds to.</param>
 376    /// <returns>The Shutdown message.</returns>
 377    /// <seealso cref="ShutdownMessage"/>
 378    /// <seealso cref="ChannelId"/>
 379    /// <seealso cref="BitcoinScript"/>
 380    /// <seealso cref="ShutdownPayload"/>
 381    public ShutdownMessage CreateShutdownMessage(ChannelId channelId, BitcoinScript scriptPubkey)
 382    {
 0383        var payload = new ShutdownPayload(channelId, scriptPubkey);
 384
 0385        return new ShutdownMessage(payload);
 386    }
 387
 388    /// <summary>
 389    /// Create a ClosingSigned message.
 390    /// </summary>
 391    /// <param name="channelId">The channel id.</param>
 392    /// <param name="feeSatoshis">The fee we want them to pay for closing the channel.</param>
 393    /// <param name="signature">The signature for closing the channel.</param>
 394    /// <param name="minFeeSatoshis">The min fee we will accept them to pay to close the channel.</param>
 395    /// <param name="maxFeeSatoshis">The max fee we will accept them to pay to close the channel.</param>
 396    /// <returns>The ClosingSigned message.</returns>
 397    /// <seealso cref="ClosingSignedMessage"/>
 398    /// <seealso cref="ChannelId"/>
 399    /// <seealso cref="CompactSignature"/>
 400    /// <seealso cref="ClosingSignedPayload"/>
 401    public ClosingSignedMessage CreateClosingSignedMessage(ChannelId channelId, ulong feeSatoshis,
 402                                                           CompactSignature signature,
 403                                                           ulong minFeeSatoshis, ulong maxFeeSatoshis)
 404    {
 0405        var payload = new ClosingSignedPayload(channelId, feeSatoshis, signature);
 406
 0407        return new ClosingSignedMessage(payload, new FeeRangeTlv(minFeeSatoshis, maxFeeSatoshis));
 408    }
 409
 410    /// <summary>
 411    /// Create an OpenChannel1 message.
 412    /// </summary>
 413    /// <param name="temporaryChannelId">The temporary channel id.</param>
 414    /// <param name="fundingAmount">The amount of satoshis we're adding to the channel.</param>
 415    /// <param name="fundingPubKey">The funding pubkey of the channel.</param>
 416    /// <param name="pushAmount">The amount of satoshis we're pushing to the other side.</param>
 417    /// <param name="channelReserveAmount">The channel reserve amount.</param>
 418    /// <param name="feeRatePerKw">The fee rate per kw.</param>
 419    /// <param name="maxAcceptedHtlcs">The max accepted htlcs.</param>
 420    /// <param name="revocationBasepoint">The revocation pubkey.</param>
 421    /// <param name="paymentBasepoint">The payment pubkey.</param>
 422    /// <param name="delayedPaymentBasepoint">The delayed payment pubkey.</param>
 423    /// <param name="htlcBasepoint">The htlc pubkey.</param>
 424    /// <param name="firstPerCommitmentPoint">The first per-commitment pubkey.</param>
 425    /// <param name="channelFlags">The flags for the channel.</param>
 426    /// <param name="upfrontShutdownScriptTlv">The upfront shutdown script tlv.</param>
 427    /// <param name="channelTypeTlv">The channel type tlv.</param>
 428    /// <returns>The OpenChannel1 message.</returns>
 429    /// <seealso cref="OpenChannel1Message"/>
 430    /// <seealso cref="ChannelId"/>
 431    /// <seealso cref="LightningMoney"/>
 432    /// <seealso cref="CompactPubKey"/>
 433    /// <seealso cref="UpfrontShutdownScriptTlv"/>
 434    /// <seealso cref="ChannelTypeTlv"/>
 435    public OpenChannel1Message CreateOpenChannel1Message(ChannelId temporaryChannelId, LightningMoney fundingAmount,
 436                                                         CompactPubKey fundingPubKey, LightningMoney pushAmount,
 437                                                         LightningMoney channelReserveAmount,
 438                                                         LightningMoney feeRatePerKw, ushort maxAcceptedHtlcs,
 439                                                         CompactPubKey revocationBasepoint,
 440                                                         CompactPubKey paymentBasepoint,
 441                                                         CompactPubKey delayedPaymentBasepoint,
 442                                                         CompactPubKey htlcBasepoint,
 443                                                         CompactPubKey firstPerCommitmentPoint,
 444                                                         ChannelFlags channelFlags,
 445                                                         UpfrontShutdownScriptTlv? upfrontShutdownScriptTlv,
 446                                                         ChannelTypeTlv? channelTypeTlv)
 447    {
 0448        var maxHtlcValueInFlight =
 0449            LightningMoney.Satoshis(_nodeOptions.AllowUpToPercentageOfChannelFundsInFlight * fundingAmount.Satoshi /
 0450                                    100M);
 0451        var payload = new OpenChannel1Payload(_nodeOptions.BitcoinNetwork.ChainHash, channelFlags, temporaryChannelId,
 0452                                              channelReserveAmount, delayedPaymentBasepoint,
 0453                                              _nodeOptions.DustLimitAmount, feeRatePerKw, firstPerCommitmentPoint,
 0454                                              fundingAmount, fundingPubKey, htlcBasepoint,
 0455                                              _nodeOptions.HtlcMinimumAmount, maxAcceptedHtlcs, maxHtlcValueInFlight,
 0456                                              paymentBasepoint, pushAmount, revocationBasepoint,
 0457                                              _nodeOptions.ToSelfDelay);
 458
 0459        return new OpenChannel1Message(payload, upfrontShutdownScriptTlv, channelTypeTlv);
 460    }
 461
 462    /// <summary>
 463    /// Create an OpenChannel2 message.
 464    /// </summary>
 465    /// <param name="temporaryChannelId">The temporary channel id.</param>
 466    /// <param name="fundingFeeRatePerKw">The funding fee rate to open the channel.</param>
 467    /// <param name="commitmentFeeRatePerKw">The commitment fee rate.</param>
 468    /// <param name="fundingSatoshis">The amount of satoshis we're adding to the channel.</param>
 469    /// <param name="fundingPubKey">The funding pubkey of the channel.</param>
 470    /// <param name="revocationBasepoint">The revocation pubkey.</param>
 471    /// <param name="paymentBasepoint">The payment pubkey.</param>
 472    /// <param name="delayedPaymentBasepoint">The delayed payment pubkey.</param>
 473    /// <param name="htlcBasepoint">The htlc pubkey.</param>
 474    /// <param name="firstPerCommitmentPoint">The first per-commitment pubkey.</param>
 475    /// <param name="secondPerCommitmentPoint">The second per-commitment pubkey.</param>
 476    /// <param name="channelFlags">The flags for the channel.</param>
 477    /// <param name="shutdownScriptPubkey">The shutdown script to be used when closing the channel.</param>
 478    /// <param name="channelType">The type of the channel.</param>
 479    /// <param name="requireConfirmedInputs">If we want confirmed inputs to open the channel.</param>
 480    /// <returns>The OpenChannel2 message.</returns>
 481    /// <seealso cref="OpenChannel2Message"/>
 482    /// <seealso cref="ChannelId"/>
 483    /// <seealso cref="CompactPubKey"/>
 484    /// <seealso cref="ChannelFlags"/>
 485    /// <seealso cref="BitcoinScript"/>
 486    /// <seealso cref="OpenChannel2Payload"/>
 487    public OpenChannel2Message CreateOpenChannel2Message(ChannelId temporaryChannelId, uint fundingFeeRatePerKw,
 488                                                         uint commitmentFeeRatePerKw, ulong fundingSatoshis,
 489                                                         CompactPubKey fundingPubKey,
 490                                                         CompactPubKey revocationBasepoint,
 491                                                         CompactPubKey paymentBasepoint,
 492                                                         CompactPubKey delayedPaymentBasepoint,
 493                                                         CompactPubKey htlcBasepoint,
 494                                                         CompactPubKey firstPerCommitmentPoint,
 495                                                         CompactPubKey secondPerCommitmentPoint,
 496                                                         ChannelFlags channelFlags,
 497                                                         BitcoinScript? shutdownScriptPubkey = null,
 498                                                         byte[]? channelType = null,
 499                                                         bool requireConfirmedInputs = false)
 500    {
 0501        var maxHtlcValueInFlight =
 0502            LightningMoney.Satoshis(_nodeOptions.AllowUpToPercentageOfChannelFundsInFlight * fundingSatoshis / 100M);
 503
 0504        var payload = new OpenChannel2Payload(_bitcoinNetwork.ChainHash, channelFlags, commitmentFeeRatePerKw,
 0505                                              delayedPaymentBasepoint, _nodeOptions.DustLimitAmount,
 0506                                              firstPerCommitmentPoint, fundingSatoshis, fundingFeeRatePerKw,
 0507                                              fundingPubKey, htlcBasepoint, _nodeOptions.HtlcMinimumAmount,
 0508                                              _nodeOptions.Locktime, _nodeOptions.MaxAcceptedHtlcs,
 0509                                              maxHtlcValueInFlight, paymentBasepoint, revocationBasepoint,
 0510                                              secondPerCommitmentPoint, _nodeOptions.ToSelfDelay, temporaryChannelId);
 511
 0512        return new OpenChannel2Message(payload,
 0513                                       shutdownScriptPubkey is null
 0514                                           ? null
 0515                                           : new UpfrontShutdownScriptTlv(shutdownScriptPubkey.Value),
 0516                                       channelType is null
 0517                                           ? null
 0518                                           : new ChannelTypeTlv(channelType),
 0519                                       requireConfirmedInputs ? new RequireConfirmedInputsTlv() : null);
 520    }
 521
 522    /// <summary>
 523    /// Creates an AcceptChannel1 message.
 524    /// </summary>
 525    /// <param name="channelReserveAmount">The reserve amount for the channel.</param>
 526    /// <param name="channelTypeTlv">Optional parameter specifying the channel type.</param>
 527    /// <param name="delayedPaymentBasepoint">The basepoint for the delayed payment key.</param>
 528    /// <param name="firstPerCommitmentPoint">The first per-commitment point for the channel.</param>
 529    /// <param name="fundingPubKey">Public key associated with the channel funding.</param>
 530    /// <param name="htlcBasepoint">The basepoint for the HTLC key.</param>
 531    /// <param name="maxAcceptedHtlcs">The maximum number of HTLCs to be accepted for this channel.</param>
 532    /// <param name="maxHtlcValueInFlight">The maximum HTLC value that can be in flight.</param>
 533    /// <param name="minimumDepth">The minimum confirmation depth required for the channel opening transaction.</param>
 534    /// <param name="paymentBasepoint">The basepoint for the payment key.</param>
 535    /// <param name="revocationBasepoint">The basepoint for the revocation key.</param>
 536    /// <param name="temporaryChannelId">The temporary identifier for the channel negotiation.</param>
 537    /// <param name="toSelfDelay">The delay in blocks before self outputs can be claimed.</param>
 538    /// <param name="upfrontShutdownScriptTlv">Optional parameter specifying the upfront shutdown script TLV.</param>
 539    /// <returns>The created AcceptChannel1 message.</returns>
 540    /// <seealso cref="AcceptChannel1Message"/>
 541    /// <seealso cref="AcceptChannel1Payload"/>
 542    /// <seealso cref="ChannelId"/>
 543    /// <seealso cref="LightningMoney"/>
 544    /// <seealso cref="CompactPubKey"/>
 545    /// <seealso cref="UpfrontShutdownScriptTlv"/>
 546    /// <seealso cref="ChannelTypeTlv"/>
 547    public AcceptChannel1Message CreateAcceptChannel1Message(LightningMoney channelReserveAmount,
 548                                                             ChannelTypeTlv? channelTypeTlv,
 549                                                             CompactPubKey delayedPaymentBasepoint,
 550                                                             CompactPubKey firstPerCommitmentPoint,
 551                                                             CompactPubKey fundingPubKey, CompactPubKey htlcBasepoint,
 552                                                             ushort maxAcceptedHtlcs,
 553                                                             LightningMoney maxHtlcValueInFlight, uint minimumDepth,
 554                                                             CompactPubKey paymentBasepoint,
 555                                                             CompactPubKey revocationBasepoint,
 556                                                             ChannelId temporaryChannelId, ushort toSelfDelay,
 557                                                             UpfrontShutdownScriptTlv? upfrontShutdownScriptTlv)
 558    {
 0559        var payload = new AcceptChannel1Payload(temporaryChannelId, channelReserveAmount, delayedPaymentBasepoint,
 0560                                                _nodeOptions.DustLimitAmount, firstPerCommitmentPoint, fundingPubKey,
 0561                                                htlcBasepoint, _nodeOptions.HtlcMinimumAmount, maxAcceptedHtlcs,
 0562                                                maxHtlcValueInFlight, minimumDepth, paymentBasepoint,
 0563                                                revocationBasepoint, toSelfDelay);
 564
 0565        return new AcceptChannel1Message(payload, upfrontShutdownScriptTlv, channelTypeTlv);
 566    }
 567
 568    /// <summary>
 569    /// Create an AcceptChannel2 message.
 570    /// </summary>
 571    /// <param name="temporaryChannelId">The temporary channel id.</param>
 572    /// <param name="fundingSatoshis">The amount of satoshis we're adding to the channel.</param>
 573    /// <param name="fundingPubKey">The funding pubkey of the channel.</param>
 574    /// <param name="revocationBasepoint">The revocation pubkey.</param>
 575    /// <param name="paymentBasepoint">The payment pubkey.</param>
 576    /// <param name="delayedPaymentBasepoint">The delayed payment pubkey.</param>
 577    /// <param name="htlcBasepoint">The htlc pubkey.</param>
 578    /// <param name="firstPerCommitmentPoint">The first per-commitment pubkey.</param>
 579    /// <param name="maxHtlcValueInFlight">Maximum HTLC value that can be in flight.</param>
 580    /// <param name="shutdownScriptPubkey">The shutdown script to be used when closing the channel.</param>
 581    /// <param name="channelType">The type of the channel.</param>
 582    /// <param name="requireConfirmedInputs">If we want confirmed inputs to open the channel.</param>
 583    /// <returns>The AcceptChannel2 message.</returns>
 584    /// <seealso cref="AcceptChannel2Message"/>
 585    /// <seealso cref="ChannelId"/>
 586    /// <seealso cref="CompactPubKey"/>
 587    /// <seealso cref="BitcoinScript"/>
 588    /// <seealso cref="AcceptChannel2Payload"/>
 589    public AcceptChannel2Message CreateAcceptChannel2Message(ChannelId temporaryChannelId,
 590                                                             LightningMoney fundingSatoshis,
 591                                                             CompactPubKey fundingPubKey,
 592                                                             CompactPubKey revocationBasepoint,
 593                                                             CompactPubKey paymentBasepoint,
 594                                                             CompactPubKey delayedPaymentBasepoint,
 595                                                             CompactPubKey htlcBasepoint,
 596                                                             CompactPubKey firstPerCommitmentPoint,
 597                                                             LightningMoney maxHtlcValueInFlight,
 598                                                             BitcoinScript? shutdownScriptPubkey = null,
 599                                                             byte[]? channelType = null,
 600                                                             bool requireConfirmedInputs = false)
 601    {
 0602        var payload = new AcceptChannel2Payload(delayedPaymentBasepoint, _nodeOptions.DustLimitAmount,
 0603                                                firstPerCommitmentPoint, fundingSatoshis, fundingPubKey,
 0604                                                htlcBasepoint, _nodeOptions.HtlcMinimumAmount,
 0605                                                _nodeOptions.MaxAcceptedHtlcs, maxHtlcValueInFlight,
 0606                                                _nodeOptions.MinimumDepth, paymentBasepoint, revocationBasepoint,
 0607                                                temporaryChannelId, _nodeOptions.ToSelfDelay);
 608
 0609        return new AcceptChannel2Message(payload,
 0610                                         shutdownScriptPubkey is null
 0611                                             ? null
 0612                                             : new UpfrontShutdownScriptTlv(shutdownScriptPubkey.Value),
 0613                                         channelType is null
 0614                                             ? null
 0615                                             : new ChannelTypeTlv(channelType),
 0616                                         requireConfirmedInputs ? new RequireConfirmedInputsTlv() : null);
 617    }
 618
 619    /// <summary>
 620    /// Create a FundingCreated message.
 621    /// </summary>
 622    /// <param name="temporaryChannelId">The temporary channel id.</param>
 623    /// <param name="fundingTxId">The funding transaction id.</param>
 624    /// <param name="fundingOutputIndex">The funding output index.</param>
 625    /// <param name="signature">The signature for the funding transaction.</param>
 626    /// <returns>The FundingCreated message.</returns>
 627    /// <seealso cref="FundingCreatedMessage"/>
 628    /// <seealso cref="ChannelId"/>
 629    /// <seealso cref="CompactSignature"/>
 630    /// <seealso cref="FundingCreatedPayload"/>
 631    public FundingCreatedMessage CreatedFundingCreatedMessage(ChannelId temporaryChannelId, TxId fundingTxId,
 632                                                              ushort fundingOutputIndex, CompactSignature signature)
 633    {
 0634        var payload = new FundingCreatedPayload(temporaryChannelId, fundingTxId, fundingOutputIndex, signature);
 635
 0636        return new FundingCreatedMessage(payload);
 637    }
 638
 639    /// <summary>
 640    /// Create a FundingSigned message.
 641    /// </summary>
 642    /// <param name="channelId">The channel id.</param>
 643    /// <param name="signature"></param>
 644    /// <returns>The FundingSigned message.</returns>
 645    /// <seealso cref="FundingCreatedMessage"/>
 646    /// <seealso cref="ChannelId"/>
 647    /// <seealso cref="CompactSignature"/>
 648    /// <seealso cref="FundingCreatedPayload"/>
 649    public FundingSignedMessage CreatedFundingSignedMessage(ChannelId channelId, CompactSignature signature)
 650    {
 0651        var payload = new FundingSignedPayload(channelId, signature);
 652
 0653        return new FundingSignedMessage(payload);
 654    }
 655
 656    #endregion
 657
 658    #region Commitment
 659
 660    /// <summary>
 661    /// Create an UpdateAddHtlc message.
 662    /// </summary>
 663    /// <param name="channelId">The channel id.</param>
 664    /// <param name="id">The htlc id.</param>
 665    /// <param name="amountMsat">The amount for this htlc.</param>
 666    /// <param name="paymentHash">The htlc payment hash.</param>
 667    /// <param name="cltvExpiry">The cltv expiry.</param>
 668    /// <param name="onionRoutingPacket">The onion routing packet.</param>
 669    /// <returns>The UpdateAddHtlc message.</returns>
 670    /// <seealso cref="UpdateAddHtlcMessage"/>
 671    /// <seealso cref="ChannelId"/>
 672    /// <seealso cref="UpdateAddHtlcPayload"/>
 673    public UpdateAddHtlcMessage CreateUpdateAddHtlcMessage(ChannelId channelId, ulong id, ulong amountMsat,
 674                                                           ReadOnlyMemory<byte> paymentHash, uint cltvExpiry,
 675                                                           ReadOnlyMemory<byte>? onionRoutingPacket = null)
 676    {
 0677        var payload = new UpdateAddHtlcPayload(amountMsat, channelId, cltvExpiry, id, paymentHash, onionRoutingPacket);
 678
 0679        return new UpdateAddHtlcMessage(payload);
 680    }
 681
 682    /// <summary>
 683    /// Create an UpdateFulfillHtlc message.
 684    /// </summary>
 685    /// <param name="channelId">The channel id.</param>
 686    /// <param name="id">The htlc id.</param>
 687    /// <param name="preimage">The preimage for this htlc.</param>
 688    /// <returns>The UpdateFulfillHtlc message.</returns>
 689    /// <seealso cref="UpdateFulfillHtlcMessage"/>
 690    /// <seealso cref="ChannelId"/>
 691    /// <seealso cref="UpdateFulfillHtlcPayload"/>
 692    public UpdateFulfillHtlcMessage CreateUpdateFulfillHtlcMessage(ChannelId channelId, ulong id,
 693                                                                   ReadOnlyMemory<byte> preimage)
 694    {
 0695        var payload = new UpdateFulfillHtlcPayload(channelId, id, preimage);
 696
 0697        return new UpdateFulfillHtlcMessage(payload);
 698    }
 699
 700    /// <summary>
 701    /// Create an UpdateFailHtlc message.
 702    /// </summary>
 703    /// <param name="channelId">The channel id.</param>
 704    /// <param name="id">The htlc id.</param>
 705    /// <param name="reason">The reason for failure.</param>
 706    /// <returns>The UpdateFailHtlc message.</returns>
 707    /// <seealso cref="UpdateFailHtlcMessage"/>
 708    /// <seealso cref="ChannelId"/>
 709    /// <seealso cref="UpdateFailHtlcPayload"/>
 710    public UpdateFailHtlcMessage CreateUpdateFailHtlcMessage(ChannelId channelId, ulong id, ReadOnlyMemory<byte> reason)
 711    {
 0712        var payload = new UpdateFailHtlcPayload(channelId, id, reason);
 713
 0714        return new UpdateFailHtlcMessage(payload);
 715    }
 716
 717    /// <summary>
 718    /// Create a CommitmentSigned message.
 719    /// </summary>
 720    /// <param name="channelId">The channel id.</param>
 721    /// <param name="signature">The signature for the commitment transaction.</param>
 722    /// <param name="htlcSignatures">The signatures for each open htlc.</param>
 723    /// <returns>The CommitmentSigned message.</returns>
 724    /// <seealso cref="CommitmentSignedMessage"/>
 725    /// <seealso cref="ChannelId"/>
 726    /// <seealso cref="CompactSignature"/>
 727    /// <seealso cref="CommitmentSignedPayload"/>
 728    public CommitmentSignedMessage CreateCommitmentSignedMessage(ChannelId channelId, CompactSignature signature,
 729                                                                 IEnumerable<CompactSignature> htlcSignatures)
 730    {
 0731        var payload = new CommitmentSignedPayload(channelId, htlcSignatures, signature);
 732
 0733        return new CommitmentSignedMessage(payload);
 734    }
 735
 736    /// <summary>
 737    /// Create a RevokeAndAck message.
 738    /// </summary>
 739    /// <param name="channelId">The channel id.</param>
 740    /// <param name="perCommitmentSecret">The secret for the commitment transaction.</param>
 741    /// <param name="nextPerCommitmentPoint">The next per commitment point.</param>
 742    /// <returns>The RevokeAndAck message.</returns>
 743    /// <seealso cref="RevokeAndAckMessage"/>
 744    /// <seealso cref="ChannelId"/>
 745    /// <seealso cref="CompactSignature"/>
 746    /// <seealso cref="RevokeAndAckPayload"/>
 747    public RevokeAndAckMessage CreateRevokeAndAckMessage(ChannelId channelId, ReadOnlyMemory<byte> perCommitmentSecret,
 748                                                         CompactPubKey nextPerCommitmentPoint)
 749    {
 0750        var payload = new RevokeAndAckPayload(channelId, nextPerCommitmentPoint, perCommitmentSecret);
 751
 0752        return new RevokeAndAckMessage(payload);
 753    }
 754
 755    /// <summary>
 756    /// Create a UpdateFee message.
 757    /// </summary>
 758    /// <param name="channelId">The channel id.</param>
 759    /// <param name="feeratePerKw">The fee rate for the commitment transaction.</param>
 760    /// <returns>The UpdateFee message.</returns>
 761    /// <seealso cref="UpdateFeeMessage"/>
 762    /// <seealso cref="ChannelId"/>
 763    /// <seealso cref="UpdateFeePayload"/>
 764    public UpdateFeeMessage CreateUpdateFeeMessage(ChannelId channelId, uint feeratePerKw)
 765    {
 0766        var payload = new UpdateFeePayload(channelId, feeratePerKw);
 767
 0768        return new UpdateFeeMessage(payload);
 769    }
 770
 771    /// <summary>
 772    /// Create an UpdateFailMalformedHtlc message.
 773    /// </summary>
 774    /// <param name="channelId">The channel id.</param>
 775    /// <param name="id">The htlc id.</param>
 776    /// <param name="sha256OfOnion">The sha256OfOnion for this htlc.</param>
 777    /// <param name="failureCode">The failureCode.</param>
 778    /// <returns>The UpdateFailMalformedHtlc message.</returns>
 779    /// <seealso cref="UpdateFailMalformedHtlcMessage"/>
 780    /// <seealso cref="ChannelId"/>
 781    /// <seealso cref="UpdateFailMalformedHtlcPayload"/>
 782    public UpdateFailMalformedHtlcMessage CreateUpdateFailMalformedHtlcMessage(ChannelId channelId, ulong id,
 783                                                                               ReadOnlyMemory<byte> sha256OfOnion,
 784                                                                               ushort failureCode)
 785    {
 0786        var payload = new UpdateFailMalformedHtlcPayload(channelId, failureCode, id, sha256OfOnion);
 787
 0788        return new UpdateFailMalformedHtlcMessage(payload);
 789    }
 790
 791    /// <summary>
 792    /// Create a ChannelReestablish message.
 793    /// </summary>
 794    /// <param name="channelId">The channel id.</param>
 795    /// <param name="nextCommitmentNumber">The next commitment number.</param>
 796    /// <param name="nextRevocationNumber">The next revocation number.</param>
 797    /// <param name="yourLastPerCommitmentSecret">The peer's last per-commitment secret.</param>
 798    /// <param name="myCurrentPerCommitmentPoint">Our current per commitment point.</param>
 799    /// <returns>The ChannelReestablish message.</returns>
 800    /// <seealso cref="ChannelReestablishMessage"/>
 801    /// <seealso cref="ChannelId"/>
 802    /// <seealso cref="ChannelReestablishPayload"/>
 803    public ChannelReestablishMessage CreateChannelReestablishMessage(ChannelId channelId, ulong nextCommitmentNumber,
 804                                                                     ulong nextRevocationNumber,
 805                                                                     ReadOnlyMemory<byte> yourLastPerCommitmentSecret,
 806                                                                     CompactPubKey myCurrentPerCommitmentPoint)
 807    {
 0808        var payload = new ChannelReestablishPayload(channelId, myCurrentPerCommitmentPoint, nextCommitmentNumber,
 0809                                                    nextRevocationNumber, yourLastPerCommitmentSecret);
 810
 0811        return new ChannelReestablishMessage(payload);
 812    }
 813
 814    #endregion
 815}

Methods/Properties

.ctor(Microsoft.Extensions.Options.IOptions`1<NLightning.Domain.Node.Options.NodeOptions>)
CreateInitMessage()
CreateWarningMessage(System.String,System.Nullable`1<NLightning.Domain.Channels.ValueObjects.ChannelId>)
CreateWarningMessage(System.Byte[],System.Nullable`1<NLightning.Domain.Channels.ValueObjects.ChannelId>)
CreateStfuMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.Boolean)
CreateErrorMessage(System.String,System.Nullable`1<NLightning.Domain.Channels.ValueObjects.ChannelId>)
CreateErrorMessage(System.Byte[],System.Nullable`1<NLightning.Domain.Channels.ValueObjects.ChannelId>)
CreatePingMessage()
CreatePongMessage(NLightning.Domain.Protocol.Interfaces.IMessage)
CreateTxAddInputMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64,System.Byte[],System.UInt32,System.UInt32)
CreateTxAddOutputMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64,NLightning.Domain.Money.LightningMoney,NLightning.Domain.Bitcoin.ValueObjects.BitcoinScript)
CreateTxRemoveInputMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64)
CreateTxRemoveOutputMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64)
CreateTxCompleteMessage(NLightning.Domain.Channels.ValueObjects.ChannelId)
CreateTxSignaturesMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.Byte[],System.Collections.Generic.List`1<NLightning.Domain.Bitcoin.ValueObjects.Witness>)
CreateTxInitRbfMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt32,System.UInt32,System.Int64,System.Boolean)
CreateTxAckRbfMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.Int64,System.Boolean)
CreateTxAbortMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.Byte[])
CreateChannelReadyMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,System.Nullable`1<NLightning.Domain.Channels.ValueObjects.ShortChannelId>)
CreateShutdownMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,NLightning.Domain.Bitcoin.ValueObjects.BitcoinScript)
CreateClosingSignedMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64,NLightning.Domain.Crypto.ValueObjects.CompactSignature,System.UInt64,System.UInt64)
CreateOpenChannel1Message(NLightning.Domain.Channels.ValueObjects.ChannelId,NLightning.Domain.Money.LightningMoney,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Money.LightningMoney,NLightning.Domain.Money.LightningMoney,NLightning.Domain.Money.LightningMoney,System.UInt16,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Channels.ValueObjects.ChannelFlags,NLightning.Domain.Protocol.Tlv.UpfrontShutdownScriptTlv,NLightning.Domain.Protocol.Tlv.ChannelTypeTlv)
CreateOpenChannel2Message(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt32,System.UInt32,System.UInt64,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Channels.ValueObjects.ChannelFlags,System.Nullable`1<NLightning.Domain.Bitcoin.ValueObjects.BitcoinScript>,System.Byte[],System.Boolean)
CreateAcceptChannel1Message(NLightning.Domain.Money.LightningMoney,NLightning.Domain.Protocol.Tlv.ChannelTypeTlv,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,System.UInt16,NLightning.Domain.Money.LightningMoney,System.UInt32,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt16,NLightning.Domain.Protocol.Tlv.UpfrontShutdownScriptTlv)
CreateAcceptChannel2Message(NLightning.Domain.Channels.ValueObjects.ChannelId,NLightning.Domain.Money.LightningMoney,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Crypto.ValueObjects.CompactPubKey,NLightning.Domain.Money.LightningMoney,System.Nullable`1<NLightning.Domain.Bitcoin.ValueObjects.BitcoinScript>,System.Byte[],System.Boolean)
CreatedFundingCreatedMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,NLightning.Domain.Bitcoin.ValueObjects.TxId,System.UInt16,NLightning.Domain.Crypto.ValueObjects.CompactSignature)
CreatedFundingSignedMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,NLightning.Domain.Crypto.ValueObjects.CompactSignature)
CreateUpdateAddHtlcMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64,System.UInt64,System.ReadOnlyMemory`1<System.Byte>,System.UInt32,System.Nullable`1<System.ReadOnlyMemory`1<System.Byte>>)
CreateUpdateFulfillHtlcMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64,System.ReadOnlyMemory`1<System.Byte>)
CreateUpdateFailHtlcMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64,System.ReadOnlyMemory`1<System.Byte>)
CreateCommitmentSignedMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,NLightning.Domain.Crypto.ValueObjects.CompactSignature,System.Collections.Generic.IEnumerable`1<NLightning.Domain.Crypto.ValueObjects.CompactSignature>)
CreateRevokeAndAckMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.ReadOnlyMemory`1<System.Byte>,NLightning.Domain.Crypto.ValueObjects.CompactPubKey)
CreateUpdateFeeMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt32)
CreateUpdateFailMalformedHtlcMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64,System.ReadOnlyMemory`1<System.Byte>,System.UInt16)
CreateChannelReestablishMessage(NLightning.Domain.Channels.ValueObjects.ChannelId,System.UInt64,System.UInt64,System.ReadOnlyMemory`1<System.Byte>,NLightning.Domain.Crypto.ValueObjects.CompactPubKey)