1 import { TxOut } from '../structs/TxOut.mjs';
2 import { TxIn } from '../structs/TxIn.mjs';
3 import { BigEndianScalar } from '../structs/BigEndianScalar.mjs';
4 import { Bolt11SemanticError } from '../enums/Bolt11SemanticError.mjs';
5 import { Bolt12SemanticError } from '../enums/Bolt12SemanticError.mjs';
6 import { COption_NoneZ } from '../enums/COption_NoneZ.mjs';
7 import { ChannelMonitorUpdateStatus } from '../enums/ChannelMonitorUpdateStatus.mjs';
8 import { ChannelShutdownState } from '../enums/ChannelShutdownState.mjs';
9 import { ConfirmationTarget } from '../enums/ConfirmationTarget.mjs';
10 import { CreationError } from '../enums/CreationError.mjs';
11 import { Currency } from '../enums/Currency.mjs';
12 import { HTLCClaim } from '../enums/HTLCClaim.mjs';
13 import { IOError } from '../enums/IOError.mjs';
14 import { Level } from '../enums/Level.mjs';
15 import { Network } from '../enums/Network.mjs';
16 import { PaymentFailureReason } from '../enums/PaymentFailureReason.mjs';
17 import { Recipient } from '../enums/Recipient.mjs';
18 import { RetryableSendFailure } from '../enums/RetryableSendFailure.mjs';
19 import { Secp256k1Error } from '../enums/Secp256k1Error.mjs';
20 import { SiPrefix } from '../enums/SiPrefix.mjs';
21 import { SocketAddressParseError } from '../enums/SocketAddressParseError.mjs';
22 import { UtxoLookupError } from '../enums/UtxoLookupError.mjs';
23 import { Bech32Error } from '../structs/Bech32Error.mjs';
24 import { Option_u64Z } from '../structs/Option_u64Z.mjs';
25 import { BlindedPath } from '../structs/BlindedPath.mjs';
26 import { Refund } from '../structs/Refund.mjs';
27 import { Bolt12ParseError } from '../structs/Bolt12ParseError.mjs';
28 import { Result_RefundBolt12ParseErrorZ } from '../structs/Result_RefundBolt12ParseErrorZ.mjs';
29 import { Retry } from '../structs/Retry.mjs';
30 import { DecodeError } from '../structs/DecodeError.mjs';
31 import { Result_RetryDecodeErrorZ } from '../structs/Result_RetryDecodeErrorZ.mjs';
32 import { ShutdownScript } from '../structs/ShutdownScript.mjs';
33 import { APIError } from '../structs/APIError.mjs';
34 import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs';
35 import { Option_ThirtyTwoBytesZ } from '../structs/Option_ThirtyTwoBytesZ.mjs';
36 import { Option_CVec_u8ZZ } from '../structs/Option_CVec_u8ZZ.mjs';
37 import { RecipientOnionFields } from '../structs/RecipientOnionFields.mjs';
38 import { Result_RecipientOnionFieldsDecodeErrorZ } from '../structs/Result_RecipientOnionFieldsDecodeErrorZ.mjs';
39 import { TwoTuple_u64CVec_u8ZZ } from '../structs/TwoTuple_u64CVec_u8ZZ.mjs';
40 import { Result_RecipientOnionFieldsNoneZ } from '../structs/Result_RecipientOnionFieldsNoneZ.mjs';
41 import { Option_CVec_ThirtyTwoBytesZZ } from '../structs/Option_CVec_ThirtyTwoBytesZZ.mjs';
42 import { Result_ThirtyTwoBytesNoneZ } from '../structs/Result_ThirtyTwoBytesNoneZ.mjs';
43 import { BlindedPayInfo } from '../structs/BlindedPayInfo.mjs';
44 import { Result_BlindedPayInfoDecodeErrorZ } from '../structs/Result_BlindedPayInfoDecodeErrorZ.mjs';
45 import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs';
46 import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs';
47 import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs';
48 import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs';
49 import { OutPoint } from '../structs/OutPoint.mjs';
50 import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs';
51 import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs';
52 import { Option_u32Z } from '../structs/Option_u32Z.mjs';
53 import { TwoTuple_CVec_u8ZusizeZ } from '../structs/TwoTuple_CVec_u8ZusizeZ.mjs';
54 import { Result_C2Tuple_CVec_u8ZusizeZNoneZ } from '../structs/Result_C2Tuple_CVec_u8ZusizeZNoneZ.mjs';
55 import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs';
56 import { TwoTuple_ECDSASignatureCVec_ECDSASignatureZZ } from '../structs/TwoTuple_ECDSASignatureCVec_ECDSASignatureZZ.mjs';
57 import { Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ } from '../structs/Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.mjs';
58 import { Result_ECDSASignatureNoneZ } from '../structs/Result_ECDSASignatureNoneZ.mjs';
59 import { Result_PublicKeyNoneZ } from '../structs/Result_PublicKeyNoneZ.mjs';
60 import { Option_BigEndianScalarZ } from '../structs/Option_BigEndianScalarZ.mjs';
61 import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs';
62 import { Result_SchnorrSignatureNoneZ } from '../structs/Result_SchnorrSignatureNoneZ.mjs';
63 import { CommitmentTransaction } from '../structs/CommitmentTransaction.mjs';
64 import { HolderCommitmentTransaction } from '../structs/HolderCommitmentTransaction.mjs';
65 import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs';
66 import { HTLCDescriptor } from '../structs/HTLCDescriptor.mjs';
67 import { ClosingTransaction } from '../structs/ClosingTransaction.mjs';
68 import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs';
69 import { ChannelPublicKeys } from '../structs/ChannelPublicKeys.mjs';
70 import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs';
71 import { ChannelSigner, ChannelSignerInterface } from '../structs/ChannelSigner.mjs';
72 import { EcdsaChannelSigner, EcdsaChannelSignerInterface } from '../structs/EcdsaChannelSigner.mjs';
73 import { WriteableEcdsaChannelSigner, WriteableEcdsaChannelSignerInterface } from '../structs/WriteableEcdsaChannelSigner.mjs';
74 import { Result_WriteableEcdsaChannelSignerDecodeErrorZ } from '../structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mjs';
75 import { Result_CVec_u8ZNoneZ } from '../structs/Result_CVec_u8ZNoneZ.mjs';
76 import { Result_ShutdownScriptNoneZ } from '../structs/Result_ShutdownScriptNoneZ.mjs';
77 import { Option_u16Z } from '../structs/Option_u16Z.mjs';
78 import { Option_boolZ } from '../structs/Option_boolZ.mjs';
79 import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs';
80 import { InMemorySigner } from '../structs/InMemorySigner.mjs';
81 import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs';
82 import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs';
83 import { ChannelDetails } from '../structs/ChannelDetails.mjs';
84 import { Route } from '../structs/Route.mjs';
85 import { LightningError } from '../structs/LightningError.mjs';
86 import { Result_RouteLightningErrorZ } from '../structs/Result_RouteLightningErrorZ.mjs';
87 import { InFlightHtlcs } from '../structs/InFlightHtlcs.mjs';
88 import { Result_InFlightHtlcsDecodeErrorZ } from '../structs/Result_InFlightHtlcsDecodeErrorZ.mjs';
89 import { RouteHop } from '../structs/RouteHop.mjs';
90 import { Result_RouteHopDecodeErrorZ } from '../structs/Result_RouteHopDecodeErrorZ.mjs';
91 import { BlindedHop } from '../structs/BlindedHop.mjs';
92 import { BlindedTail } from '../structs/BlindedTail.mjs';
93 import { Result_BlindedTailDecodeErrorZ } from '../structs/Result_BlindedTailDecodeErrorZ.mjs';
94 import { Path } from '../structs/Path.mjs';
95 import { Result_RouteDecodeErrorZ } from '../structs/Result_RouteDecodeErrorZ.mjs';
96 import { RouteParameters } from '../structs/RouteParameters.mjs';
97 import { Result_RouteParametersDecodeErrorZ } from '../structs/Result_RouteParametersDecodeErrorZ.mjs';
98 import { PaymentParameters } from '../structs/PaymentParameters.mjs';
99 import { Result_PaymentParametersDecodeErrorZ } from '../structs/Result_PaymentParametersDecodeErrorZ.mjs';
100 import { TwoTuple_BlindedPayInfoBlindedPathZ } from '../structs/TwoTuple_BlindedPayInfoBlindedPathZ.mjs';
101 import { RouteHint } from '../structs/RouteHint.mjs';
102 import { RouteHintHop } from '../structs/RouteHintHop.mjs';
103 import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs';
104 import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs';
105 import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
106 import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
107 import { NodeId } from '../structs/NodeId.mjs';
108 import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs';
109 import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs';
110 import { TwoTuple_Z } from '../structs/TwoTuple_Z.mjs';
111 import { TwoTuple__u1632_u1632Z } from '../structs/TwoTuple__u1632_u1632Z.mjs';
112 import { Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ } from '../structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.mjs';
113 import { Option_f64Z } from '../structs/Option_f64Z.mjs';
114 import { Record } from '../structs/Record.mjs';
115 import { Logger, LoggerInterface } from '../structs/Logger.mjs';
116 import { NetworkGraph } from '../structs/NetworkGraph.mjs';
117 import { ProbabilisticScorer } from '../structs/ProbabilisticScorer.mjs';
118 import { Result_ProbabilisticScorerDecodeErrorZ } from '../structs/Result_ProbabilisticScorerDecodeErrorZ.mjs';
119 import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs';
120 import { TwoTuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ } from '../structs/TwoTuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ.mjs';
121 import { Result_ChannelMonitorUpdateStatusNoneZ } from '../structs/Result_ChannelMonitorUpdateStatusNoneZ.mjs';
122 import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
123 import { MonitorEvent } from '../structs/MonitorEvent.mjs';
124 import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs';
125 import { InitFeatures } from '../structs/InitFeatures.mjs';
126 import { Result_InitFeaturesDecodeErrorZ } from '../structs/Result_InitFeaturesDecodeErrorZ.mjs';
127 import { ChannelFeatures } from '../structs/ChannelFeatures.mjs';
128 import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs';
129 import { NodeFeatures } from '../structs/NodeFeatures.mjs';
130 import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs';
131 import { Bolt11InvoiceFeatures } from '../structs/Bolt11InvoiceFeatures.mjs';
132 import { Result_Bolt11InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.mjs';
133 import { Bolt12InvoiceFeatures } from '../structs/Bolt12InvoiceFeatures.mjs';
134 import { Result_Bolt12InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.mjs';
135 import { BlindedHopFeatures } from '../structs/BlindedHopFeatures.mjs';
136 import { Result_BlindedHopFeaturesDecodeErrorZ } from '../structs/Result_BlindedHopFeaturesDecodeErrorZ.mjs';
137 import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs';
138 import { Result_ChannelTypeFeaturesDecodeErrorZ } from '../structs/Result_ChannelTypeFeaturesDecodeErrorZ.mjs';
139 import { Offer } from '../structs/Offer.mjs';
140 import { Result_OfferBolt12ParseErrorZ } from '../structs/Result_OfferBolt12ParseErrorZ.mjs';
141 import { Result_PublicKeySecp256k1ErrorZ } from '../structs/Result_PublicKeySecp256k1ErrorZ.mjs';
142 import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs';
143 import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
144 import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
145 import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
146 import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs';
147 import { Result_TxOutUtxoLookupErrorZ } from '../structs/Result_TxOutUtxoLookupErrorZ.mjs';
148 import { UtxoFuture } from '../structs/UtxoFuture.mjs';
149 import { UtxoResult } from '../structs/UtxoResult.mjs';
150 import { UtxoLookup, UtxoLookupInterface } from '../structs/UtxoLookup.mjs';
151 import { Option_UtxoLookupZ } from '../structs/Option_UtxoLookupZ.mjs';
152 import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs';
153 import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs';
154 import { ChannelAnnouncement } from '../structs/ChannelAnnouncement.mjs';
155 import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs';
156 import { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ } from '../structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.mjs';
157 import { AcceptChannel } from '../structs/AcceptChannel.mjs';
158 import { AcceptChannelV2 } from '../structs/AcceptChannelV2.mjs';
159 import { OpenChannel } from '../structs/OpenChannel.mjs';
160 import { OpenChannelV2 } from '../structs/OpenChannelV2.mjs';
161 import { FundingCreated } from '../structs/FundingCreated.mjs';
162 import { FundingSigned } from '../structs/FundingSigned.mjs';
163 import { TxAddInput } from '../structs/TxAddInput.mjs';
164 import { TxAddOutput } from '../structs/TxAddOutput.mjs';
165 import { TxRemoveInput } from '../structs/TxRemoveInput.mjs';
166 import { TxRemoveOutput } from '../structs/TxRemoveOutput.mjs';
167 import { TxComplete } from '../structs/TxComplete.mjs';
168 import { TxSignatures } from '../structs/TxSignatures.mjs';
169 import { TxInitRbf } from '../structs/TxInitRbf.mjs';
170 import { TxAckRbf } from '../structs/TxAckRbf.mjs';
171 import { TxAbort } from '../structs/TxAbort.mjs';
172 import { ChannelReady } from '../structs/ChannelReady.mjs';
173 import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs';
174 import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs';
175 import { RevokeAndACK } from '../structs/RevokeAndACK.mjs';
176 import { ClosingSigned } from '../structs/ClosingSigned.mjs';
177 import { Shutdown } from '../structs/Shutdown.mjs';
178 import { ChannelReestablish } from '../structs/ChannelReestablish.mjs';
179 import { NodeAnnouncement } from '../structs/NodeAnnouncement.mjs';
180 import { ErrorMessage } from '../structs/ErrorMessage.mjs';
181 import { WarningMessage } from '../structs/WarningMessage.mjs';
182 import { ErrorAction } from '../structs/ErrorAction.mjs';
183 import { QueryChannelRange } from '../structs/QueryChannelRange.mjs';
184 import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs';
185 import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs';
186 import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs';
187 import { MessageSendEvent } from '../structs/MessageSendEvent.mjs';
188 import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs';
189 import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs';
190 import { ChannelInfo } from '../structs/ChannelInfo.mjs';
191 import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
192 import { RoutingFees } from '../structs/RoutingFees.mjs';
193 import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
194 import { Hostname } from '../structs/Hostname.mjs';
195 import { SocketAddress } from '../structs/SocketAddress.mjs';
196 import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
197 import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
198 import { NodeAlias } from '../structs/NodeAlias.mjs';
199 import { Result_NodeAliasDecodeErrorZ } from '../structs/Result_NodeAliasDecodeErrorZ.mjs';
200 import { NodeInfo } from '../structs/NodeInfo.mjs';
201 import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs';
202 import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs';
203 import { Option_CVec_SocketAddressZZ } from '../structs/Option_CVec_SocketAddressZZ.mjs';
204 import { ChannelDerivationParameters } from '../structs/ChannelDerivationParameters.mjs';
205 import { Result_ChannelDerivationParametersDecodeErrorZ } from '../structs/Result_ChannelDerivationParametersDecodeErrorZ.mjs';
206 import { Result_HTLCDescriptorDecodeErrorZ } from '../structs/Result_HTLCDescriptorDecodeErrorZ.mjs';
207 import { Utxo } from '../structs/Utxo.mjs';
208 import { Option_TxOutZ } from '../structs/Option_TxOutZ.mjs';
209 import { Input } from '../structs/Input.mjs';
210 import { CoinSelection } from '../structs/CoinSelection.mjs';
211 import { Result_CoinSelectionNoneZ } from '../structs/Result_CoinSelectionNoneZ.mjs';
212 import { Result_CVec_UtxoZNoneZ } from '../structs/Result_CVec_UtxoZNoneZ.mjs';
213 import { TwoTuple_u64u16Z } from '../structs/TwoTuple_u64u16Z.mjs';
214 import { Option_C2Tuple_u64u16ZZ } from '../structs/Option_C2Tuple_u64u16ZZ.mjs';
215 import { Option_ChannelShutdownStateZ } from '../structs/Option_ChannelShutdownStateZ.mjs';
216 import { Result_ThirtyTwoBytesAPIErrorZ } from '../structs/Result_ThirtyTwoBytesAPIErrorZ.mjs';
217 import { RecentPaymentDetails } from '../structs/RecentPaymentDetails.mjs';
218 import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs';
219 import { Result_NonePaymentSendFailureZ } from '../structs/Result_NonePaymentSendFailureZ.mjs';
220 import { Result_NoneRetryableSendFailureZ } from '../structs/Result_NoneRetryableSendFailureZ.mjs';
221 import { Result_ThirtyTwoBytesPaymentSendFailureZ } from '../structs/Result_ThirtyTwoBytesPaymentSendFailureZ.mjs';
222 import { Result_ThirtyTwoBytesRetryableSendFailureZ } from '../structs/Result_ThirtyTwoBytesRetryableSendFailureZ.mjs';
223 import { TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ } from '../structs/TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ.mjs';
224 import { Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.mjs';
225 import { ProbeSendFailure } from '../structs/ProbeSendFailure.mjs';
226 import { Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ } from '../structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.mjs';
227 import { TwoTuple_ThirtyTwoBytesPublicKeyZ } from '../structs/TwoTuple_ThirtyTwoBytesPublicKeyZ.mjs';
228 import { Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.mjs';
229 import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs';
230 import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs';
231 import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs';
232 import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_ChannelCounterpartyDecodeErrorZ.mjs';
233 import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs';
234 import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs';
235 import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs';
236 import { Result_ChannelShutdownStateDecodeErrorZ } from '../structs/Result_ChannelShutdownStateDecodeErrorZ.mjs';
237 import { ChannelMonitor } from '../structs/ChannelMonitor.mjs';
238 import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs';
239 import { Watch, WatchInterface } from '../structs/Watch.mjs';
240 import { BroadcasterInterface, BroadcasterInterfaceInterface } from '../structs/BroadcasterInterface.mjs';
241 import { EntropySource, EntropySourceInterface } from '../structs/EntropySource.mjs';
242 import { UnsignedInvoiceRequest } from '../structs/UnsignedInvoiceRequest.mjs';
243 import { UnsignedBolt12Invoice } from '../structs/UnsignedBolt12Invoice.mjs';
244 import { UnsignedChannelUpdate } from '../structs/UnsignedChannelUpdate.mjs';
245 import { UnsignedNodeAnnouncement } from '../structs/UnsignedNodeAnnouncement.mjs';
246 import { UnsignedGossipMessage } from '../structs/UnsignedGossipMessage.mjs';
247 import { NodeSigner, NodeSignerInterface } from '../structs/NodeSigner.mjs';
248 import { SignerProvider, SignerProviderInterface } from '../structs/SignerProvider.mjs';
249 import { FeeEstimator, FeeEstimatorInterface } from '../structs/FeeEstimator.mjs';
250 import { Router, RouterInterface } from '../structs/Router.mjs';
251 import { ChannelManager } from '../structs/ChannelManager.mjs';
252 import { TwoTuple_ThirtyTwoBytesChannelManagerZ } from '../structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.mjs';
253 import { Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.mjs';
254 import { MaxDustHTLCExposure } from '../structs/MaxDustHTLCExposure.mjs';
255 import { Result_MaxDustHTLCExposureDecodeErrorZ } from '../structs/Result_MaxDustHTLCExposureDecodeErrorZ.mjs';
256 import { ChannelConfig } from '../structs/ChannelConfig.mjs';
257 import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs';
258 import { Option_MaxDustHTLCExposureZ } from '../structs/Option_MaxDustHTLCExposureZ.mjs';
259 import { Option_APIErrorZ } from '../structs/Option_APIErrorZ.mjs';
260 import { Result_COption_APIErrorZDecodeErrorZ } from '../structs/Result_COption_APIErrorZDecodeErrorZ.mjs';
261 import { Result_ChannelMonitorUpdateDecodeErrorZ } from '../structs/Result_ChannelMonitorUpdateDecodeErrorZ.mjs';
262 import { Option_MonitorEventZ } from '../structs/Option_MonitorEventZ.mjs';
263 import { Result_COption_MonitorEventZDecodeErrorZ } from '../structs/Result_COption_MonitorEventZDecodeErrorZ.mjs';
264 import { Result_HTLCUpdateDecodeErrorZ } from '../structs/Result_HTLCUpdateDecodeErrorZ.mjs';
265 import { TwoTuple_OutPointCVec_u8ZZ } from '../structs/TwoTuple_OutPointCVec_u8ZZ.mjs';
266 import { TwoTuple_u32CVec_u8ZZ } from '../structs/TwoTuple_u32CVec_u8ZZ.mjs';
267 import { TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ } from '../structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.mjs';
268 import { TwoTuple_u32TxOutZ } from '../structs/TwoTuple_u32TxOutZ.mjs';
269 import { TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ } from '../structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.mjs';
270 import { Balance } from '../structs/Balance.mjs';
271 import { TwoTuple_ThirtyTwoBytesChannelMonitorZ } from '../structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.mjs';
272 import { Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.mjs';
273 import { Type, TypeInterface } from '../structs/Type.mjs';
274 import { TwoTuple_PublicKeyTypeZ } from '../structs/TwoTuple_PublicKeyTypeZ.mjs';
275 import { InvoiceRequest } from '../structs/InvoiceRequest.mjs';
276 import { Bolt12Invoice } from '../structs/Bolt12Invoice.mjs';
277 import { InvoiceError } from '../structs/InvoiceError.mjs';
278 import { OffersMessage } from '../structs/OffersMessage.mjs';
279 import { Option_OffersMessageZ } from '../structs/Option_OffersMessageZ.mjs';
280 import { CustomOnionMessageContents, CustomOnionMessageContentsInterface } from '../structs/CustomOnionMessageContents.mjs';
281 import { Option_CustomOnionMessageContentsZ } from '../structs/Option_CustomOnionMessageContentsZ.mjs';
282 import { Result_COption_CustomOnionMessageContentsZDecodeErrorZ } from '../structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.mjs';
283 import { Option_TypeZ } from '../structs/Option_TypeZ.mjs';
284 import { Result_COption_TypeZDecodeErrorZ } from '../structs/Result_COption_TypeZDecodeErrorZ.mjs';
285 import { Option_SocketAddressZ } from '../structs/Option_SocketAddressZ.mjs';
286 import { TwoTuple_PublicKeyCOption_SocketAddressZZ } from '../structs/TwoTuple_PublicKeyCOption_SocketAddressZZ.mjs';
287 import { PeerHandleError } from '../structs/PeerHandleError.mjs';
288 import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs';
289 import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs';
290 import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs';
291 import { GraphSyncError } from '../structs/GraphSyncError.mjs';
292 import { Result_u32GraphSyncErrorZ } from '../structs/Result_u32GraphSyncErrorZ.mjs';
293 import { Result_CVec_u8ZIOErrorZ } from '../structs/Result_CVec_u8ZIOErrorZ.mjs';
294 import { Result_NoneIOErrorZ } from '../structs/Result_NoneIOErrorZ.mjs';
295 import { Result_CVec_StrZIOErrorZ } from '../structs/Result_CVec_StrZIOErrorZ.mjs';
296 import { Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ } from '../structs/Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.mjs';
297 import { Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.mjs';
298 import { Option_SecretKeyZ } from '../structs/Option_SecretKeyZ.mjs';
299 import { VerifiedInvoiceRequest } from '../structs/VerifiedInvoiceRequest.mjs';
300 import { Result_VerifiedInvoiceRequestNoneZ } from '../structs/Result_VerifiedInvoiceRequestNoneZ.mjs';
301 import { Option_i64Z } from '../structs/Option_i64Z.mjs';
302 import { Result_SocketAddressDecodeErrorZ } from '../structs/Result_SocketAddressDecodeErrorZ.mjs';
303 import { Result_SocketAddressSocketAddressParseErrorZ } from '../structs/Result_SocketAddressSocketAddressParseErrorZ.mjs';
304 import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs';
305 import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs';
306 import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs';
307 import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs';
308 import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs';
309 import { Result_AcceptChannelV2DecodeErrorZ } from '../structs/Result_AcceptChannelV2DecodeErrorZ.mjs';
310 import { Result_TxAddInputDecodeErrorZ } from '../structs/Result_TxAddInputDecodeErrorZ.mjs';
311 import { Result_TxAddOutputDecodeErrorZ } from '../structs/Result_TxAddOutputDecodeErrorZ.mjs';
312 import { Result_TxRemoveInputDecodeErrorZ } from '../structs/Result_TxRemoveInputDecodeErrorZ.mjs';
313 import { Result_TxRemoveOutputDecodeErrorZ } from '../structs/Result_TxRemoveOutputDecodeErrorZ.mjs';
314 import { Result_TxCompleteDecodeErrorZ } from '../structs/Result_TxCompleteDecodeErrorZ.mjs';
315 import { Result_TxSignaturesDecodeErrorZ } from '../structs/Result_TxSignaturesDecodeErrorZ.mjs';
316 import { Result_TxInitRbfDecodeErrorZ } from '../structs/Result_TxInitRbfDecodeErrorZ.mjs';
317 import { Result_TxAckRbfDecodeErrorZ } from '../structs/Result_TxAckRbfDecodeErrorZ.mjs';
318 import { Result_TxAbortDecodeErrorZ } from '../structs/Result_TxAbortDecodeErrorZ.mjs';
319 import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs';
320 import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs';
321 import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs';
322 import { ClosingSignedFeeRange } from '../structs/ClosingSignedFeeRange.mjs';
323 import { Result_ClosingSignedFeeRangeDecodeErrorZ } from '../structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mjs';
324 import { CommitmentSigned } from '../structs/CommitmentSigned.mjs';
325 import { Result_CommitmentSignedDecodeErrorZ } from '../structs/Result_CommitmentSignedDecodeErrorZ.mjs';
326 import { Result_FundingCreatedDecodeErrorZ } from '../structs/Result_FundingCreatedDecodeErrorZ.mjs';
327 import { Result_FundingSignedDecodeErrorZ } from '../structs/Result_FundingSignedDecodeErrorZ.mjs';
328 import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyDecodeErrorZ.mjs';
329 import { Init } from '../structs/Init.mjs';
330 import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs';
331 import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs';
332 import { Result_OpenChannelV2DecodeErrorZ } from '../structs/Result_OpenChannelV2DecodeErrorZ.mjs';
333 import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs';
334 import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
335 import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs';
336 import { Result_UpdateFailMalformedHTLCDecodeErrorZ } from '../structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mjs';
337 import { UpdateFee } from '../structs/UpdateFee.mjs';
338 import { Result_UpdateFeeDecodeErrorZ } from '../structs/Result_UpdateFeeDecodeErrorZ.mjs';
339 import { Result_UpdateFulfillHTLCDecodeErrorZ } from '../structs/Result_UpdateFulfillHTLCDecodeErrorZ.mjs';
340 import { Result_UpdateAddHTLCDecodeErrorZ } from '../structs/Result_UpdateAddHTLCDecodeErrorZ.mjs';
341 import { OnionMessage } from '../structs/OnionMessage.mjs';
342 import { Result_OnionMessageDecodeErrorZ } from '../structs/Result_OnionMessageDecodeErrorZ.mjs';
343 import { Ping } from '../structs/Ping.mjs';
344 import { Result_PingDecodeErrorZ } from '../structs/Result_PingDecodeErrorZ.mjs';
345 import { Pong } from '../structs/Pong.mjs';
346 import { Result_PongDecodeErrorZ } from '../structs/Result_PongDecodeErrorZ.mjs';
347 import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs';
348 import { Result_ChannelAnnouncementDecodeErrorZ } from '../structs/Result_ChannelAnnouncementDecodeErrorZ.mjs';
349 import { Result_UnsignedChannelUpdateDecodeErrorZ } from '../structs/Result_UnsignedChannelUpdateDecodeErrorZ.mjs';
350 import { Result_ChannelUpdateDecodeErrorZ } from '../structs/Result_ChannelUpdateDecodeErrorZ.mjs';
351 import { Result_ErrorMessageDecodeErrorZ } from '../structs/Result_ErrorMessageDecodeErrorZ.mjs';
352 import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs';
353 import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
354 import { Result_NodeAnnouncementDecodeErrorZ } from '../structs/Result_NodeAnnouncementDecodeErrorZ.mjs';
355 import { Result_QueryShortChannelIdsDecodeErrorZ } from '../structs/Result_QueryShortChannelIdsDecodeErrorZ.mjs';
356 import { ReplyShortChannelIdsEnd } from '../structs/ReplyShortChannelIdsEnd.mjs';
357 import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mjs';
358 import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs';
359 import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs';
360 import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs';
361 import { Bolt11Invoice } from '../structs/Bolt11Invoice.mjs';
362 import { SignOrCreationError } from '../structs/SignOrCreationError.mjs';
363 import { Result_Bolt11InvoiceSignOrCreationErrorZ } from '../structs/Result_Bolt11InvoiceSignOrCreationErrorZ.mjs';
364 import { Result_OffersMessageDecodeErrorZ } from '../structs/Result_OffersMessageDecodeErrorZ.mjs';
365 import { Option_HTLCClaimZ } from '../structs/Option_HTLCClaimZ.mjs';
366 import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs';
367 import { Result_CounterpartyCommitmentSecretsDecodeErrorZ } from '../structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.mjs';
368 import { TxCreationKeys } from '../structs/TxCreationKeys.mjs';
369 import { Result_TxCreationKeysDecodeErrorZ } from '../structs/Result_TxCreationKeysDecodeErrorZ.mjs';
370 import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelPublicKeysDecodeErrorZ.mjs';
371 import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs';
372 import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs';
373 import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs';
374 import { Result_ChannelTransactionParametersDecodeErrorZ } from '../structs/Result_ChannelTransactionParametersDecodeErrorZ.mjs';
375 import { Result_HolderCommitmentTransactionDecodeErrorZ } from '../structs/Result_HolderCommitmentTransactionDecodeErrorZ.mjs';
376 import { BuiltCommitmentTransaction } from '../structs/BuiltCommitmentTransaction.mjs';
377 import { Result_BuiltCommitmentTransactionDecodeErrorZ } from '../structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mjs';
378 import { TrustedClosingTransaction } from '../structs/TrustedClosingTransaction.mjs';
379 import { Result_TrustedClosingTransactionNoneZ } from '../structs/Result_TrustedClosingTransactionNoneZ.mjs';
380 import { Result_CommitmentTransactionDecodeErrorZ } from '../structs/Result_CommitmentTransactionDecodeErrorZ.mjs';
381 import { TrustedCommitmentTransaction } from '../structs/TrustedCommitmentTransaction.mjs';
382 import { Result_TrustedCommitmentTransactionNoneZ } from '../structs/Result_TrustedCommitmentTransactionNoneZ.mjs';
383 import { Result_CVec_ECDSASignatureZNoneZ } from '../structs/Result_CVec_ECDSASignatureZNoneZ.mjs';
384 import { Option_usizeZ } from '../structs/Option_usizeZ.mjs';
385 import { Result_ShutdownScriptDecodeErrorZ } from '../structs/Result_ShutdownScriptDecodeErrorZ.mjs';
386 import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs';
387 import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs';
388 import { PaymentPurpose } from '../structs/PaymentPurpose.mjs';
389 import { Result_PaymentPurposeDecodeErrorZ } from '../structs/Result_PaymentPurposeDecodeErrorZ.mjs';
390 import { ClaimedHTLC } from '../structs/ClaimedHTLC.mjs';
391 import { Result_ClaimedHTLCDecodeErrorZ } from '../structs/Result_ClaimedHTLCDecodeErrorZ.mjs';
392 import { PathFailure } from '../structs/PathFailure.mjs';
393 import { Option_PathFailureZ } from '../structs/Option_PathFailureZ.mjs';
394 import { Result_COption_PathFailureZDecodeErrorZ } from '../structs/Result_COption_PathFailureZDecodeErrorZ.mjs';
395 import { UntrustedString } from '../structs/UntrustedString.mjs';
396 import { ClosureReason } from '../structs/ClosureReason.mjs';
397 import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
398 import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
399 import { HTLCDestination } from '../structs/HTLCDestination.mjs';
400 import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs';
401 import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs';
402 import { Result_PaymentFailureReasonDecodeErrorZ } from '../structs/Result_PaymentFailureReasonDecodeErrorZ.mjs';
403 import { Option_U128Z } from '../structs/Option_U128Z.mjs';
404 import { Option_PaymentFailureReasonZ } from '../structs/Option_PaymentFailureReasonZ.mjs';
405 import { AnchorDescriptor } from '../structs/AnchorDescriptor.mjs';
406 import { BumpTransactionEvent } from '../structs/BumpTransactionEvent.mjs';
407 import { Option_EventZ } from '../structs/Option_EventZ.mjs';
408 import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs';
409 import { Bolt11ParseError } from '../structs/Bolt11ParseError.mjs';
410 import { Result_SiPrefixBolt11ParseErrorZ } from '../structs/Result_SiPrefixBolt11ParseErrorZ.mjs';
411 import { ParseOrSemanticError } from '../structs/ParseOrSemanticError.mjs';
412 import { Result_Bolt11InvoiceParseOrSemanticErrorZ } from '../structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.mjs';
413 import { SignedRawBolt11Invoice } from '../structs/SignedRawBolt11Invoice.mjs';
414 import { Result_SignedRawBolt11InvoiceBolt11ParseErrorZ } from '../structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.mjs';
415 import { RawBolt11Invoice } from '../structs/RawBolt11Invoice.mjs';
416 import { Bolt11InvoiceSignature } from '../structs/Bolt11InvoiceSignature.mjs';
417 import { ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ } from '../structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.mjs';
418 import { PayeePubKey } from '../structs/PayeePubKey.mjs';
419 import { Result_PayeePubKeySecp256k1ErrorZ } from '../structs/Result_PayeePubKeySecp256k1ErrorZ.mjs';
420 import { PrivateRoute } from '../structs/PrivateRoute.mjs';
421 import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs';
422 import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs';
423 import { Result_NoneBolt11SemanticErrorZ } from '../structs/Result_NoneBolt11SemanticErrorZ.mjs';
424 import { Result_Bolt11InvoiceBolt11SemanticErrorZ } from '../structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.mjs';
425 import { Description } from '../structs/Description.mjs';
426 import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs';
427 import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs';
428 import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs';
429 import { BigSize } from '../structs/BigSize.mjs';
430 import { Result_BigSizeDecodeErrorZ } from '../structs/Result_BigSizeDecodeErrorZ.mjs';
431 import { Result_HostnameDecodeErrorZ } from '../structs/Result_HostnameDecodeErrorZ.mjs';
432 import { TransactionU16LenLimited } from '../structs/TransactionU16LenLimited.mjs';
433 import { Result_TransactionU16LenLimitedNoneZ } from '../structs/Result_TransactionU16LenLimitedNoneZ.mjs';
434 import { Result_TransactionU16LenLimitedDecodeErrorZ } from '../structs/Result_TransactionU16LenLimitedDecodeErrorZ.mjs';
435 import { Result_UntrustedStringDecodeErrorZ } from '../structs/Result_UntrustedStringDecodeErrorZ.mjs';
436 import { ReceiveTlvs } from '../structs/ReceiveTlvs.mjs';
437 import { Result_ReceiveTlvsDecodeErrorZ } from '../structs/Result_ReceiveTlvsDecodeErrorZ.mjs';
438 import { PaymentRelay } from '../structs/PaymentRelay.mjs';
439 import { Result_PaymentRelayDecodeErrorZ } from '../structs/Result_PaymentRelayDecodeErrorZ.mjs';
440 import { PaymentConstraints } from '../structs/PaymentConstraints.mjs';
441 import { Result_PaymentConstraintsDecodeErrorZ } from '../structs/Result_PaymentConstraintsDecodeErrorZ.mjs';
442 import { PaymentError } from '../structs/PaymentError.mjs';
443 import { Result_ThirtyTwoBytesPaymentErrorZ } from '../structs/Result_ThirtyTwoBytesPaymentErrorZ.mjs';
444 import { Result_NonePaymentErrorZ } from '../structs/Result_NonePaymentErrorZ.mjs';
445 import { ProbingError } from '../structs/ProbingError.mjs';
446 import { Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ } from '../structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ.mjs';
447 import { Result_StrSecp256k1ErrorZ } from '../structs/Result_StrSecp256k1ErrorZ.mjs';
448 import { OnionMessagePath } from '../structs/OnionMessagePath.mjs';
449 import { Result_OnionMessagePathNoneZ } from '../structs/Result_OnionMessagePathNoneZ.mjs';
450 import { TwoTuple_PublicKeyOnionMessageZ } from '../structs/TwoTuple_PublicKeyOnionMessageZ.mjs';
451 import { SendError } from '../structs/SendError.mjs';
452 import { Result_C2Tuple_PublicKeyOnionMessageZSendErrorZ } from '../structs/Result_C2Tuple_PublicKeyOnionMessageZSendErrorZ.mjs';
453 import { Result_NoneSendErrorZ } from '../structs/Result_NoneSendErrorZ.mjs';
454 import { Result_BlindedPathNoneZ } from '../structs/Result_BlindedPathNoneZ.mjs';
455 import { Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ } from '../structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.mjs';
456 import { Result_BlindedPathDecodeErrorZ } from '../structs/Result_BlindedPathDecodeErrorZ.mjs';
457 import { Result_BlindedHopDecodeErrorZ } from '../structs/Result_BlindedHopDecodeErrorZ.mjs';
458 import { Result_InvoiceErrorDecodeErrorZ } from '../structs/Result_InvoiceErrorDecodeErrorZ.mjs';
459 import { WatchedOutput } from '../structs/WatchedOutput.mjs';
460 import { Filter, FilterInterface } from '../structs/Filter.mjs';
461 import { Option_FilterZ } from '../structs/Option_FilterZ.mjs';
462 import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs';
463 import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs';
464 import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs';
465 import { TwoTuple_OutPointCVec_MonitorUpdateIdZZ } from '../structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.mjs';
466 import { KVStore, KVStoreInterface } from '../structs/KVStore.mjs';
467 import { ChannelUsage } from '../structs/ChannelUsage.mjs';
468 import { ProbabilisticScoringFeeParameters } from '../structs/ProbabilisticScoringFeeParameters.mjs';
469 import { ScoreLookUp, ScoreLookUpInterface } from '../structs/ScoreLookUp.mjs';
470 import { ScoreUpdate, ScoreUpdateInterface } from '../structs/ScoreUpdate.mjs';
471 import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs';
472 import { WriteableScore, WriteableScoreInterface } from '../structs/WriteableScore.mjs';
473 import { Persister, PersisterInterface } from '../structs/Persister.mjs';
474 import { MonitorUpdatingPersister } from '../structs/MonitorUpdatingPersister.mjs';
475 import { Persist, PersistInterface } from '../structs/Persist.mjs';
476 import { PrintableString } from '../structs/PrintableString.mjs';
477 import { FutureCallback, FutureCallbackInterface } from '../structs/FutureCallback.mjs';
478 import { Future } from '../structs/Future.mjs';
479 import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs';
480 import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs';
481 import { ChannelConfigUpdate } from '../structs/ChannelConfigUpdate.mjs';
482 import { UserConfig } from '../structs/UserConfig.mjs';
483 import { BestBlock } from '../structs/BestBlock.mjs';
484 import { Listen, ListenInterface } from '../structs/Listen.mjs';
485 import { Confirm, ConfirmInterface } from '../structs/Confirm.mjs';
486 import { ChainMonitor } from '../structs/ChainMonitor.mjs';
487 import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs';
488 import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs';
489 import { FailureCode } from '../structs/FailureCode.mjs';
490 import { ChainParameters } from '../structs/ChainParameters.mjs';
491 import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs';
492 import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs';
493 import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs';
494 import { ExpandedKey } from '../structs/ExpandedKey.mjs';
495 import { Packet } from '../structs/Packet.mjs';
496 import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs';
497 import { OnionMessageProvider, OnionMessageProviderInterface } from '../structs/OnionMessageProvider.mjs';
498 import { OnionMessageHandler, OnionMessageHandlerInterface } from '../structs/OnionMessageHandler.mjs';
499 import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs';
500 import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs';
501 import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs';
502 import { OffersMessageHandler, OffersMessageHandlerInterface } from '../structs/OffersMessageHandler.mjs';
503 import { CustomOnionMessageHandler, CustomOnionMessageHandlerInterface } from '../structs/CustomOnionMessageHandler.mjs';
504 import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs';
505 import { MessageHandler } from '../structs/MessageHandler.mjs';
506 import { SocketDescriptor, SocketDescriptorInterface } from '../structs/SocketDescriptor.mjs';
507 import { PeerManager } from '../structs/PeerManager.mjs';
508 import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs';
509 import { OfferFeatures } from '../structs/OfferFeatures.mjs';
510 import { InvoiceRequestFeatures } from '../structs/InvoiceRequestFeatures.mjs';
511 import { Amount } from '../structs/Amount.mjs';
512 import { Quantity } from '../structs/Quantity.mjs';
513 import { TaggedHash } from '../structs/TaggedHash.mjs';
514 import { ErroneousField } from '../structs/ErroneousField.mjs';
515 import { P2PGossipSync } from '../structs/P2PGossipSync.mjs';
516 import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs';
517 import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs';
518 import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs';
519 import { DefaultRouter } from '../structs/DefaultRouter.mjs';
520 import { ScorerAccountingForInFlightHtlcs } from '../structs/ScorerAccountingForInFlightHtlcs.mjs';
521 import { Payee } from '../structs/Payee.mjs';
522 import { Score, ScoreInterface } from '../structs/Score.mjs';
523 import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs';
524 import { MultiThreadedScoreLockRead } from '../structs/MultiThreadedScoreLockRead.mjs';
525 import { MultiThreadedScoreLockWrite } from '../structs/MultiThreadedScoreLockWrite.mjs';
526 import { ProbabilisticScoringDecayParameters } from '../structs/ProbabilisticScoringDecayParameters.mjs';
527 import { KeysManager } from '../structs/KeysManager.mjs';
528 import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs';
529 import { Destination } from '../structs/Destination.mjs';
530 import { MessageRouter, MessageRouterInterface } from '../structs/MessageRouter.mjs';
531 import { OnionMessenger } from '../structs/OnionMessenger.mjs';
532 import { DefaultMessageRouter } from '../structs/DefaultMessageRouter.mjs';
533 import { OnionMessageContents } from '../structs/OnionMessageContents.mjs';
534 import { ForwardNode } from '../structs/ForwardNode.mjs';
535 import { ForwardTlvs } from '../structs/ForwardTlvs.mjs';
536 import { CoinSelectionSource, CoinSelectionSourceInterface } from '../structs/CoinSelectionSource.mjs';
537 import { WalletSource, WalletSourceInterface } from '../structs/WalletSource.mjs';
538 import { Wallet } from '../structs/Wallet.mjs';
539 import { BumpTransactionEventHandler } from '../structs/BumpTransactionEventHandler.mjs';
540 import { RapidGossipSync } from '../structs/RapidGossipSync.mjs';
541 import { GossipSync } from '../structs/GossipSync.mjs';
542 import { RawDataPart } from '../structs/RawDataPart.mjs';
543 import { Sha256 } from '../structs/Sha256.mjs';
544 import { ExpiryTime } from '../structs/ExpiryTime.mjs';
545 import { MinFinalCltvExpiryDelta } from '../structs/MinFinalCltvExpiryDelta.mjs';
546 import { Fallback } from '../structs/Fallback.mjs';
548 import { CommonBase, UInt5, WitnessVersion, UnqualifiedError } from './CommonBase.mjs';
549 import * as bindings from '../bindings.mjs'
552 * An Event which you should probably take some action in response to.
554 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
555 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
556 * written as it makes no sense to respond to it after reconnecting to peers).
558 export class Event extends CommonBase {
559 protected constructor(_dummy: null, ptr: bigint) { super(ptr, bindings.Event_free); }
561 public static constr_from_ptr(ptr: bigint): Event {
562 const raw_ty: number = bindings.LDKEvent_ty_from_ptr(ptr);
564 case 0: return new Event_FundingGenerationReady(ptr);
565 case 1: return new Event_PaymentClaimable(ptr);
566 case 2: return new Event_PaymentClaimed(ptr);
567 case 3: return new Event_PaymentSent(ptr);
568 case 4: return new Event_PaymentFailed(ptr);
569 case 5: return new Event_PaymentPathSuccessful(ptr);
570 case 6: return new Event_PaymentPathFailed(ptr);
571 case 7: return new Event_ProbeSuccessful(ptr);
572 case 8: return new Event_ProbeFailed(ptr);
573 case 9: return new Event_PendingHTLCsForwardable(ptr);
574 case 10: return new Event_HTLCIntercepted(ptr);
575 case 11: return new Event_SpendableOutputs(ptr);
576 case 12: return new Event_PaymentForwarded(ptr);
577 case 13: return new Event_ChannelPending(ptr);
578 case 14: return new Event_ChannelReady(ptr);
579 case 15: return new Event_ChannelClosed(ptr);
580 case 16: return new Event_DiscardFunding(ptr);
581 case 17: return new Event_OpenChannelRequest(ptr);
582 case 18: return new Event_HTLCHandlingFailed(ptr);
583 case 19: return new Event_BumpTransaction(ptr);
585 throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
589 public clone_ptr(): bigint {
590 const ret: bigint = bindings.Event_clone_ptr(this.ptr);
595 * Creates a copy of the Event
597 public clone(): Event {
598 const ret: bigint = bindings.Event_clone(this.ptr);
599 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
600 CommonBase.add_ref_from(ret_hu_conv, this);
605 * Utility method to constructs a new FundingGenerationReady-variant Event
607 public static constructor_funding_generation_ready(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, channel_value_satoshis: bigint, output_script: Uint8Array, user_channel_id: bigint): Event {
608 const ret: bigint = bindings.Event_funding_generation_ready(bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), channel_value_satoshis, bindings.encodeUint8Array(output_script), bindings.encodeUint128(user_channel_id));
609 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
610 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
615 * Utility method to constructs a new PaymentClaimable-variant Event
617 public static constructor_payment_claimable(receiver_node_id: Uint8Array, payment_hash: Uint8Array, onion_fields: RecipientOnionFields, amount_msat: bigint, counterparty_skimmed_fee_msat: bigint, purpose: PaymentPurpose, via_channel_id: Option_ThirtyTwoBytesZ, via_user_channel_id: Option_U128Z, claim_deadline: Option_u32Z): Event {
618 const ret: bigint = bindings.Event_payment_claimable(bindings.encodeUint8Array(bindings.check_arr_len(receiver_node_id, 33)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), onion_fields == null ? 0n : CommonBase.get_ptr_of(onion_fields), amount_msat, counterparty_skimmed_fee_msat, CommonBase.get_ptr_of(purpose), CommonBase.get_ptr_of(via_channel_id), CommonBase.get_ptr_of(via_user_channel_id), CommonBase.get_ptr_of(claim_deadline));
619 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
620 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
621 CommonBase.add_ref_from(ret_hu_conv, onion_fields);
622 CommonBase.add_ref_from(ret_hu_conv, purpose);
623 CommonBase.add_ref_from(ret_hu_conv, via_channel_id);
624 CommonBase.add_ref_from(ret_hu_conv, via_user_channel_id);
625 CommonBase.add_ref_from(ret_hu_conv, claim_deadline);
630 * Utility method to constructs a new PaymentClaimed-variant Event
632 public static constructor_payment_claimed(receiver_node_id: Uint8Array, payment_hash: Uint8Array, amount_msat: bigint, purpose: PaymentPurpose, htlcs: ClaimedHTLC[], sender_intended_total_msat: Option_u64Z): Event {
633 const ret: bigint = bindings.Event_payment_claimed(bindings.encodeUint8Array(bindings.check_arr_len(receiver_node_id, 33)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), amount_msat, CommonBase.get_ptr_of(purpose), bindings.encodeUint64Array(htlcs.map(htlcs_conv_13 => htlcs_conv_13 == null ? 0n : CommonBase.get_ptr_of(htlcs_conv_13))), CommonBase.get_ptr_of(sender_intended_total_msat));
634 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
635 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
636 CommonBase.add_ref_from(ret_hu_conv, purpose);
637 htlcs.forEach((htlcs_conv_13: ClaimedHTLC) => { CommonBase.add_ref_from(ret_hu_conv, htlcs_conv_13); });
638 CommonBase.add_ref_from(ret_hu_conv, sender_intended_total_msat);
643 * Utility method to constructs a new PaymentSent-variant Event
645 public static constructor_payment_sent(payment_id: Option_ThirtyTwoBytesZ, payment_preimage: Uint8Array, payment_hash: Uint8Array, fee_paid_msat: Option_u64Z): Event {
646 const ret: bigint = bindings.Event_payment_sent(CommonBase.get_ptr_of(payment_id), bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(fee_paid_msat));
647 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
648 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
649 CommonBase.add_ref_from(ret_hu_conv, payment_id);
650 CommonBase.add_ref_from(ret_hu_conv, fee_paid_msat);
655 * Utility method to constructs a new PaymentFailed-variant Event
657 public static constructor_payment_failed(payment_id: Uint8Array, payment_hash: Uint8Array, reason: Option_PaymentFailureReasonZ): Event {
658 const ret: bigint = bindings.Event_payment_failed(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(reason));
659 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
660 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
661 CommonBase.add_ref_from(ret_hu_conv, reason);
666 * Utility method to constructs a new PaymentPathSuccessful-variant Event
668 public static constructor_payment_path_successful(payment_id: Uint8Array, payment_hash: Option_ThirtyTwoBytesZ, path: Path): Event {
669 const ret: bigint = bindings.Event_payment_path_successful(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), CommonBase.get_ptr_of(payment_hash), path == null ? 0n : CommonBase.get_ptr_of(path));
670 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
671 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
672 CommonBase.add_ref_from(ret_hu_conv, payment_hash);
673 CommonBase.add_ref_from(ret_hu_conv, path);
678 * Utility method to constructs a new PaymentPathFailed-variant Event
680 public static constructor_payment_path_failed(payment_id: Option_ThirtyTwoBytesZ, payment_hash: Uint8Array, payment_failed_permanently: boolean, failure: PathFailure, path: Path, short_channel_id: Option_u64Z): Event {
681 const ret: bigint = bindings.Event_payment_path_failed(CommonBase.get_ptr_of(payment_id), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), payment_failed_permanently, CommonBase.get_ptr_of(failure), path == null ? 0n : CommonBase.get_ptr_of(path), CommonBase.get_ptr_of(short_channel_id));
682 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
683 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
684 CommonBase.add_ref_from(ret_hu_conv, payment_id);
685 CommonBase.add_ref_from(ret_hu_conv, failure);
686 CommonBase.add_ref_from(ret_hu_conv, path);
687 CommonBase.add_ref_from(ret_hu_conv, short_channel_id);
692 * Utility method to constructs a new ProbeSuccessful-variant Event
694 public static constructor_probe_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: Path): Event {
695 const ret: bigint = bindings.Event_probe_successful(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), path == null ? 0n : CommonBase.get_ptr_of(path));
696 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
697 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
698 CommonBase.add_ref_from(ret_hu_conv, path);
703 * Utility method to constructs a new ProbeFailed-variant Event
705 public static constructor_probe_failed(payment_id: Uint8Array, payment_hash: Uint8Array, path: Path, short_channel_id: Option_u64Z): Event {
706 const ret: bigint = bindings.Event_probe_failed(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), path == null ? 0n : CommonBase.get_ptr_of(path), CommonBase.get_ptr_of(short_channel_id));
707 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
708 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
709 CommonBase.add_ref_from(ret_hu_conv, path);
710 CommonBase.add_ref_from(ret_hu_conv, short_channel_id);
715 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
717 public static constructor_pending_htlcs_forwardable(time_forwardable: bigint): Event {
718 const ret: bigint = bindings.Event_pending_htlcs_forwardable(time_forwardable);
719 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
720 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
725 * Utility method to constructs a new HTLCIntercepted-variant Event
727 public static constructor_htlcintercepted(intercept_id: Uint8Array, requested_next_hop_scid: bigint, payment_hash: Uint8Array, inbound_amount_msat: bigint, expected_outbound_amount_msat: bigint): Event {
728 const ret: bigint = bindings.Event_htlcintercepted(bindings.encodeUint8Array(bindings.check_arr_len(intercept_id, 32)), requested_next_hop_scid, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), inbound_amount_msat, expected_outbound_amount_msat);
729 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
730 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
735 * Utility method to constructs a new SpendableOutputs-variant Event
737 public static constructor_spendable_outputs(outputs: SpendableOutputDescriptor[], channel_id: Option_ThirtyTwoBytesZ): Event {
738 const ret: bigint = bindings.Event_spendable_outputs(bindings.encodeUint64Array(outputs.map(outputs_conv_27 => CommonBase.get_ptr_of(outputs_conv_27))), CommonBase.get_ptr_of(channel_id));
739 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
740 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
741 outputs.forEach((outputs_conv_27: SpendableOutputDescriptor) => { CommonBase.add_ref_from(ret_hu_conv, outputs_conv_27); });
742 CommonBase.add_ref_from(ret_hu_conv, channel_id);
747 * Utility method to constructs a new PaymentForwarded-variant Event
749 public static constructor_payment_forwarded(prev_channel_id: Option_ThirtyTwoBytesZ, next_channel_id: Option_ThirtyTwoBytesZ, fee_earned_msat: Option_u64Z, claim_from_onchain_tx: boolean, outbound_amount_forwarded_msat: Option_u64Z): Event {
750 const ret: bigint = bindings.Event_payment_forwarded(CommonBase.get_ptr_of(prev_channel_id), CommonBase.get_ptr_of(next_channel_id), CommonBase.get_ptr_of(fee_earned_msat), claim_from_onchain_tx, CommonBase.get_ptr_of(outbound_amount_forwarded_msat));
751 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
752 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
753 CommonBase.add_ref_from(ret_hu_conv, prev_channel_id);
754 CommonBase.add_ref_from(ret_hu_conv, next_channel_id);
755 CommonBase.add_ref_from(ret_hu_conv, fee_earned_msat);
756 CommonBase.add_ref_from(ret_hu_conv, outbound_amount_forwarded_msat);
761 * Utility method to constructs a new ChannelPending-variant Event
763 public static constructor_channel_pending(channel_id: Uint8Array, user_channel_id: bigint, former_temporary_channel_id: Option_ThirtyTwoBytesZ, counterparty_node_id: Uint8Array, funding_txo: OutPoint): Event {
764 const ret: bigint = bindings.Event_channel_pending(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint128(user_channel_id), CommonBase.get_ptr_of(former_temporary_channel_id), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), funding_txo == null ? 0n : CommonBase.get_ptr_of(funding_txo));
765 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
766 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
767 CommonBase.add_ref_from(ret_hu_conv, former_temporary_channel_id);
768 CommonBase.add_ref_from(ret_hu_conv, funding_txo);
773 * Utility method to constructs a new ChannelReady-variant Event
775 public static constructor_channel_ready(channel_id: Uint8Array, user_channel_id: bigint, counterparty_node_id: Uint8Array, channel_type: ChannelTypeFeatures): Event {
776 const ret: bigint = bindings.Event_channel_ready(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint128(user_channel_id), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), channel_type == null ? 0n : CommonBase.get_ptr_of(channel_type));
777 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
778 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
779 CommonBase.add_ref_from(ret_hu_conv, channel_type);
784 * Utility method to constructs a new ChannelClosed-variant Event
786 public static constructor_channel_closed(channel_id: Uint8Array, user_channel_id: bigint, reason: ClosureReason, counterparty_node_id: Uint8Array, channel_capacity_sats: Option_u64Z): Event {
787 const ret: bigint = bindings.Event_channel_closed(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint128(user_channel_id), CommonBase.get_ptr_of(reason), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), CommonBase.get_ptr_of(channel_capacity_sats));
788 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
789 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
790 CommonBase.add_ref_from(ret_hu_conv, reason);
791 CommonBase.add_ref_from(ret_hu_conv, channel_capacity_sats);
796 * Utility method to constructs a new DiscardFunding-variant Event
798 public static constructor_discard_funding(channel_id: Uint8Array, transaction: Uint8Array): Event {
799 const ret: bigint = bindings.Event_discard_funding(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(transaction));
800 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
801 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
806 * Utility method to constructs a new OpenChannelRequest-variant Event
808 public static constructor_open_channel_request(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_satoshis: bigint, push_msat: bigint, channel_type: ChannelTypeFeatures): Event {
809 const ret: bigint = bindings.Event_open_channel_request(bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), funding_satoshis, push_msat, channel_type == null ? 0n : CommonBase.get_ptr_of(channel_type));
810 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
811 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
812 CommonBase.add_ref_from(ret_hu_conv, channel_type);
817 * Utility method to constructs a new HTLCHandlingFailed-variant Event
819 public static constructor_htlchandling_failed(prev_channel_id: Uint8Array, failed_next_destination: HTLCDestination): Event {
820 const ret: bigint = bindings.Event_htlchandling_failed(bindings.encodeUint8Array(bindings.check_arr_len(prev_channel_id, 32)), CommonBase.get_ptr_of(failed_next_destination));
821 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
822 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
823 CommonBase.add_ref_from(ret_hu_conv, failed_next_destination);
828 * Utility method to constructs a new BumpTransaction-variant Event
830 public static constructor_bump_transaction(a: BumpTransactionEvent): Event {
831 const ret: bigint = bindings.Event_bump_transaction(CommonBase.get_ptr_of(a));
832 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
833 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
834 CommonBase.add_ref_from(ret_hu_conv, a);
839 * Checks if two Events contain equal inner contents.
840 * This ignores pointers and is_owned flags and looks at the values in fields.
842 public eq(b: Event): boolean {
843 const ret: boolean = bindings.Event_eq(this.ptr, b == null ? 0n : CommonBase.get_ptr_of(b));
848 * Serialize the Event object into a byte array which can be read by Event_read
850 public write(): Uint8Array {
851 const ret: number = bindings.Event_write(this.ptr);
852 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
857 /** A Event of type FundingGenerationReady */
858 export class Event_FundingGenerationReady extends Event {
860 * The random channel_id we picked which you'll need to pass into
861 * [`ChannelManager::funding_transaction_generated`].
863 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
865 public temporary_channel_id: Uint8Array;
867 * The counterparty's node_id, which you'll need to pass back into
868 * [`ChannelManager::funding_transaction_generated`].
870 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
872 public counterparty_node_id: Uint8Array;
874 * The value, in satoshis, that the output should have.
876 public channel_value_satoshis: bigint;
878 * The script which should be used in the transaction output.
880 public output_script: Uint8Array;
882 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
883 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
884 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
885 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
886 * serialized with LDK versions prior to 0.0.113.
888 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
889 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
890 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
892 public user_channel_id: bigint;
894 public constructor(ptr: bigint) {
896 const temporary_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr);
897 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
898 this.temporary_channel_id = temporary_channel_id_conv;
899 const counterparty_node_id: number = bindings.LDKEvent_FundingGenerationReady_get_counterparty_node_id(ptr);
900 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
901 this.counterparty_node_id = counterparty_node_id_conv;
902 this.channel_value_satoshis = bindings.LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr);
903 const output_script: number = bindings.LDKEvent_FundingGenerationReady_get_output_script(ptr);
904 const output_script_conv: Uint8Array = bindings.decodeUint8Array(output_script);
905 this.output_script = output_script_conv;
906 const user_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_user_channel_id(ptr);
907 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
908 this.user_channel_id = user_channel_id_conv;
911 /** A Event of type PaymentClaimable */
912 export class Event_PaymentClaimable extends Event {
914 * The node that will receive the payment after it has been claimed.
915 * This is useful to identify payments received via [phantom nodes].
916 * This field will always be filled in when the event was generated by LDK versions
919 * [phantom nodes]: crate::sign::PhantomKeysManager
921 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
923 public receiver_node_id: Uint8Array;
925 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
926 * not stop you from registering duplicate payment hashes for inbound payments.
928 public payment_hash: Uint8Array;
930 * The fields in the onion which were received with each HTLC. Only fields which were
931 * identical in each HTLC involved in the payment will be included here.
933 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
935 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
937 public onion_fields: RecipientOnionFields;
939 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
940 * than the invoice amount.
942 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
943 * and the previous hop took an extra fee.
946 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
947 * field, you may lose money!
949 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
951 public amount_msat: bigint;
953 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
954 * taken by our channel counterparty.
956 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
958 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
960 public counterparty_skimmed_fee_msat: bigint;
962 * Information for claiming this received payment, based on whether the purpose of the
963 * payment is to pay an invoice or to send a spontaneous payment.
965 public purpose: PaymentPurpose;
967 * The `channel_id` indicating over which channel we received the payment.
969 public via_channel_id: Option_ThirtyTwoBytesZ;
971 * The `user_channel_id` indicating over which channel we received the payment.
973 public via_user_channel_id: Option_U128Z;
975 * The block height at which this payment will be failed back and will no longer be
976 * eligible for claiming.
978 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
979 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
981 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
983 public claim_deadline: Option_u32Z;
985 public constructor(ptr: bigint) {
987 const receiver_node_id: number = bindings.LDKEvent_PaymentClaimable_get_receiver_node_id(ptr);
988 const receiver_node_id_conv: Uint8Array = bindings.decodeUint8Array(receiver_node_id);
989 this.receiver_node_id = receiver_node_id_conv;
990 const payment_hash: number = bindings.LDKEvent_PaymentClaimable_get_payment_hash(ptr);
991 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
992 this.payment_hash = payment_hash_conv;
993 const onion_fields: bigint = bindings.LDKEvent_PaymentClaimable_get_onion_fields(ptr);
994 const onion_fields_hu_conv: RecipientOnionFields = new RecipientOnionFields(null, onion_fields);
995 CommonBase.add_ref_from(onion_fields_hu_conv, this);
996 this.onion_fields = onion_fields_hu_conv;
997 this.amount_msat = bindings.LDKEvent_PaymentClaimable_get_amount_msat(ptr);
998 this.counterparty_skimmed_fee_msat = bindings.LDKEvent_PaymentClaimable_get_counterparty_skimmed_fee_msat(ptr);
999 const purpose: bigint = bindings.LDKEvent_PaymentClaimable_get_purpose(ptr);
1000 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
1001 CommonBase.add_ref_from(purpose_hu_conv, this);
1002 this.purpose = purpose_hu_conv;
1003 const via_channel_id: bigint = bindings.LDKEvent_PaymentClaimable_get_via_channel_id(ptr);
1004 const via_channel_id_hu_conv: Option_ThirtyTwoBytesZ = Option_ThirtyTwoBytesZ.constr_from_ptr(via_channel_id);
1005 CommonBase.add_ref_from(via_channel_id_hu_conv, this);
1006 this.via_channel_id = via_channel_id_hu_conv;
1007 const via_user_channel_id: bigint = bindings.LDKEvent_PaymentClaimable_get_via_user_channel_id(ptr);
1008 const via_user_channel_id_hu_conv: Option_U128Z = Option_U128Z.constr_from_ptr(via_user_channel_id);
1009 CommonBase.add_ref_from(via_user_channel_id_hu_conv, this);
1010 this.via_user_channel_id = via_user_channel_id_hu_conv;
1011 const claim_deadline: bigint = bindings.LDKEvent_PaymentClaimable_get_claim_deadline(ptr);
1012 const claim_deadline_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(claim_deadline);
1013 CommonBase.add_ref_from(claim_deadline_hu_conv, this);
1014 this.claim_deadline = claim_deadline_hu_conv;
1017 /** A Event of type PaymentClaimed */
1018 export class Event_PaymentClaimed extends Event {
1020 * The node that received the payment.
1021 * This is useful to identify payments which were received via [phantom nodes].
1022 * This field will always be filled in when the event was generated by LDK versions
1023 * 0.0.113 and above.
1025 * [phantom nodes]: crate::sign::PhantomKeysManager
1027 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1029 public receiver_node_id: Uint8Array;
1031 * The payment hash of the claimed payment. Note that LDK will not stop you from
1032 * registering duplicate payment hashes for inbound payments.
1034 public payment_hash: Uint8Array;
1036 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
1039 public amount_msat: bigint;
1041 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
1042 * spontaneous payment.
1044 public purpose: PaymentPurpose;
1046 * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
1047 * to LDK version 0.0.117.
1049 public htlcs: ClaimedHTLC[];
1051 * The sender-intended sum total of all the MPP parts. This will be `None` for events
1052 * serialized prior to LDK version 0.0.117.
1054 public sender_intended_total_msat: Option_u64Z;
1056 public constructor(ptr: bigint) {
1058 const receiver_node_id: number = bindings.LDKEvent_PaymentClaimed_get_receiver_node_id(ptr);
1059 const receiver_node_id_conv: Uint8Array = bindings.decodeUint8Array(receiver_node_id);
1060 this.receiver_node_id = receiver_node_id_conv;
1061 const payment_hash: number = bindings.LDKEvent_PaymentClaimed_get_payment_hash(ptr);
1062 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1063 this.payment_hash = payment_hash_conv;
1064 this.amount_msat = bindings.LDKEvent_PaymentClaimed_get_amount_msat(ptr);
1065 const purpose: bigint = bindings.LDKEvent_PaymentClaimed_get_purpose(ptr);
1066 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
1067 CommonBase.add_ref_from(purpose_hu_conv, this);
1068 this.purpose = purpose_hu_conv;
1069 const htlcs: number = bindings.LDKEvent_PaymentClaimed_get_htlcs(ptr);
1070 const htlcs_conv_13_len: number = bindings.getArrayLength(htlcs);
1071 const htlcs_conv_13_arr: ClaimedHTLC[] = new Array(htlcs_conv_13_len).fill(null);
1072 for (var n = 0; n < htlcs_conv_13_len; n++) {
1073 const htlcs_conv_13: bigint = bindings.getU64ArrayElem(htlcs, n);
1074 const htlcs_conv_13_hu_conv: ClaimedHTLC = new ClaimedHTLC(null, htlcs_conv_13);
1075 CommonBase.add_ref_from(htlcs_conv_13_hu_conv, this);
1076 htlcs_conv_13_arr[n] = htlcs_conv_13_hu_conv;
1078 bindings.freeWasmMemory(htlcs)
1079 this.htlcs = htlcs_conv_13_arr;
1080 const sender_intended_total_msat: bigint = bindings.LDKEvent_PaymentClaimed_get_sender_intended_total_msat(ptr);
1081 const sender_intended_total_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(sender_intended_total_msat);
1082 CommonBase.add_ref_from(sender_intended_total_msat_hu_conv, this);
1083 this.sender_intended_total_msat = sender_intended_total_msat_hu_conv;
1086 /** A Event of type PaymentSent */
1087 export class Event_PaymentSent extends Event {
1089 * The `payment_id` passed to [`ChannelManager::send_payment`].
1091 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1093 public payment_id: Option_ThirtyTwoBytesZ;
1095 * The preimage to the hash given to ChannelManager::send_payment.
1096 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
1099 public payment_preimage: Uint8Array;
1101 * The hash that was given to [`ChannelManager::send_payment`].
1103 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1105 public payment_hash: Uint8Array;
1107 * The total fee which was spent at intermediate hops in this payment, across all paths.
1109 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
1110 * overpayment to the recipient node.
1112 * If the recipient or an intermediate node misbehaves and gives us free money, this may
1113 * overstate the amount paid, though this is unlikely.
1115 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
1117 public fee_paid_msat: Option_u64Z;
1119 public constructor(ptr: bigint) {
1121 const payment_id: bigint = bindings.LDKEvent_PaymentSent_get_payment_id(ptr);
1122 const payment_id_hu_conv: Option_ThirtyTwoBytesZ = Option_ThirtyTwoBytesZ.constr_from_ptr(payment_id);
1123 CommonBase.add_ref_from(payment_id_hu_conv, this);
1124 this.payment_id = payment_id_hu_conv;
1125 const payment_preimage: number = bindings.LDKEvent_PaymentSent_get_payment_preimage(ptr);
1126 const payment_preimage_conv: Uint8Array = bindings.decodeUint8Array(payment_preimage);
1127 this.payment_preimage = payment_preimage_conv;
1128 const payment_hash: number = bindings.LDKEvent_PaymentSent_get_payment_hash(ptr);
1129 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1130 this.payment_hash = payment_hash_conv;
1131 const fee_paid_msat: bigint = bindings.LDKEvent_PaymentSent_get_fee_paid_msat(ptr);
1132 const fee_paid_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_paid_msat);
1133 CommonBase.add_ref_from(fee_paid_msat_hu_conv, this);
1134 this.fee_paid_msat = fee_paid_msat_hu_conv;
1137 /** A Event of type PaymentFailed */
1138 export class Event_PaymentFailed extends Event {
1140 * The `payment_id` passed to [`ChannelManager::send_payment`].
1142 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1144 public payment_id: Uint8Array;
1146 * The hash that was given to [`ChannelManager::send_payment`].
1148 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1150 public payment_hash: Uint8Array;
1152 * The reason the payment failed. This is only `None` for events generated or serialized
1153 * by versions prior to 0.0.115.
1155 public reason: Option_PaymentFailureReasonZ;
1157 public constructor(ptr: bigint) {
1159 const payment_id: number = bindings.LDKEvent_PaymentFailed_get_payment_id(ptr);
1160 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1161 this.payment_id = payment_id_conv;
1162 const payment_hash: number = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr);
1163 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1164 this.payment_hash = payment_hash_conv;
1165 const reason: bigint = bindings.LDKEvent_PaymentFailed_get_reason(ptr);
1166 const reason_hu_conv: Option_PaymentFailureReasonZ = Option_PaymentFailureReasonZ.constr_from_ptr(reason);
1167 CommonBase.add_ref_from(reason_hu_conv, this);
1168 this.reason = reason_hu_conv;
1171 /** A Event of type PaymentPathSuccessful */
1172 export class Event_PaymentPathSuccessful extends Event {
1174 * The `payment_id` passed to [`ChannelManager::send_payment`].
1176 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1178 public payment_id: Uint8Array;
1180 * The hash that was given to [`ChannelManager::send_payment`].
1182 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
1184 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1186 public payment_hash: Option_ThirtyTwoBytesZ;
1188 * The payment path that was successful.
1190 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
1194 public constructor(ptr: bigint) {
1196 const payment_id: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_id(ptr);
1197 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1198 this.payment_id = payment_id_conv;
1199 const payment_hash: bigint = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr);
1200 const payment_hash_hu_conv: Option_ThirtyTwoBytesZ = Option_ThirtyTwoBytesZ.constr_from_ptr(payment_hash);
1201 CommonBase.add_ref_from(payment_hash_hu_conv, this);
1202 this.payment_hash = payment_hash_hu_conv;
1203 const path: bigint = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr);
1204 const path_hu_conv: Path = new Path(null, path);
1205 CommonBase.add_ref_from(path_hu_conv, this);
1206 this.path = path_hu_conv;
1209 /** A Event of type PaymentPathFailed */
1210 export class Event_PaymentPathFailed extends Event {
1212 * The `payment_id` passed to [`ChannelManager::send_payment`].
1214 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
1216 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1217 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
1219 public payment_id: Option_ThirtyTwoBytesZ;
1221 * The hash that was given to [`ChannelManager::send_payment`].
1223 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1225 public payment_hash: Uint8Array;
1227 * Indicates the payment was rejected for some reason by the recipient. This implies that
1228 * the payment has failed, not just the route in question. If this is not set, the payment may
1229 * be retried via a different route.
1231 public payment_failed_permanently: boolean;
1233 * Extra error details based on the failure type. May contain an update that needs to be
1234 * applied to the [`NetworkGraph`].
1236 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
1238 public failure: PathFailure;
1240 * The payment path that failed.
1244 * The channel responsible for the failed payment path.
1246 * Note that for route hints or for the first hop in a path this may be an SCID alias and
1247 * may not refer to a channel in the public network graph. These aliases may also collide
1248 * with channels in the public network graph.
1250 * If this is `Some`, then the corresponding channel should be avoided when the payment is
1251 * retried. May be `None` for older [`Event`] serializations.
1253 public short_channel_id: Option_u64Z;
1255 public constructor(ptr: bigint) {
1257 const payment_id: bigint = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr);
1258 const payment_id_hu_conv: Option_ThirtyTwoBytesZ = Option_ThirtyTwoBytesZ.constr_from_ptr(payment_id);
1259 CommonBase.add_ref_from(payment_id_hu_conv, this);
1260 this.payment_id = payment_id_hu_conv;
1261 const payment_hash: number = bindings.LDKEvent_PaymentPathFailed_get_payment_hash(ptr);
1262 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1263 this.payment_hash = payment_hash_conv;
1264 this.payment_failed_permanently = bindings.LDKEvent_PaymentPathFailed_get_payment_failed_permanently(ptr);
1265 const failure: bigint = bindings.LDKEvent_PaymentPathFailed_get_failure(ptr);
1266 const failure_hu_conv: PathFailure = PathFailure.constr_from_ptr(failure);
1267 CommonBase.add_ref_from(failure_hu_conv, this);
1268 this.failure = failure_hu_conv;
1269 const path: bigint = bindings.LDKEvent_PaymentPathFailed_get_path(ptr);
1270 const path_hu_conv: Path = new Path(null, path);
1271 CommonBase.add_ref_from(path_hu_conv, this);
1272 this.path = path_hu_conv;
1273 const short_channel_id: bigint = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr);
1274 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1275 CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1276 this.short_channel_id = short_channel_id_hu_conv;
1279 /** A Event of type ProbeSuccessful */
1280 export class Event_ProbeSuccessful extends Event {
1282 * The id returned by [`ChannelManager::send_probe`].
1284 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1286 public payment_id: Uint8Array;
1288 * The hash generated by [`ChannelManager::send_probe`].
1290 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1292 public payment_hash: Uint8Array;
1294 * The payment path that was successful.
1298 public constructor(ptr: bigint) {
1300 const payment_id: number = bindings.LDKEvent_ProbeSuccessful_get_payment_id(ptr);
1301 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1302 this.payment_id = payment_id_conv;
1303 const payment_hash: number = bindings.LDKEvent_ProbeSuccessful_get_payment_hash(ptr);
1304 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1305 this.payment_hash = payment_hash_conv;
1306 const path: bigint = bindings.LDKEvent_ProbeSuccessful_get_path(ptr);
1307 const path_hu_conv: Path = new Path(null, path);
1308 CommonBase.add_ref_from(path_hu_conv, this);
1309 this.path = path_hu_conv;
1312 /** A Event of type ProbeFailed */
1313 export class Event_ProbeFailed extends Event {
1315 * The id returned by [`ChannelManager::send_probe`].
1317 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1319 public payment_id: Uint8Array;
1321 * The hash generated by [`ChannelManager::send_probe`].
1323 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1325 public payment_hash: Uint8Array;
1327 * The payment path that failed.
1331 * The channel responsible for the failed probe.
1333 * Note that for route hints or for the first hop in a path this may be an SCID alias and
1334 * may not refer to a channel in the public network graph. These aliases may also collide
1335 * with channels in the public network graph.
1337 public short_channel_id: Option_u64Z;
1339 public constructor(ptr: bigint) {
1341 const payment_id: number = bindings.LDKEvent_ProbeFailed_get_payment_id(ptr);
1342 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1343 this.payment_id = payment_id_conv;
1344 const payment_hash: number = bindings.LDKEvent_ProbeFailed_get_payment_hash(ptr);
1345 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1346 this.payment_hash = payment_hash_conv;
1347 const path: bigint = bindings.LDKEvent_ProbeFailed_get_path(ptr);
1348 const path_hu_conv: Path = new Path(null, path);
1349 CommonBase.add_ref_from(path_hu_conv, this);
1350 this.path = path_hu_conv;
1351 const short_channel_id: bigint = bindings.LDKEvent_ProbeFailed_get_short_channel_id(ptr);
1352 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1353 CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1354 this.short_channel_id = short_channel_id_hu_conv;
1357 /** A Event of type PendingHTLCsForwardable */
1358 export class Event_PendingHTLCsForwardable extends Event {
1360 * The minimum amount of time that should be waited prior to calling
1361 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1362 * you should wait a random amount of time in roughly the range (now + time_forwardable,
1363 * now + 5*time_forwardable).
1365 public time_forwardable: bigint;
1367 public constructor(ptr: bigint) {
1369 this.time_forwardable = bindings.LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr);
1372 /** A Event of type HTLCIntercepted */
1373 export class Event_HTLCIntercepted extends Event {
1375 * An id to help LDK identify which HTLC is being forwarded or failed.
1377 public intercept_id: Uint8Array;
1379 * The fake scid that was programmed as the next hop's scid, generated using
1380 * [`ChannelManager::get_intercept_scid`].
1382 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
1384 public requested_next_hop_scid: bigint;
1386 * The payment hash used for this HTLC.
1388 public payment_hash: Uint8Array;
1390 * How many msats were received on the inbound edge of this HTLC.
1392 public inbound_amount_msat: bigint;
1394 * How many msats the payer intended to route to the next node. Depending on the reason you are
1395 * intercepting this payment, you might take a fee by forwarding less than this amount.
1396 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
1398 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
1399 * check that whatever fee you want has been included here or subtract it as required. Further,
1400 * LDK will not stop you from forwarding more than you received.
1402 public expected_outbound_amount_msat: bigint;
1404 public constructor(ptr: bigint) {
1406 const intercept_id: number = bindings.LDKEvent_HTLCIntercepted_get_intercept_id(ptr);
1407 const intercept_id_conv: Uint8Array = bindings.decodeUint8Array(intercept_id);
1408 this.intercept_id = intercept_id_conv;
1409 this.requested_next_hop_scid = bindings.LDKEvent_HTLCIntercepted_get_requested_next_hop_scid(ptr);
1410 const payment_hash: number = bindings.LDKEvent_HTLCIntercepted_get_payment_hash(ptr);
1411 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1412 this.payment_hash = payment_hash_conv;
1413 this.inbound_amount_msat = bindings.LDKEvent_HTLCIntercepted_get_inbound_amount_msat(ptr);
1414 this.expected_outbound_amount_msat = bindings.LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat(ptr);
1417 /** A Event of type SpendableOutputs */
1418 export class Event_SpendableOutputs extends Event {
1420 * The outputs which you should store as spendable by you.
1422 public outputs: SpendableOutputDescriptor[];
1424 * The `channel_id` indicating which channel the spendable outputs belong to.
1426 * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
1428 public channel_id: Option_ThirtyTwoBytesZ;
1430 public constructor(ptr: bigint) {
1432 const outputs: number = bindings.LDKEvent_SpendableOutputs_get_outputs(ptr);
1433 const outputs_conv_27_len: number = bindings.getArrayLength(outputs);
1434 const outputs_conv_27_arr: SpendableOutputDescriptor[] = new Array(outputs_conv_27_len).fill(null);
1435 for (var b = 0; b < outputs_conv_27_len; b++) {
1436 const outputs_conv_27: bigint = bindings.getU64ArrayElem(outputs, b);
1437 const outputs_conv_27_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
1438 CommonBase.add_ref_from(outputs_conv_27_hu_conv, this);
1439 outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
1441 bindings.freeWasmMemory(outputs)
1442 this.outputs = outputs_conv_27_arr;
1443 const channel_id: bigint = bindings.LDKEvent_SpendableOutputs_get_channel_id(ptr);
1444 const channel_id_hu_conv: Option_ThirtyTwoBytesZ = Option_ThirtyTwoBytesZ.constr_from_ptr(channel_id);
1445 CommonBase.add_ref_from(channel_id_hu_conv, this);
1446 this.channel_id = channel_id_hu_conv;
1449 /** A Event of type PaymentForwarded */
1450 export class Event_PaymentForwarded extends Event {
1452 * The incoming channel between the previous node and us. This is only `None` for events
1453 * generated or serialized by versions prior to 0.0.107.
1455 public prev_channel_id: Option_ThirtyTwoBytesZ;
1457 * The outgoing channel between the next node and us. This is only `None` for events
1458 * generated or serialized by versions prior to 0.0.107.
1460 public next_channel_id: Option_ThirtyTwoBytesZ;
1462 * The fee, in milli-satoshis, which was earned as a result of the payment.
1464 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
1465 * was pending, the amount the next hop claimed will have been rounded down to the nearest
1466 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
1467 * claimed the full value in millisatoshis from the source. In this case,
1468 * `claim_from_onchain_tx` will be set.
1470 * If the channel which sent us the payment has been force-closed, we will claim the funds
1471 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
1472 * fees which we will spend and will instead set this to `None`. It is possible duplicate
1473 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
1476 public fee_earned_msat: Option_u64Z;
1478 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
1481 public claim_from_onchain_tx: boolean;
1483 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
1485 * The caveat described above the `fee_earned_msat` field applies here as well.
1487 public outbound_amount_forwarded_msat: Option_u64Z;
1489 public constructor(ptr: bigint) {
1491 const prev_channel_id: bigint = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr);
1492 const prev_channel_id_hu_conv: Option_ThirtyTwoBytesZ = Option_ThirtyTwoBytesZ.constr_from_ptr(prev_channel_id);
1493 CommonBase.add_ref_from(prev_channel_id_hu_conv, this);
1494 this.prev_channel_id = prev_channel_id_hu_conv;
1495 const next_channel_id: bigint = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr);
1496 const next_channel_id_hu_conv: Option_ThirtyTwoBytesZ = Option_ThirtyTwoBytesZ.constr_from_ptr(next_channel_id);
1497 CommonBase.add_ref_from(next_channel_id_hu_conv, this);
1498 this.next_channel_id = next_channel_id_hu_conv;
1499 const fee_earned_msat: bigint = bindings.LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr);
1500 const fee_earned_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_earned_msat);
1501 CommonBase.add_ref_from(fee_earned_msat_hu_conv, this);
1502 this.fee_earned_msat = fee_earned_msat_hu_conv;
1503 this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr);
1504 const outbound_amount_forwarded_msat: bigint = bindings.LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(ptr);
1505 const outbound_amount_forwarded_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(outbound_amount_forwarded_msat);
1506 CommonBase.add_ref_from(outbound_amount_forwarded_msat_hu_conv, this);
1507 this.outbound_amount_forwarded_msat = outbound_amount_forwarded_msat_hu_conv;
1510 /** A Event of type ChannelPending */
1511 export class Event_ChannelPending extends Event {
1513 * The `channel_id` of the channel that is pending confirmation.
1515 public channel_id: Uint8Array;
1517 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1518 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1519 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1520 * `user_channel_id` will be randomized for an inbound channel.
1522 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1523 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1524 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1526 public user_channel_id: bigint;
1528 * The `temporary_channel_id` this channel used to be known by during channel establishment.
1530 * Will be `None` for channels created prior to LDK version 0.0.115.
1532 public former_temporary_channel_id: Option_ThirtyTwoBytesZ;
1534 * The `node_id` of the channel counterparty.
1536 public counterparty_node_id: Uint8Array;
1538 * The outpoint of the channel's funding transaction.
1540 public funding_txo: OutPoint;
1542 public constructor(ptr: bigint) {
1544 const channel_id: number = bindings.LDKEvent_ChannelPending_get_channel_id(ptr);
1545 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1546 this.channel_id = channel_id_conv;
1547 const user_channel_id: number = bindings.LDKEvent_ChannelPending_get_user_channel_id(ptr);
1548 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1549 this.user_channel_id = user_channel_id_conv;
1550 const former_temporary_channel_id: bigint = bindings.LDKEvent_ChannelPending_get_former_temporary_channel_id(ptr);
1551 const former_temporary_channel_id_hu_conv: Option_ThirtyTwoBytesZ = Option_ThirtyTwoBytesZ.constr_from_ptr(former_temporary_channel_id);
1552 CommonBase.add_ref_from(former_temporary_channel_id_hu_conv, this);
1553 this.former_temporary_channel_id = former_temporary_channel_id_hu_conv;
1554 const counterparty_node_id: number = bindings.LDKEvent_ChannelPending_get_counterparty_node_id(ptr);
1555 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1556 this.counterparty_node_id = counterparty_node_id_conv;
1557 const funding_txo: bigint = bindings.LDKEvent_ChannelPending_get_funding_txo(ptr);
1558 const funding_txo_hu_conv: OutPoint = new OutPoint(null, funding_txo);
1559 CommonBase.add_ref_from(funding_txo_hu_conv, this);
1560 this.funding_txo = funding_txo_hu_conv;
1563 /** A Event of type ChannelReady */
1564 export class Event_ChannelReady extends Event {
1566 * The `channel_id` of the channel that is ready.
1568 public channel_id: Uint8Array;
1570 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1571 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1572 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1573 * `user_channel_id` will be randomized for an inbound channel.
1575 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1576 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1577 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1579 public user_channel_id: bigint;
1581 * The `node_id` of the channel counterparty.
1583 public counterparty_node_id: Uint8Array;
1585 * The features that this channel will operate with.
1587 public channel_type: ChannelTypeFeatures;
1589 public constructor(ptr: bigint) {
1591 const channel_id: number = bindings.LDKEvent_ChannelReady_get_channel_id(ptr);
1592 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1593 this.channel_id = channel_id_conv;
1594 const user_channel_id: number = bindings.LDKEvent_ChannelReady_get_user_channel_id(ptr);
1595 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1596 this.user_channel_id = user_channel_id_conv;
1597 const counterparty_node_id: number = bindings.LDKEvent_ChannelReady_get_counterparty_node_id(ptr);
1598 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1599 this.counterparty_node_id = counterparty_node_id_conv;
1600 const channel_type: bigint = bindings.LDKEvent_ChannelReady_get_channel_type(ptr);
1601 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1602 CommonBase.add_ref_from(channel_type_hu_conv, this);
1603 this.channel_type = channel_type_hu_conv;
1606 /** A Event of type ChannelClosed */
1607 export class Event_ChannelClosed extends Event {
1609 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
1610 * resolving the channel are likely still awaiting confirmation.
1612 public channel_id: Uint8Array;
1614 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1615 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1616 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1617 * `user_channel_id` will be randomized for inbound channels.
1618 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
1619 * zero for objects serialized with LDK versions prior to 0.0.102.
1621 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1622 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1623 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1625 public user_channel_id: bigint;
1627 * The reason the channel was closed.
1629 public reason: ClosureReason;
1631 * Counterparty in the closed channel.
1633 * This field will be `None` for objects serialized prior to LDK 0.0.117.
1635 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1637 public counterparty_node_id: Uint8Array;
1639 * Channel capacity of the closing channel (sats).
1641 * This field will be `None` for objects serialized prior to LDK 0.0.117.
1643 public channel_capacity_sats: Option_u64Z;
1645 public constructor(ptr: bigint) {
1647 const channel_id: number = bindings.LDKEvent_ChannelClosed_get_channel_id(ptr);
1648 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1649 this.channel_id = channel_id_conv;
1650 const user_channel_id: number = bindings.LDKEvent_ChannelClosed_get_user_channel_id(ptr);
1651 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1652 this.user_channel_id = user_channel_id_conv;
1653 const reason: bigint = bindings.LDKEvent_ChannelClosed_get_reason(ptr);
1654 const reason_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(reason);
1655 CommonBase.add_ref_from(reason_hu_conv, this);
1656 this.reason = reason_hu_conv;
1657 const counterparty_node_id: number = bindings.LDKEvent_ChannelClosed_get_counterparty_node_id(ptr);
1658 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1659 this.counterparty_node_id = counterparty_node_id_conv;
1660 const channel_capacity_sats: bigint = bindings.LDKEvent_ChannelClosed_get_channel_capacity_sats(ptr);
1661 const channel_capacity_sats_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(channel_capacity_sats);
1662 CommonBase.add_ref_from(channel_capacity_sats_hu_conv, this);
1663 this.channel_capacity_sats = channel_capacity_sats_hu_conv;
1666 /** A Event of type DiscardFunding */
1667 export class Event_DiscardFunding extends Event {
1669 * The channel_id of the channel which has been closed.
1671 public channel_id: Uint8Array;
1673 * The full transaction received from the user
1675 public transaction: Uint8Array;
1677 public constructor(ptr: bigint) {
1679 const channel_id: number = bindings.LDKEvent_DiscardFunding_get_channel_id(ptr);
1680 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1681 this.channel_id = channel_id_conv;
1682 const transaction: number = bindings.LDKEvent_DiscardFunding_get_transaction(ptr);
1683 const transaction_conv: Uint8Array = bindings.decodeUint8Array(transaction);
1684 this.transaction = transaction_conv;
1687 /** A Event of type OpenChannelRequest */
1688 export class Event_OpenChannelRequest extends Event {
1690 * The temporary channel ID of the channel requested to be opened.
1692 * When responding to the request, the `temporary_channel_id` should be passed
1693 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
1694 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
1696 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1697 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1699 public temporary_channel_id: Uint8Array;
1701 * The node_id of the counterparty requesting to open the channel.
1703 * When responding to the request, the `counterparty_node_id` should be passed
1704 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
1705 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
1708 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1709 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1711 public counterparty_node_id: Uint8Array;
1713 * The channel value of the requested channel.
1715 public funding_satoshis: bigint;
1717 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
1719 public push_msat: bigint;
1721 * The features that this channel will operate with. If you reject the channel, a
1722 * well-behaved counterparty may automatically re-attempt the channel with a new set of
1725 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
1726 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1729 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
1730 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1731 * 0.0.107. Channels setting this type also need to get manually accepted via
1732 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
1733 * or will be rejected otherwise.
1735 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1737 public channel_type: ChannelTypeFeatures;
1739 public constructor(ptr: bigint) {
1741 const temporary_channel_id: number = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr);
1742 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
1743 this.temporary_channel_id = temporary_channel_id_conv;
1744 const counterparty_node_id: number = bindings.LDKEvent_OpenChannelRequest_get_counterparty_node_id(ptr);
1745 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1746 this.counterparty_node_id = counterparty_node_id_conv;
1747 this.funding_satoshis = bindings.LDKEvent_OpenChannelRequest_get_funding_satoshis(ptr);
1748 this.push_msat = bindings.LDKEvent_OpenChannelRequest_get_push_msat(ptr);
1749 const channel_type: bigint = bindings.LDKEvent_OpenChannelRequest_get_channel_type(ptr);
1750 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1751 CommonBase.add_ref_from(channel_type_hu_conv, this);
1752 this.channel_type = channel_type_hu_conv;
1755 /** A Event of type HTLCHandlingFailed */
1756 export class Event_HTLCHandlingFailed extends Event {
1758 * The channel over which the HTLC was received.
1760 public prev_channel_id: Uint8Array;
1762 * Destination of the HTLC that failed to be processed.
1764 public failed_next_destination: HTLCDestination;
1766 public constructor(ptr: bigint) {
1768 const prev_channel_id: number = bindings.LDKEvent_HTLCHandlingFailed_get_prev_channel_id(ptr);
1769 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1770 this.prev_channel_id = prev_channel_id_conv;
1771 const failed_next_destination: bigint = bindings.LDKEvent_HTLCHandlingFailed_get_failed_next_destination(ptr);
1772 const failed_next_destination_hu_conv: HTLCDestination = HTLCDestination.constr_from_ptr(failed_next_destination);
1773 CommonBase.add_ref_from(failed_next_destination_hu_conv, this);
1774 this.failed_next_destination = failed_next_destination_hu_conv;
1777 /** A Event of type BumpTransaction */
1778 export class Event_BumpTransaction extends Event {
1779 public bump_transaction: BumpTransactionEvent;
1781 public constructor(ptr: bigint) {
1783 const bump_transaction: bigint = bindings.LDKEvent_BumpTransaction_get_bump_transaction(ptr);
1784 const bump_transaction_hu_conv: BumpTransactionEvent = BumpTransactionEvent.constr_from_ptr(bump_transaction);
1785 CommonBase.add_ref_from(bump_transaction_hu_conv, this);
1786 this.bump_transaction = bump_transaction_hu_conv;