X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=ts%2Fstructs%2FChannelMessageHandler.mts;h=dae0356c463136f5d3fcb553bc7e1483e0d014ec;hb=8d497f042760e54169e48de88626e0c4b02672c3;hp=a1c54a5d719da415475c5d7e75430c84f14cc9f6;hpb=a672396f21c0448656bb400cfe28b9df6e5a842b;p=ldk-java diff --git a/ts/structs/ChannelMessageHandler.mts b/ts/structs/ChannelMessageHandler.mts index a1c54a5d..dae0356c 100644 --- a/ts/structs/ChannelMessageHandler.mts +++ b/ts/structs/ChannelMessageHandler.mts @@ -1,7 +1,11 @@ import { TxOut } from '../structs/TxOut.mjs'; +import { TxIn } from '../structs/TxIn.mjs'; import { BigEndianScalar } from '../structs/BigEndianScalar.mjs'; +import { Bolt11SemanticError } from '../enums/Bolt11SemanticError.mjs'; +import { Bolt12SemanticError } from '../enums/Bolt12SemanticError.mjs'; import { COption_NoneZ } from '../enums/COption_NoneZ.mjs'; import { ChannelMonitorUpdateStatus } from '../enums/ChannelMonitorUpdateStatus.mjs'; +import { ChannelShutdownState } from '../enums/ChannelShutdownState.mjs'; import { ConfirmationTarget } from '../enums/ConfirmationTarget.mjs'; import { CreationError } from '../enums/CreationError.mjs'; import { Currency } from '../enums/Currency.mjs'; @@ -14,20 +18,29 @@ import { PaymentFailureReason } from '../enums/PaymentFailureReason.mjs'; import { Recipient } from '../enums/Recipient.mjs'; import { RetryableSendFailure } from '../enums/RetryableSendFailure.mjs'; import { Secp256k1Error } from '../enums/Secp256k1Error.mjs'; -import { SemanticError } from '../enums/SemanticError.mjs'; import { SiPrefix } from '../enums/SiPrefix.mjs'; import { UtxoLookupError } from '../enums/UtxoLookupError.mjs'; import { Bech32Error } from '../structs/Bech32Error.mjs'; import { Option_DurationZ } from '../structs/Option_DurationZ.mjs'; import { BlindedPath } from '../structs/BlindedPath.mjs'; import { Option_u64Z } from '../structs/Option_u64Z.mjs'; +import { Refund } from '../structs/Refund.mjs'; +import { Bolt12ParseError } from '../structs/Bolt12ParseError.mjs'; +import { Result_RefundBolt12ParseErrorZ } from '../structs/Result_RefundBolt12ParseErrorZ.mjs'; import { ShutdownScript } from '../structs/ShutdownScript.mjs'; import { APIError } from '../structs/APIError.mjs'; import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs'; +import { Option_PaymentSecretZ } from '../structs/Option_PaymentSecretZ.mjs'; import { Option_CVec_u8ZZ } from '../structs/Option_CVec_u8ZZ.mjs'; import { RecipientOnionFields } from '../structs/RecipientOnionFields.mjs'; import { DecodeError } from '../structs/DecodeError.mjs'; import { Result_RecipientOnionFieldsDecodeErrorZ } from '../structs/Result_RecipientOnionFieldsDecodeErrorZ.mjs'; +import { InvoiceRequest } from '../structs/InvoiceRequest.mjs'; +import { Bolt12Invoice } from '../structs/Bolt12Invoice.mjs'; +import { InvoiceError } from '../structs/InvoiceError.mjs'; +import { OffersMessage } from '../structs/OffersMessage.mjs'; +import { Option_OffersMessageZ } from '../structs/Option_OffersMessageZ.mjs'; +import { Result_OffersMessageDecodeErrorZ } from '../structs/Result_OffersMessageDecodeErrorZ.mjs'; import { Option_HTLCClaimZ } from '../structs/Option_HTLCClaimZ.mjs'; import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs'; import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs'; @@ -39,6 +52,7 @@ import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelP import { Option_u32Z } from '../structs/Option_u32Z.mjs'; import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs'; import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs'; +import { Option_PaymentPreimageZ } from '../structs/Option_PaymentPreimageZ.mjs'; import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs'; import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs'; import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs'; @@ -59,6 +73,37 @@ import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs'; import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs'; import { BlindedPayInfo } from '../structs/BlindedPayInfo.mjs'; import { Result_BlindedPayInfoDecodeErrorZ } from '../structs/Result_BlindedPayInfoDecodeErrorZ.mjs'; +import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs'; +import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs'; +import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs'; +import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs'; +import { OutPoint } from '../structs/OutPoint.mjs'; +import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs'; +import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs'; +import { Option_PackedLockTimeZ } from '../structs/Option_PackedLockTimeZ.mjs'; +import { TwoTuple_PartiallySignedTransactionusizeZ } from '../structs/TwoTuple_PartiallySignedTransactionusizeZ.mjs'; +import { Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ } from '../structs/Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.mjs'; +import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs'; +import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs'; +import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs'; +import { Result_PublicKeyNoneZ } from '../structs/Result_PublicKeyNoneZ.mjs'; +import { Option_ScalarZ } from '../structs/Option_ScalarZ.mjs'; +import { Result_SharedSecretNoneZ } from '../structs/Result_SharedSecretNoneZ.mjs'; +import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs'; +import { HTLCDescriptor } from '../structs/HTLCDescriptor.mjs'; +import { ClosingTransaction } from '../structs/ClosingTransaction.mjs'; +import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs'; +import { ChannelSigner, ChannelSignerInterface } from '../structs/ChannelSigner.mjs'; +import { EcdsaChannelSigner, EcdsaChannelSignerInterface } from '../structs/EcdsaChannelSigner.mjs'; +import { WriteableEcdsaChannelSigner, WriteableEcdsaChannelSignerInterface } from '../structs/WriteableEcdsaChannelSigner.mjs'; +import { Result_WriteableEcdsaChannelSignerDecodeErrorZ } from '../structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mjs'; +import { Result_ScriptNoneZ } from '../structs/Result_ScriptNoneZ.mjs'; +import { Result_ShutdownScriptNoneZ } from '../structs/Result_ShutdownScriptNoneZ.mjs'; +import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs'; +import { InMemorySigner } from '../structs/InMemorySigner.mjs'; +import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs'; +import { Result_PartiallySignedTransactionNoneZ } from '../structs/Result_PartiallySignedTransactionNoneZ.mjs'; +import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs'; import { ChannelDetails } from '../structs/ChannelDetails.mjs'; import { Route } from '../structs/Route.mjs'; import { LightningError } from '../structs/LightningError.mjs'; @@ -82,19 +127,19 @@ import { RouteHintHop } from '../structs/RouteHintHop.mjs'; import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs'; import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs'; import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs'; -import { TwoTuple_TxidBlockHashZ } from '../structs/TwoTuple_TxidBlockHashZ.mjs'; +import { Option_BlockHashZ } from '../structs/Option_BlockHashZ.mjs'; +import { TwoTuple_TxidCOption_BlockHashZZ } from '../structs/TwoTuple_TxidCOption_BlockHashZZ.mjs'; import { HTLCUpdate } from '../structs/HTLCUpdate.mjs'; -import { OutPoint } from '../structs/OutPoint.mjs'; import { MonitorEvent } from '../structs/MonitorEvent.mjs'; import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs'; import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs'; import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs'; +import { NodeId } from '../structs/NodeId.mjs'; import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs'; import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs'; import { TwoTuple_Z } from '../structs/TwoTuple_Z.mjs'; import { TwoTuple__u168_u168Z } from '../structs/TwoTuple__u168_u168Z.mjs'; import { Option_C2Tuple_EightU16sEightU16sZZ } from '../structs/Option_C2Tuple_EightU16sEightU16sZZ.mjs'; -import { NodeId } from '../structs/NodeId.mjs'; import { Record } from '../structs/Record.mjs'; import { Logger, LoggerInterface } from '../structs/Logger.mjs'; import { NetworkGraph } from '../structs/NetworkGraph.mjs'; @@ -106,8 +151,10 @@ import { ChannelFeatures } from '../structs/ChannelFeatures.mjs'; import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs'; import { NodeFeatures } from '../structs/NodeFeatures.mjs'; import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs'; -import { InvoiceFeatures } from '../structs/InvoiceFeatures.mjs'; -import { Result_InvoiceFeaturesDecodeErrorZ } from '../structs/Result_InvoiceFeaturesDecodeErrorZ.mjs'; +import { Bolt11InvoiceFeatures } from '../structs/Bolt11InvoiceFeatures.mjs'; +import { Result_Bolt11InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.mjs'; +import { Bolt12InvoiceFeatures } from '../structs/Bolt12InvoiceFeatures.mjs'; +import { Result_Bolt12InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.mjs'; import { BlindedHopFeatures } from '../structs/BlindedHopFeatures.mjs'; import { Result_BlindedHopFeaturesDecodeErrorZ } from '../structs/Result_BlindedHopFeaturesDecodeErrorZ.mjs'; import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs'; @@ -129,17 +176,28 @@ import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs' import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs'; import { Result_PaymentFailureReasonDecodeErrorZ } from '../structs/Result_PaymentFailureReasonDecodeErrorZ.mjs'; import { Option_u128Z } from '../structs/Option_u128Z.mjs'; +import { Option_PaymentIdZ } from '../structs/Option_PaymentIdZ.mjs'; import { Option_PaymentFailureReasonZ } from '../structs/Option_PaymentFailureReasonZ.mjs'; -import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs'; -import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs'; -import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs'; +import { Option_PaymentHashZ } from '../structs/Option_PaymentHashZ.mjs'; +import { AnchorDescriptor } from '../structs/AnchorDescriptor.mjs'; +import { BumpTransactionEvent } from '../structs/BumpTransactionEvent.mjs'; import { Event } from '../structs/Event.mjs'; import { Option_EventZ } from '../structs/Option_EventZ.mjs'; import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs'; import { AcceptChannel } from '../structs/AcceptChannel.mjs'; +import { AcceptChannelV2 } from '../structs/AcceptChannelV2.mjs'; import { OpenChannel } from '../structs/OpenChannel.mjs'; +import { OpenChannelV2 } from '../structs/OpenChannelV2.mjs'; import { FundingCreated } from '../structs/FundingCreated.mjs'; import { FundingSigned } from '../structs/FundingSigned.mjs'; +import { TxAddInput } from '../structs/TxAddInput.mjs'; +import { TxAddOutput } from '../structs/TxAddOutput.mjs'; +import { TxRemoveInput } from '../structs/TxRemoveInput.mjs'; +import { TxRemoveOutput } from '../structs/TxRemoveOutput.mjs'; +import { TxComplete } from '../structs/TxComplete.mjs'; +import { TxSignatures } from '../structs/TxSignatures.mjs'; +import { TxInitRbf } from '../structs/TxInitRbf.mjs'; +import { TxAckRbf } from '../structs/TxAckRbf.mjs'; import { ChannelReady } from '../structs/ChannelReady.mjs'; import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs'; import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs'; @@ -157,6 +215,8 @@ import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs'; import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs'; import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs'; import { MessageSendEvent } from '../structs/MessageSendEvent.mjs'; +import { Offer } from '../structs/Offer.mjs'; +import { Result_OfferBolt12ParseErrorZ } from '../structs/Result_OfferBolt12ParseErrorZ.mjs'; import { Result_PublicKeyErrorZ } from '../structs/Result_PublicKeyErrorZ.mjs'; import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs'; import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs'; @@ -165,10 +225,10 @@ import { UtxoFuture } from '../structs/UtxoFuture.mjs'; import { UtxoResult } from '../structs/UtxoResult.mjs'; import { UtxoLookup, UtxoLookupInterface } from '../structs/UtxoLookup.mjs'; import { Option_UtxoLookupZ } from '../structs/Option_UtxoLookupZ.mjs'; +import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs'; import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs'; import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs'; import { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ } from '../structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.mjs'; -import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs'; import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs'; import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs'; import { ChannelInfo } from '../structs/ChannelInfo.mjs'; @@ -185,27 +245,14 @@ import { NodeInfo } from '../structs/NodeInfo.mjs'; import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs'; import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs'; import { Option_CVec_NetAddressZZ } from '../structs/Option_CVec_NetAddressZZ.mjs'; -import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs'; -import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs'; -import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs'; -import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs'; -import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs'; -import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs'; -import { Result_PublicKeyNoneZ } from '../structs/Result_PublicKeyNoneZ.mjs'; -import { Option_ScalarZ } from '../structs/Option_ScalarZ.mjs'; -import { Result_SharedSecretNoneZ } from '../structs/Result_SharedSecretNoneZ.mjs'; -import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs'; -import { ClosingTransaction } from '../structs/ClosingTransaction.mjs'; -import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs'; -import { ChannelSigner, ChannelSignerInterface } from '../structs/ChannelSigner.mjs'; -import { EcdsaChannelSigner, EcdsaChannelSignerInterface } from '../structs/EcdsaChannelSigner.mjs'; -import { WriteableEcdsaChannelSigner, WriteableEcdsaChannelSignerInterface } from '../structs/WriteableEcdsaChannelSigner.mjs'; -import { Result_WriteableEcdsaChannelSignerDecodeErrorZ } from '../structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mjs'; -import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs'; -import { InMemorySigner } from '../structs/InMemorySigner.mjs'; -import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs'; -import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs'; +import { Utxo } from '../structs/Utxo.mjs'; +import { Option_TxOutZ } from '../structs/Option_TxOutZ.mjs'; +import { Input } from '../structs/Input.mjs'; +import { CoinSelection } from '../structs/CoinSelection.mjs'; +import { Result_CoinSelectionNoneZ } from '../structs/Result_CoinSelectionNoneZ.mjs'; +import { Result_CVec_UtxoZNoneZ } from '../structs/Result_CVec_UtxoZNoneZ.mjs'; import { Option_u16Z } from '../structs/Option_u16Z.mjs'; +import { Option_ChannelShutdownStateZ } from '../structs/Option_ChannelShutdownStateZ.mjs'; import { Result__u832APIErrorZ } from '../structs/Result__u832APIErrorZ.mjs'; import { RecentPaymentDetails } from '../structs/RecentPaymentDetails.mjs'; import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs'; @@ -217,10 +264,9 @@ import { TwoTuple_PaymentHashPaymentIdZ } from '../structs/TwoTuple_PaymentHashP import { Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ } from '../structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mjs'; import { TwoTuple_PaymentHashPaymentSecretZ } from '../structs/TwoTuple_PaymentHashPaymentSecretZ.mjs'; import { Result_C2Tuple_PaymentHashPaymentSecretZNoneZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mjs'; -import { Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mjs'; import { Result_PaymentSecretNoneZ } from '../structs/Result_PaymentSecretNoneZ.mjs'; -import { Result_PaymentSecretAPIErrorZ } from '../structs/Result_PaymentSecretAPIErrorZ.mjs'; import { Result_PaymentPreimageAPIErrorZ } from '../structs/Result_PaymentPreimageAPIErrorZ.mjs'; +import { Option_CVec_ChainHashZZ } from '../structs/Option_CVec_ChainHashZZ.mjs'; import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs'; import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs'; import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs'; @@ -228,6 +274,7 @@ import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_Channe import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs'; import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs'; import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs'; +import { Result_ChannelShutdownStateDecodeErrorZ } from '../structs/Result_ChannelShutdownStateDecodeErrorZ.mjs'; import { ChannelMonitor } from '../structs/ChannelMonitor.mjs'; import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs'; import { Watch, WatchInterface } from '../structs/Watch.mjs'; @@ -243,10 +290,19 @@ import { Router, RouterInterface } from '../structs/Router.mjs'; import { ChannelManager } from '../structs/ChannelManager.mjs'; import { TwoTuple_BlockHashChannelManagerZ } from '../structs/TwoTuple_BlockHashChannelManagerZ.mjs'; import { Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mjs'; +import { MaxDustHTLCExposure } from '../structs/MaxDustHTLCExposure.mjs'; +import { Result_MaxDustHTLCExposureDecodeErrorZ } from '../structs/Result_MaxDustHTLCExposureDecodeErrorZ.mjs'; import { ChannelConfig } from '../structs/ChannelConfig.mjs'; import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs'; +import { Option_MaxDustHTLCExposureZ } from '../structs/Option_MaxDustHTLCExposureZ.mjs'; import { Option_APIErrorZ } from '../structs/Option_APIErrorZ.mjs'; import { Result_COption_APIErrorZDecodeErrorZ } from '../structs/Result_COption_APIErrorZDecodeErrorZ.mjs'; +import { BigSize } from '../structs/BigSize.mjs'; +import { Result_BigSizeDecodeErrorZ } from '../structs/Result_BigSizeDecodeErrorZ.mjs'; +import { Result_HostnameDecodeErrorZ } from '../structs/Result_HostnameDecodeErrorZ.mjs'; +import { TransactionU16LenLimited } from '../structs/TransactionU16LenLimited.mjs'; +import { Result_TransactionU16LenLimitedNoneZ } from '../structs/Result_TransactionU16LenLimitedNoneZ.mjs'; +import { Result_TransactionU16LenLimitedDecodeErrorZ } from '../structs/Result_TransactionU16LenLimitedDecodeErrorZ.mjs'; import { Result_UntrustedStringDecodeErrorZ } from '../structs/Result_UntrustedStringDecodeErrorZ.mjs'; import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs'; import { Type, TypeInterface } from '../structs/Type.mjs'; @@ -278,6 +334,8 @@ import { PeerHandleError } from '../structs/PeerHandleError.mjs'; import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs'; import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs'; import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs'; +import { OnionMessagePath } from '../structs/OnionMessagePath.mjs'; +import { Result_OnionMessagePathNoneZ } from '../structs/Result_OnionMessagePathNoneZ.mjs'; import { SendError } from '../structs/SendError.mjs'; import { Result_NoneSendErrorZ } from '../structs/Result_NoneSendErrorZ.mjs'; import { Result_BlindedPathNoneZ } from '../structs/Result_BlindedPathNoneZ.mjs'; @@ -286,12 +344,26 @@ import { Result_BlindedHopDecodeErrorZ } from '../structs/Result_BlindedHopDecod import { GraphSyncError } from '../structs/GraphSyncError.mjs'; import { Result_u32GraphSyncErrorZ } from '../structs/Result_u32GraphSyncErrorZ.mjs'; import { Result_NoneErrorZ } from '../structs/Result_NoneErrorZ.mjs'; +import { Option_ScriptZ } from '../structs/Option_ScriptZ.mjs'; +import { Option_i64Z } from '../structs/Option_i64Z.mjs'; +import { Option_TxidZ } from '../structs/Option_TxidZ.mjs'; import { Result_NetAddressDecodeErrorZ } from '../structs/Result_NetAddressDecodeErrorZ.mjs'; import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs'; import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs'; import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs'; import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs'; import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs'; +import { Result_AcceptChannelV2DecodeErrorZ } from '../structs/Result_AcceptChannelV2DecodeErrorZ.mjs'; +import { Result_TxAddInputDecodeErrorZ } from '../structs/Result_TxAddInputDecodeErrorZ.mjs'; +import { Result_TxAddOutputDecodeErrorZ } from '../structs/Result_TxAddOutputDecodeErrorZ.mjs'; +import { Result_TxRemoveInputDecodeErrorZ } from '../structs/Result_TxRemoveInputDecodeErrorZ.mjs'; +import { Result_TxRemoveOutputDecodeErrorZ } from '../structs/Result_TxRemoveOutputDecodeErrorZ.mjs'; +import { Result_TxCompleteDecodeErrorZ } from '../structs/Result_TxCompleteDecodeErrorZ.mjs'; +import { Result_TxSignaturesDecodeErrorZ } from '../structs/Result_TxSignaturesDecodeErrorZ.mjs'; +import { Result_TxInitRbfDecodeErrorZ } from '../structs/Result_TxInitRbfDecodeErrorZ.mjs'; +import { Result_TxAckRbfDecodeErrorZ } from '../structs/Result_TxAckRbfDecodeErrorZ.mjs'; +import { TxAbort } from '../structs/TxAbort.mjs'; +import { Result_TxAbortDecodeErrorZ } from '../structs/Result_TxAbortDecodeErrorZ.mjs'; import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs'; import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs'; import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs'; @@ -305,6 +377,7 @@ import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyD import { Init } from '../structs/Init.mjs'; import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs'; import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs'; +import { Result_OpenChannelV2DecodeErrorZ } from '../structs/Result_OpenChannelV2DecodeErrorZ.mjs'; import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs'; import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs'; import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs'; @@ -333,6 +406,9 @@ import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_Re import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs'; import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs'; import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs'; +import { Option_KeyPairZ } from '../structs/Option_KeyPairZ.mjs'; +import { Result_COption_KeyPairZNoneZ } from '../structs/Result_COption_KeyPairZNoneZ.mjs'; +import { Result_InvoiceErrorDecodeErrorZ } from '../structs/Result_InvoiceErrorDecodeErrorZ.mjs'; import { WatchedOutput } from '../structs/WatchedOutput.mjs'; import { Filter, FilterInterface } from '../structs/Filter.mjs'; import { Option_FilterZ } from '../structs/Option_FilterZ.mjs'; @@ -340,30 +416,30 @@ import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs'; import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs'; import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs'; import { TwoTuple_OutPointCVec_MonitorUpdateIdZZ } from '../structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.mjs'; -import { Invoice } from '../structs/Invoice.mjs'; +import { Bolt11Invoice } from '../structs/Bolt11Invoice.mjs'; import { SignOrCreationError } from '../structs/SignOrCreationError.mjs'; -import { Result_InvoiceSignOrCreationErrorZ } from '../structs/Result_InvoiceSignOrCreationErrorZ.mjs'; -import { ParseError } from '../structs/ParseError.mjs'; -import { Result_SiPrefixParseErrorZ } from '../structs/Result_SiPrefixParseErrorZ.mjs'; +import { Result_Bolt11InvoiceSignOrCreationErrorZ } from '../structs/Result_Bolt11InvoiceSignOrCreationErrorZ.mjs'; +import { Bolt11ParseError } from '../structs/Bolt11ParseError.mjs'; +import { Result_SiPrefixBolt11ParseErrorZ } from '../structs/Result_SiPrefixBolt11ParseErrorZ.mjs'; import { ParseOrSemanticError } from '../structs/ParseOrSemanticError.mjs'; -import { Result_InvoiceParseOrSemanticErrorZ } from '../structs/Result_InvoiceParseOrSemanticErrorZ.mjs'; -import { SignedRawInvoice } from '../structs/SignedRawInvoice.mjs'; -import { Result_SignedRawInvoiceParseErrorZ } from '../structs/Result_SignedRawInvoiceParseErrorZ.mjs'; -import { RawInvoice } from '../structs/RawInvoice.mjs'; -import { InvoiceSignature } from '../structs/InvoiceSignature.mjs'; -import { ThreeTuple_RawInvoice_u832InvoiceSignatureZ } from '../structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.mjs'; +import { Result_Bolt11InvoiceParseOrSemanticErrorZ } from '../structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.mjs'; +import { SignedRawBolt11Invoice } from '../structs/SignedRawBolt11Invoice.mjs'; +import { Result_SignedRawBolt11InvoiceBolt11ParseErrorZ } from '../structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.mjs'; +import { RawBolt11Invoice } from '../structs/RawBolt11Invoice.mjs'; +import { Bolt11InvoiceSignature } from '../structs/Bolt11InvoiceSignature.mjs'; +import { ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ } from '../structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.mjs'; import { PayeePubKey } from '../structs/PayeePubKey.mjs'; import { Result_PayeePubKeyErrorZ } from '../structs/Result_PayeePubKeyErrorZ.mjs'; import { PrivateRoute } from '../structs/PrivateRoute.mjs'; import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs'; import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs'; -import { Result_NoneSemanticErrorZ } from '../structs/Result_NoneSemanticErrorZ.mjs'; -import { Result_InvoiceSemanticErrorZ } from '../structs/Result_InvoiceSemanticErrorZ.mjs'; +import { Result_NoneBolt11SemanticErrorZ } from '../structs/Result_NoneBolt11SemanticErrorZ.mjs'; +import { Result_Bolt11InvoiceBolt11SemanticErrorZ } from '../structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.mjs'; import { Description } from '../structs/Description.mjs'; import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs'; import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs'; -import { BigSize } from '../structs/BigSize.mjs'; import { ChannelUsage } from '../structs/ChannelUsage.mjs'; +import { ProbabilisticScoringFeeParameters } from '../structs/ProbabilisticScoringFeeParameters.mjs'; import { Score, ScoreInterface } from '../structs/Score.mjs'; import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs'; import { WriteableScore, WriteableScoreInterface } from '../structs/WriteableScore.mjs'; @@ -373,6 +449,7 @@ import { FutureCallback, FutureCallbackInterface } from '../structs/FutureCallba import { Future } from '../structs/Future.mjs'; import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs'; import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs'; +import { ChannelConfigUpdate } from '../structs/ChannelConfigUpdate.mjs'; import { UserConfig } from '../structs/UserConfig.mjs'; import { BestBlock } from '../structs/BestBlock.mjs'; import { Listen, ListenInterface } from '../structs/Listen.mjs'; @@ -381,20 +458,18 @@ import { Persist, PersistInterface } from '../structs/Persist.mjs'; import { ChainMonitor } from '../structs/ChainMonitor.mjs'; import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs'; import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs'; -import { KeysManager } from '../structs/KeysManager.mjs'; -import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs'; import { ChainParameters } from '../structs/ChainParameters.mjs'; import { Retry } from '../structs/Retry.mjs'; import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs'; import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs'; import { ExpandedKey } from '../structs/ExpandedKey.mjs'; -import { DataLossProtect } from '../structs/DataLossProtect.mjs'; import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs'; import { OnionMessageProvider, OnionMessageProviderInterface } from '../structs/OnionMessageProvider.mjs'; import { OnionMessageHandler, OnionMessageHandlerInterface } from '../structs/OnionMessageHandler.mjs'; import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs'; import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs'; import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs'; +import { OffersMessageHandler, OffersMessageHandlerInterface } from '../structs/OffersMessageHandler.mjs'; import { CustomOnionMessageHandler, CustomOnionMessageHandlerInterface } from '../structs/CustomOnionMessageHandler.mjs'; import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs'; import { MessageHandler } from '../structs/MessageHandler.mjs'; @@ -403,27 +478,33 @@ import { PeerManager } from '../structs/PeerManager.mjs'; import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs'; import { OfferFeatures } from '../structs/OfferFeatures.mjs'; import { InvoiceRequestFeatures } from '../structs/InvoiceRequestFeatures.mjs'; -import { Bolt12InvoiceFeatures } from '../structs/Bolt12InvoiceFeatures.mjs'; -import { UnsignedInvoice } from '../structs/UnsignedInvoice.mjs'; +import { UnsignedBolt12Invoice } from '../structs/UnsignedBolt12Invoice.mjs'; +import { ErroneousField } from '../structs/ErroneousField.mjs'; import { UnsignedInvoiceRequest } from '../structs/UnsignedInvoiceRequest.mjs'; -import { InvoiceRequest } from '../structs/InvoiceRequest.mjs'; -import { Offer } from '../structs/Offer.mjs'; import { Amount } from '../structs/Amount.mjs'; import { Quantity } from '../structs/Quantity.mjs'; -import { Refund } from '../structs/Refund.mjs'; import { P2PGossipSync } from '../structs/P2PGossipSync.mjs'; import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs'; import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs'; import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs'; import { DefaultRouter } from '../structs/DefaultRouter.mjs'; import { ScorerAccountingForInFlightHtlcs } from '../structs/ScorerAccountingForInFlightHtlcs.mjs'; -import { Hints } from '../structs/Hints.mjs'; +import { Payee } from '../structs/Payee.mjs'; import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs'; import { MultiThreadedScoreLock } from '../structs/MultiThreadedScoreLock.mjs'; -import { ProbabilisticScoringParameters } from '../structs/ProbabilisticScoringParameters.mjs'; -import { OnionMessenger } from '../structs/OnionMessenger.mjs'; +import { ProbabilisticScoringDecayParameters } from '../structs/ProbabilisticScoringDecayParameters.mjs'; +import { KeysManager } from '../structs/KeysManager.mjs'; +import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs'; import { Destination } from '../structs/Destination.mjs'; +import { MessageRouter, MessageRouterInterface } from '../structs/MessageRouter.mjs'; +import { OnionMessenger } from '../structs/OnionMessenger.mjs'; +import { DefaultMessageRouter } from '../structs/DefaultMessageRouter.mjs'; import { OnionMessageContents } from '../structs/OnionMessageContents.mjs'; +import { ChannelDerivationParameters } from '../structs/ChannelDerivationParameters.mjs'; +import { CoinSelectionSource, CoinSelectionSourceInterface } from '../structs/CoinSelectionSource.mjs'; +import { WalletSource, WalletSourceInterface } from '../structs/WalletSource.mjs'; +import { Wallet } from '../structs/Wallet.mjs'; +import { BumpTransactionEventHandler } from '../structs/BumpTransactionEventHandler.mjs'; import { RapidGossipSync } from '../structs/RapidGossipSync.mjs'; import { GossipSync } from '../structs/GossipSync.mjs'; import { RawDataPart } from '../structs/RawDataPart.mjs'; @@ -443,9 +524,15 @@ export interface ChannelMessageHandlerInterface { /**Handle an incoming `open_channel` message from the given peer. */ handle_open_channel(their_node_id: Uint8Array, msg: OpenChannel): void; + /**Handle an incoming `open_channel2` message from the given peer. + */ + handle_open_channel_v2(their_node_id: Uint8Array, msg: OpenChannelV2): void; /**Handle an incoming `accept_channel` message from the given peer. */ handle_accept_channel(their_node_id: Uint8Array, msg: AcceptChannel): void; + /**Handle an incoming `accept_channel2` message from the given peer. + */ + handle_accept_channel_v2(their_node_id: Uint8Array, msg: AcceptChannelV2): void; /**Handle an incoming `funding_created` message from the given peer. */ handle_funding_created(their_node_id: Uint8Array, msg: FundingCreated): void; @@ -461,6 +548,33 @@ export interface ChannelMessageHandlerInterface { /**Handle an incoming `closing_signed` message from the given peer. */ handle_closing_signed(their_node_id: Uint8Array, msg: ClosingSigned): void; + /**Handle an incoming `tx_add_input message` from the given peer. + */ + handle_tx_add_input(their_node_id: Uint8Array, msg: TxAddInput): void; + /**Handle an incoming `tx_add_output` message from the given peer. + */ + handle_tx_add_output(their_node_id: Uint8Array, msg: TxAddOutput): void; + /**Handle an incoming `tx_remove_input` message from the given peer. + */ + handle_tx_remove_input(their_node_id: Uint8Array, msg: TxRemoveInput): void; + /**Handle an incoming `tx_remove_output` message from the given peer. + */ + handle_tx_remove_output(their_node_id: Uint8Array, msg: TxRemoveOutput): void; + /**Handle an incoming `tx_complete message` from the given peer. + */ + handle_tx_complete(their_node_id: Uint8Array, msg: TxComplete): void; + /**Handle an incoming `tx_signatures` message from the given peer. + */ + handle_tx_signatures(their_node_id: Uint8Array, msg: TxSignatures): void; + /**Handle an incoming `tx_init_rbf` message from the given peer. + */ + handle_tx_init_rbf(their_node_id: Uint8Array, msg: TxInitRbf): void; + /**Handle an incoming `tx_ack_rbf` message from the given peer. + */ + handle_tx_ack_rbf(their_node_id: Uint8Array, msg: TxAckRbf): void; + /**Handle an incoming `tx_abort message` from the given peer. + */ + handle_tx_abort(their_node_id: Uint8Array, msg: TxAbort): void; /**Handle an incoming `update_add_htlc` message from the given peer. */ handle_update_add_htlc(their_node_id: Uint8Array, msg: UpdateAddHTLC): void; @@ -516,6 +630,12 @@ export interface ChannelMessageHandlerInterface { * Note that this method is called before [`Self::peer_connected`]. */ provided_init_features(their_node_id: Uint8Array): InitFeatures; + /**Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports. + * + * If it's `None`, then no particular network chain hash compatibility will be enforced when + * connecting to peers. + */ + get_genesis_hashes(): Option_CVec_ChainHashZZ; } class LDKChannelMessageHandlerHolder { @@ -550,11 +670,21 @@ export class ChannelMessageHandler extends CommonBase { const msg_hu_conv: OpenChannel = new OpenChannel(null, msg); arg.handle_open_channel(their_node_id_conv, msg_hu_conv); }, + handle_open_channel_v2 (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: OpenChannelV2 = new OpenChannelV2(null, msg); + arg.handle_open_channel_v2(their_node_id_conv, msg_hu_conv); + }, handle_accept_channel (their_node_id: number, msg: bigint): void { const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); const msg_hu_conv: AcceptChannel = new AcceptChannel(null, msg); arg.handle_accept_channel(their_node_id_conv, msg_hu_conv); }, + handle_accept_channel_v2 (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: AcceptChannelV2 = new AcceptChannelV2(null, msg); + arg.handle_accept_channel_v2(their_node_id_conv, msg_hu_conv); + }, handle_funding_created (their_node_id: number, msg: bigint): void { const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); const msg_hu_conv: FundingCreated = new FundingCreated(null, msg); @@ -580,6 +710,51 @@ export class ChannelMessageHandler extends CommonBase { const msg_hu_conv: ClosingSigned = new ClosingSigned(null, msg); arg.handle_closing_signed(their_node_id_conv, msg_hu_conv); }, + handle_tx_add_input (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxAddInput = new TxAddInput(null, msg); + arg.handle_tx_add_input(their_node_id_conv, msg_hu_conv); + }, + handle_tx_add_output (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxAddOutput = new TxAddOutput(null, msg); + arg.handle_tx_add_output(their_node_id_conv, msg_hu_conv); + }, + handle_tx_remove_input (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxRemoveInput = new TxRemoveInput(null, msg); + arg.handle_tx_remove_input(their_node_id_conv, msg_hu_conv); + }, + handle_tx_remove_output (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxRemoveOutput = new TxRemoveOutput(null, msg); + arg.handle_tx_remove_output(their_node_id_conv, msg_hu_conv); + }, + handle_tx_complete (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxComplete = new TxComplete(null, msg); + arg.handle_tx_complete(their_node_id_conv, msg_hu_conv); + }, + handle_tx_signatures (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxSignatures = new TxSignatures(null, msg); + arg.handle_tx_signatures(their_node_id_conv, msg_hu_conv); + }, + handle_tx_init_rbf (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxInitRbf = new TxInitRbf(null, msg); + arg.handle_tx_init_rbf(their_node_id_conv, msg_hu_conv); + }, + handle_tx_ack_rbf (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxAckRbf = new TxAckRbf(null, msg); + arg.handle_tx_ack_rbf(their_node_id_conv, msg_hu_conv); + }, + handle_tx_abort (their_node_id: number, msg: bigint): void { + const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); + const msg_hu_conv: TxAbort = new TxAbort(null, msg); + arg.handle_tx_abort(their_node_id_conv, msg_hu_conv); + }, handle_update_add_htlc (their_node_id: number, msg: bigint): void { const their_node_id_conv: Uint8Array = bindings.decodeUint8Array(their_node_id); const msg_hu_conv: UpdateAddHTLC = new UpdateAddHTLC(null, msg); @@ -657,6 +832,12 @@ export class ChannelMessageHandler extends CommonBase { const result: bigint = ret == null ? 0n : ret.clone_ptr(); return result; }, + get_genesis_hashes (): bigint { + const ret: Option_CVec_ChainHashZZ = arg.get_genesis_hashes(); + const result: bigint = ret == null ? 0n : ret.clone_ptr(); + CommonBase.add_ref_from(impl_holder.held, ret); + return result; + }, } as bindings.LDKChannelMessageHandler; const messageSendEventsProvider = MessageSendEventsProvider.new_impl(messageSendEventsProvider_impl, ); const ptr_idx: [bigint, number] = bindings.LDKChannelMessageHandler_new(structImplementation, messageSendEventsProvider.instance_idx!); @@ -676,6 +857,14 @@ export class ChannelMessageHandler extends CommonBase { CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming `open_channel2` message from the given peer. + */ + public handle_open_channel_v2(their_node_id: Uint8Array, msg: OpenChannelV2): void { + bindings.ChannelMessageHandler_handle_open_channel_v2(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + /** * Handle an incoming `accept_channel` message from the given peer. */ @@ -684,6 +873,14 @@ export class ChannelMessageHandler extends CommonBase { CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming `accept_channel2` message from the given peer. + */ + public handle_accept_channel_v2(their_node_id: Uint8Array, msg: AcceptChannelV2): void { + bindings.ChannelMessageHandler_handle_accept_channel_v2(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + /** * Handle an incoming `funding_created` message from the given peer. */ @@ -724,6 +921,78 @@ export class ChannelMessageHandler extends CommonBase { CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming `tx_add_input message` from the given peer. + */ + public handle_tx_add_input(their_node_id: Uint8Array, msg: TxAddInput): void { + bindings.ChannelMessageHandler_handle_tx_add_input(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + + /** + * Handle an incoming `tx_add_output` message from the given peer. + */ + public handle_tx_add_output(their_node_id: Uint8Array, msg: TxAddOutput): void { + bindings.ChannelMessageHandler_handle_tx_add_output(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + + /** + * Handle an incoming `tx_remove_input` message from the given peer. + */ + public handle_tx_remove_input(their_node_id: Uint8Array, msg: TxRemoveInput): void { + bindings.ChannelMessageHandler_handle_tx_remove_input(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + + /** + * Handle an incoming `tx_remove_output` message from the given peer. + */ + public handle_tx_remove_output(their_node_id: Uint8Array, msg: TxRemoveOutput): void { + bindings.ChannelMessageHandler_handle_tx_remove_output(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + + /** + * Handle an incoming `tx_complete message` from the given peer. + */ + public handle_tx_complete(their_node_id: Uint8Array, msg: TxComplete): void { + bindings.ChannelMessageHandler_handle_tx_complete(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + + /** + * Handle an incoming `tx_signatures` message from the given peer. + */ + public handle_tx_signatures(their_node_id: Uint8Array, msg: TxSignatures): void { + bindings.ChannelMessageHandler_handle_tx_signatures(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + + /** + * Handle an incoming `tx_init_rbf` message from the given peer. + */ + public handle_tx_init_rbf(their_node_id: Uint8Array, msg: TxInitRbf): void { + bindings.ChannelMessageHandler_handle_tx_init_rbf(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + + /** + * Handle an incoming `tx_ack_rbf` message from the given peer. + */ + public handle_tx_ack_rbf(their_node_id: Uint8Array, msg: TxAckRbf): void { + bindings.ChannelMessageHandler_handle_tx_ack_rbf(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + + /** + * Handle an incoming `tx_abort message` from the given peer. + */ + public handle_tx_abort(their_node_id: Uint8Array, msg: TxAbort): void { + bindings.ChannelMessageHandler_handle_tx_abort(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0n : CommonBase.get_ptr_of(msg)); + CommonBase.add_ref_from(this, msg); + } + /** * Handle an incoming `update_add_htlc` message from the given peer. */ @@ -859,4 +1128,17 @@ export class ChannelMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports. + * + * If it's `None`, then no particular network chain hash compatibility will be enforced when + * connecting to peers. + */ + public get_genesis_hashes(): Option_CVec_ChainHashZZ { + const ret: bigint = bindings.ChannelMessageHandler_get_genesis_hashes(this.ptr); + const ret_hu_conv: Option_CVec_ChainHashZZ = Option_CVec_ChainHashZZ.constr_from_ptr(ret); + CommonBase.add_ref_from(ret_hu_conv, this); + return ret_hu_conv; + } + }