b612b9d65ea814a6a623a70465fb654b74ae1e19
[ldk-java] / ts / structs / Event.mts
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 { FailureCode } from '../enums/FailureCode.mjs';
13 import { HTLCClaim } from '../enums/HTLCClaim.mjs';
14 import { IOError } from '../enums/IOError.mjs';
15 import { Level } from '../enums/Level.mjs';
16 import { Network } from '../enums/Network.mjs';
17 import { PaymentFailureReason } from '../enums/PaymentFailureReason.mjs';
18 import { Recipient } from '../enums/Recipient.mjs';
19 import { RetryableSendFailure } from '../enums/RetryableSendFailure.mjs';
20 import { Secp256k1Error } from '../enums/Secp256k1Error.mjs';
21 import { SiPrefix } from '../enums/SiPrefix.mjs';
22 import { UtxoLookupError } from '../enums/UtxoLookupError.mjs';
23 import { Bech32Error } from '../structs/Bech32Error.mjs';
24 import { Option_DurationZ } from '../structs/Option_DurationZ.mjs';
25 import { BlindedPath } from '../structs/BlindedPath.mjs';
26 import { Option_u64Z } from '../structs/Option_u64Z.mjs';
27 import { Refund } from '../structs/Refund.mjs';
28 import { Bolt12ParseError } from '../structs/Bolt12ParseError.mjs';
29 import { Result_RefundBolt12ParseErrorZ } from '../structs/Result_RefundBolt12ParseErrorZ.mjs';
30 import { ShutdownScript } from '../structs/ShutdownScript.mjs';
31 import { APIError } from '../structs/APIError.mjs';
32 import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs';
33 import { Option_PaymentSecretZ } from '../structs/Option_PaymentSecretZ.mjs';
34 import { Option_CVec_u8ZZ } from '../structs/Option_CVec_u8ZZ.mjs';
35 import { RecipientOnionFields } from '../structs/RecipientOnionFields.mjs';
36 import { DecodeError } from '../structs/DecodeError.mjs';
37 import { Result_RecipientOnionFieldsDecodeErrorZ } from '../structs/Result_RecipientOnionFieldsDecodeErrorZ.mjs';
38 import { InvoiceRequest } from '../structs/InvoiceRequest.mjs';
39 import { Bolt12Invoice } from '../structs/Bolt12Invoice.mjs';
40 import { InvoiceError } from '../structs/InvoiceError.mjs';
41 import { OffersMessage } from '../structs/OffersMessage.mjs';
42 import { Option_OffersMessageZ } from '../structs/Option_OffersMessageZ.mjs';
43 import { Result_OffersMessageDecodeErrorZ } from '../structs/Result_OffersMessageDecodeErrorZ.mjs';
44 import { Option_HTLCClaimZ } from '../structs/Option_HTLCClaimZ.mjs';
45 import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs';
46 import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs';
47 import { Result_CounterpartyCommitmentSecretsDecodeErrorZ } from '../structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.mjs';
48 import { TxCreationKeys } from '../structs/TxCreationKeys.mjs';
49 import { Result_TxCreationKeysDecodeErrorZ } from '../structs/Result_TxCreationKeysDecodeErrorZ.mjs';
50 import { ChannelPublicKeys } from '../structs/ChannelPublicKeys.mjs';
51 import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelPublicKeysDecodeErrorZ.mjs';
52 import { Option_u32Z } from '../structs/Option_u32Z.mjs';
53 import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs';
54 import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs';
55 import { Option_PaymentPreimageZ } from '../structs/Option_PaymentPreimageZ.mjs';
56 import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs';
57 import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs';
58 import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs';
59 import { Result_ChannelTransactionParametersDecodeErrorZ } from '../structs/Result_ChannelTransactionParametersDecodeErrorZ.mjs';
60 import { HolderCommitmentTransaction } from '../structs/HolderCommitmentTransaction.mjs';
61 import { Result_HolderCommitmentTransactionDecodeErrorZ } from '../structs/Result_HolderCommitmentTransactionDecodeErrorZ.mjs';
62 import { BuiltCommitmentTransaction } from '../structs/BuiltCommitmentTransaction.mjs';
63 import { Result_BuiltCommitmentTransactionDecodeErrorZ } from '../structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mjs';
64 import { TrustedClosingTransaction } from '../structs/TrustedClosingTransaction.mjs';
65 import { Result_TrustedClosingTransactionNoneZ } from '../structs/Result_TrustedClosingTransactionNoneZ.mjs';
66 import { CommitmentTransaction } from '../structs/CommitmentTransaction.mjs';
67 import { Result_CommitmentTransactionDecodeErrorZ } from '../structs/Result_CommitmentTransactionDecodeErrorZ.mjs';
68 import { TrustedCommitmentTransaction } from '../structs/TrustedCommitmentTransaction.mjs';
69 import { Result_TrustedCommitmentTransactionNoneZ } from '../structs/Result_TrustedCommitmentTransactionNoneZ.mjs';
70 import { Result_CVec_SignatureZNoneZ } from '../structs/Result_CVec_SignatureZNoneZ.mjs';
71 import { Result_ShutdownScriptDecodeErrorZ } from '../structs/Result_ShutdownScriptDecodeErrorZ.mjs';
72 import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs';
73 import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs';
74 import { BlindedPayInfo } from '../structs/BlindedPayInfo.mjs';
75 import { Result_BlindedPayInfoDecodeErrorZ } from '../structs/Result_BlindedPayInfoDecodeErrorZ.mjs';
76 import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs';
77 import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs';
78 import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs';
79 import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs';
80 import { OutPoint } from '../structs/OutPoint.mjs';
81 import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs';
82 import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs';
83 import { Option_PackedLockTimeZ } from '../structs/Option_PackedLockTimeZ.mjs';
84 import { TwoTuple_PartiallySignedTransactionusizeZ } from '../structs/TwoTuple_PartiallySignedTransactionusizeZ.mjs';
85 import { Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ } from '../structs/Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.mjs';
86 import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs';
87 import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs';
88 import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs';
89 import { Result_PublicKeyNoneZ } from '../structs/Result_PublicKeyNoneZ.mjs';
90 import { Option_ScalarZ } from '../structs/Option_ScalarZ.mjs';
91 import { Result_SharedSecretNoneZ } from '../structs/Result_SharedSecretNoneZ.mjs';
92 import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs';
93 import { HTLCDescriptor } from '../structs/HTLCDescriptor.mjs';
94 import { ClosingTransaction } from '../structs/ClosingTransaction.mjs';
95 import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs';
96 import { ChannelSigner, ChannelSignerInterface } from '../structs/ChannelSigner.mjs';
97 import { EcdsaChannelSigner, EcdsaChannelSignerInterface } from '../structs/EcdsaChannelSigner.mjs';
98 import { WriteableEcdsaChannelSigner, WriteableEcdsaChannelSignerInterface } from '../structs/WriteableEcdsaChannelSigner.mjs';
99 import { Result_WriteableEcdsaChannelSignerDecodeErrorZ } from '../structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mjs';
100 import { Result_ScriptNoneZ } from '../structs/Result_ScriptNoneZ.mjs';
101 import { Result_ShutdownScriptNoneZ } from '../structs/Result_ShutdownScriptNoneZ.mjs';
102 import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs';
103 import { InMemorySigner } from '../structs/InMemorySigner.mjs';
104 import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs';
105 import { Result_PartiallySignedTransactionNoneZ } from '../structs/Result_PartiallySignedTransactionNoneZ.mjs';
106 import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs';
107 import { ChannelDetails } from '../structs/ChannelDetails.mjs';
108 import { Route } from '../structs/Route.mjs';
109 import { LightningError } from '../structs/LightningError.mjs';
110 import { Result_RouteLightningErrorZ } from '../structs/Result_RouteLightningErrorZ.mjs';
111 import { InFlightHtlcs } from '../structs/InFlightHtlcs.mjs';
112 import { Result_InFlightHtlcsDecodeErrorZ } from '../structs/Result_InFlightHtlcsDecodeErrorZ.mjs';
113 import { RouteHop } from '../structs/RouteHop.mjs';
114 import { Result_RouteHopDecodeErrorZ } from '../structs/Result_RouteHopDecodeErrorZ.mjs';
115 import { BlindedHop } from '../structs/BlindedHop.mjs';
116 import { BlindedTail } from '../structs/BlindedTail.mjs';
117 import { Result_BlindedTailDecodeErrorZ } from '../structs/Result_BlindedTailDecodeErrorZ.mjs';
118 import { Path } from '../structs/Path.mjs';
119 import { Result_RouteDecodeErrorZ } from '../structs/Result_RouteDecodeErrorZ.mjs';
120 import { RouteParameters } from '../structs/RouteParameters.mjs';
121 import { Result_RouteParametersDecodeErrorZ } from '../structs/Result_RouteParametersDecodeErrorZ.mjs';
122 import { PaymentParameters } from '../structs/PaymentParameters.mjs';
123 import { Result_PaymentParametersDecodeErrorZ } from '../structs/Result_PaymentParametersDecodeErrorZ.mjs';
124 import { TwoTuple_BlindedPayInfoBlindedPathZ } from '../structs/TwoTuple_BlindedPayInfoBlindedPathZ.mjs';
125 import { RouteHint } from '../structs/RouteHint.mjs';
126 import { RouteHintHop } from '../structs/RouteHintHop.mjs';
127 import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs';
128 import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs';
129 import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs';
130 import { Option_BlockHashZ } from '../structs/Option_BlockHashZ.mjs';
131 import { TwoTuple_TxidCOption_BlockHashZZ } from '../structs/TwoTuple_TxidCOption_BlockHashZZ.mjs';
132 import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
133 import { MonitorEvent } from '../structs/MonitorEvent.mjs';
134 import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs';
135 import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
136 import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
137 import { NodeId } from '../structs/NodeId.mjs';
138 import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs';
139 import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs';
140 import { TwoTuple_Z } from '../structs/TwoTuple_Z.mjs';
141 import { TwoTuple__u168_u168Z } from '../structs/TwoTuple__u168_u168Z.mjs';
142 import { Option_C2Tuple_EightU16sEightU16sZZ } from '../structs/Option_C2Tuple_EightU16sEightU16sZZ.mjs';
143 import { Record } from '../structs/Record.mjs';
144 import { Logger, LoggerInterface } from '../structs/Logger.mjs';
145 import { NetworkGraph } from '../structs/NetworkGraph.mjs';
146 import { ProbabilisticScorer } from '../structs/ProbabilisticScorer.mjs';
147 import { Result_ProbabilisticScorerDecodeErrorZ } from '../structs/Result_ProbabilisticScorerDecodeErrorZ.mjs';
148 import { InitFeatures } from '../structs/InitFeatures.mjs';
149 import { Result_InitFeaturesDecodeErrorZ } from '../structs/Result_InitFeaturesDecodeErrorZ.mjs';
150 import { ChannelFeatures } from '../structs/ChannelFeatures.mjs';
151 import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs';
152 import { NodeFeatures } from '../structs/NodeFeatures.mjs';
153 import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs';
154 import { Bolt11InvoiceFeatures } from '../structs/Bolt11InvoiceFeatures.mjs';
155 import { Result_Bolt11InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.mjs';
156 import { Bolt12InvoiceFeatures } from '../structs/Bolt12InvoiceFeatures.mjs';
157 import { Result_Bolt12InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.mjs';
158 import { BlindedHopFeatures } from '../structs/BlindedHopFeatures.mjs';
159 import { Result_BlindedHopFeaturesDecodeErrorZ } from '../structs/Result_BlindedHopFeaturesDecodeErrorZ.mjs';
160 import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs';
161 import { Result_ChannelTypeFeaturesDecodeErrorZ } from '../structs/Result_ChannelTypeFeaturesDecodeErrorZ.mjs';
162 import { PaymentPurpose } from '../structs/PaymentPurpose.mjs';
163 import { Result_PaymentPurposeDecodeErrorZ } from '../structs/Result_PaymentPurposeDecodeErrorZ.mjs';
164 import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
165 import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
166 import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
167 import { PathFailure } from '../structs/PathFailure.mjs';
168 import { Option_PathFailureZ } from '../structs/Option_PathFailureZ.mjs';
169 import { Result_COption_PathFailureZDecodeErrorZ } from '../structs/Result_COption_PathFailureZDecodeErrorZ.mjs';
170 import { UntrustedString } from '../structs/UntrustedString.mjs';
171 import { ClosureReason } from '../structs/ClosureReason.mjs';
172 import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
173 import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
174 import { HTLCDestination } from '../structs/HTLCDestination.mjs';
175 import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs';
176 import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs';
177 import { Result_PaymentFailureReasonDecodeErrorZ } from '../structs/Result_PaymentFailureReasonDecodeErrorZ.mjs';
178 import { Option_u128Z } from '../structs/Option_u128Z.mjs';
179 import { Option_PaymentIdZ } from '../structs/Option_PaymentIdZ.mjs';
180 import { Option_PaymentFailureReasonZ } from '../structs/Option_PaymentFailureReasonZ.mjs';
181 import { Option_PaymentHashZ } from '../structs/Option_PaymentHashZ.mjs';
182 import { AnchorDescriptor } from '../structs/AnchorDescriptor.mjs';
183 import { BumpTransactionEvent } from '../structs/BumpTransactionEvent.mjs';
184 import { Option_EventZ } from '../structs/Option_EventZ.mjs';
185 import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs';
186 import { AcceptChannel } from '../structs/AcceptChannel.mjs';
187 import { AcceptChannelV2 } from '../structs/AcceptChannelV2.mjs';
188 import { OpenChannel } from '../structs/OpenChannel.mjs';
189 import { OpenChannelV2 } from '../structs/OpenChannelV2.mjs';
190 import { FundingCreated } from '../structs/FundingCreated.mjs';
191 import { FundingSigned } from '../structs/FundingSigned.mjs';
192 import { TxAddInput } from '../structs/TxAddInput.mjs';
193 import { TxAddOutput } from '../structs/TxAddOutput.mjs';
194 import { TxRemoveInput } from '../structs/TxRemoveInput.mjs';
195 import { TxRemoveOutput } from '../structs/TxRemoveOutput.mjs';
196 import { TxComplete } from '../structs/TxComplete.mjs';
197 import { TxSignatures } from '../structs/TxSignatures.mjs';
198 import { TxInitRbf } from '../structs/TxInitRbf.mjs';
199 import { TxAckRbf } from '../structs/TxAckRbf.mjs';
200 import { ChannelReady } from '../structs/ChannelReady.mjs';
201 import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs';
202 import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs';
203 import { RevokeAndACK } from '../structs/RevokeAndACK.mjs';
204 import { ClosingSigned } from '../structs/ClosingSigned.mjs';
205 import { Shutdown } from '../structs/Shutdown.mjs';
206 import { ChannelReestablish } from '../structs/ChannelReestablish.mjs';
207 import { ChannelAnnouncement } from '../structs/ChannelAnnouncement.mjs';
208 import { NodeAnnouncement } from '../structs/NodeAnnouncement.mjs';
209 import { ErrorMessage } from '../structs/ErrorMessage.mjs';
210 import { WarningMessage } from '../structs/WarningMessage.mjs';
211 import { ErrorAction } from '../structs/ErrorAction.mjs';
212 import { QueryChannelRange } from '../structs/QueryChannelRange.mjs';
213 import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs';
214 import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs';
215 import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs';
216 import { MessageSendEvent } from '../structs/MessageSendEvent.mjs';
217 import { Offer } from '../structs/Offer.mjs';
218 import { Result_OfferBolt12ParseErrorZ } from '../structs/Result_OfferBolt12ParseErrorZ.mjs';
219 import { Result_PublicKeyErrorZ } from '../structs/Result_PublicKeyErrorZ.mjs';
220 import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs';
221 import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs';
222 import { Result_TxOutUtxoLookupErrorZ } from '../structs/Result_TxOutUtxoLookupErrorZ.mjs';
223 import { UtxoFuture } from '../structs/UtxoFuture.mjs';
224 import { UtxoResult } from '../structs/UtxoResult.mjs';
225 import { UtxoLookup, UtxoLookupInterface } from '../structs/UtxoLookup.mjs';
226 import { Option_UtxoLookupZ } from '../structs/Option_UtxoLookupZ.mjs';
227 import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs';
228 import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs';
229 import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs';
230 import { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ } from '../structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.mjs';
231 import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs';
232 import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs';
233 import { ChannelInfo } from '../structs/ChannelInfo.mjs';
234 import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
235 import { RoutingFees } from '../structs/RoutingFees.mjs';
236 import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
237 import { Hostname } from '../structs/Hostname.mjs';
238 import { NetAddress } from '../structs/NetAddress.mjs';
239 import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
240 import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
241 import { NodeAlias } from '../structs/NodeAlias.mjs';
242 import { Result_NodeAliasDecodeErrorZ } from '../structs/Result_NodeAliasDecodeErrorZ.mjs';
243 import { NodeInfo } from '../structs/NodeInfo.mjs';
244 import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs';
245 import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs';
246 import { Option_CVec_NetAddressZZ } from '../structs/Option_CVec_NetAddressZZ.mjs';
247 import { Utxo } from '../structs/Utxo.mjs';
248 import { Option_TxOutZ } from '../structs/Option_TxOutZ.mjs';
249 import { Input } from '../structs/Input.mjs';
250 import { CoinSelection } from '../structs/CoinSelection.mjs';
251 import { Result_CoinSelectionNoneZ } from '../structs/Result_CoinSelectionNoneZ.mjs';
252 import { Result_CVec_UtxoZNoneZ } from '../structs/Result_CVec_UtxoZNoneZ.mjs';
253 import { Option_u16Z } from '../structs/Option_u16Z.mjs';
254 import { Option_ChannelShutdownStateZ } from '../structs/Option_ChannelShutdownStateZ.mjs';
255 import { Result__u832APIErrorZ } from '../structs/Result__u832APIErrorZ.mjs';
256 import { RecentPaymentDetails } from '../structs/RecentPaymentDetails.mjs';
257 import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs';
258 import { Result_NonePaymentSendFailureZ } from '../structs/Result_NonePaymentSendFailureZ.mjs';
259 import { Result_NoneRetryableSendFailureZ } from '../structs/Result_NoneRetryableSendFailureZ.mjs';
260 import { Result_PaymentHashPaymentSendFailureZ } from '../structs/Result_PaymentHashPaymentSendFailureZ.mjs';
261 import { Result_PaymentHashRetryableSendFailureZ } from '../structs/Result_PaymentHashRetryableSendFailureZ.mjs';
262 import { TwoTuple_PaymentHashPaymentIdZ } from '../structs/TwoTuple_PaymentHashPaymentIdZ.mjs';
263 import { Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ } from '../structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mjs';
264 import { TwoTuple_PaymentHashPaymentSecretZ } from '../structs/TwoTuple_PaymentHashPaymentSecretZ.mjs';
265 import { Result_C2Tuple_PaymentHashPaymentSecretZNoneZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mjs';
266 import { Result_PaymentSecretNoneZ } from '../structs/Result_PaymentSecretNoneZ.mjs';
267 import { Result_PaymentPreimageAPIErrorZ } from '../structs/Result_PaymentPreimageAPIErrorZ.mjs';
268 import { Option_CVec_ChainHashZZ } from '../structs/Option_CVec_ChainHashZZ.mjs';
269 import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs';
270 import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs';
271 import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs';
272 import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_ChannelCounterpartyDecodeErrorZ.mjs';
273 import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs';
274 import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs';
275 import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs';
276 import { Result_ChannelShutdownStateDecodeErrorZ } from '../structs/Result_ChannelShutdownStateDecodeErrorZ.mjs';
277 import { ChannelMonitor } from '../structs/ChannelMonitor.mjs';
278 import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs';
279 import { Watch, WatchInterface } from '../structs/Watch.mjs';
280 import { BroadcasterInterface, BroadcasterInterfaceInterface } from '../structs/BroadcasterInterface.mjs';
281 import { EntropySource, EntropySourceInterface } from '../structs/EntropySource.mjs';
282 import { UnsignedChannelUpdate } from '../structs/UnsignedChannelUpdate.mjs';
283 import { UnsignedNodeAnnouncement } from '../structs/UnsignedNodeAnnouncement.mjs';
284 import { UnsignedGossipMessage } from '../structs/UnsignedGossipMessage.mjs';
285 import { NodeSigner, NodeSignerInterface } from '../structs/NodeSigner.mjs';
286 import { SignerProvider, SignerProviderInterface } from '../structs/SignerProvider.mjs';
287 import { FeeEstimator, FeeEstimatorInterface } from '../structs/FeeEstimator.mjs';
288 import { Router, RouterInterface } from '../structs/Router.mjs';
289 import { ChannelManager } from '../structs/ChannelManager.mjs';
290 import { TwoTuple_BlockHashChannelManagerZ } from '../structs/TwoTuple_BlockHashChannelManagerZ.mjs';
291 import { Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mjs';
292 import { MaxDustHTLCExposure } from '../structs/MaxDustHTLCExposure.mjs';
293 import { Result_MaxDustHTLCExposureDecodeErrorZ } from '../structs/Result_MaxDustHTLCExposureDecodeErrorZ.mjs';
294 import { ChannelConfig } from '../structs/ChannelConfig.mjs';
295 import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs';
296 import { Option_MaxDustHTLCExposureZ } from '../structs/Option_MaxDustHTLCExposureZ.mjs';
297 import { Option_APIErrorZ } from '../structs/Option_APIErrorZ.mjs';
298 import { Result_COption_APIErrorZDecodeErrorZ } from '../structs/Result_COption_APIErrorZDecodeErrorZ.mjs';
299 import { BigSize } from '../structs/BigSize.mjs';
300 import { Result_BigSizeDecodeErrorZ } from '../structs/Result_BigSizeDecodeErrorZ.mjs';
301 import { Result_HostnameDecodeErrorZ } from '../structs/Result_HostnameDecodeErrorZ.mjs';
302 import { TransactionU16LenLimited } from '../structs/TransactionU16LenLimited.mjs';
303 import { Result_TransactionU16LenLimitedNoneZ } from '../structs/Result_TransactionU16LenLimitedNoneZ.mjs';
304 import { Result_TransactionU16LenLimitedDecodeErrorZ } from '../structs/Result_TransactionU16LenLimitedDecodeErrorZ.mjs';
305 import { Result_UntrustedStringDecodeErrorZ } from '../structs/Result_UntrustedStringDecodeErrorZ.mjs';
306 import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs';
307 import { Type, TypeInterface } from '../structs/Type.mjs';
308 import { Option_TypeZ } from '../structs/Option_TypeZ.mjs';
309 import { Result_COption_TypeZDecodeErrorZ } from '../structs/Result_COption_TypeZDecodeErrorZ.mjs';
310 import { PaymentError } from '../structs/PaymentError.mjs';
311 import { Result_PaymentIdPaymentErrorZ } from '../structs/Result_PaymentIdPaymentErrorZ.mjs';
312 import { Result_NonePaymentErrorZ } from '../structs/Result_NonePaymentErrorZ.mjs';
313 import { Result_StringErrorZ } from '../structs/Result_StringErrorZ.mjs';
314 import { Result_ChannelMonitorUpdateDecodeErrorZ } from '../structs/Result_ChannelMonitorUpdateDecodeErrorZ.mjs';
315 import { Option_MonitorEventZ } from '../structs/Option_MonitorEventZ.mjs';
316 import { Result_COption_MonitorEventZDecodeErrorZ } from '../structs/Result_COption_MonitorEventZDecodeErrorZ.mjs';
317 import { Result_HTLCUpdateDecodeErrorZ } from '../structs/Result_HTLCUpdateDecodeErrorZ.mjs';
318 import { TwoTuple_OutPointScriptZ } from '../structs/TwoTuple_OutPointScriptZ.mjs';
319 import { TwoTuple_u32ScriptZ } from '../structs/TwoTuple_u32ScriptZ.mjs';
320 import { TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mjs';
321 import { TwoTuple_u32TxOutZ } from '../structs/TwoTuple_u32TxOutZ.mjs';
322 import { TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mjs';
323 import { Balance } from '../structs/Balance.mjs';
324 import { TwoTuple_BlockHashChannelMonitorZ } from '../structs/TwoTuple_BlockHashChannelMonitorZ.mjs';
325 import { Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mjs';
326 import { TwoTuple_PublicKeyTypeZ } from '../structs/TwoTuple_PublicKeyTypeZ.mjs';
327 import { CustomOnionMessageContents, CustomOnionMessageContentsInterface } from '../structs/CustomOnionMessageContents.mjs';
328 import { Option_CustomOnionMessageContentsZ } from '../structs/Option_CustomOnionMessageContentsZ.mjs';
329 import { Result_COption_CustomOnionMessageContentsZDecodeErrorZ } from '../structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.mjs';
330 import { Option_NetAddressZ } from '../structs/Option_NetAddressZ.mjs';
331 import { TwoTuple_PublicKeyCOption_NetAddressZZ } from '../structs/TwoTuple_PublicKeyCOption_NetAddressZZ.mjs';
332 import { PeerHandleError } from '../structs/PeerHandleError.mjs';
333 import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs';
334 import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs';
335 import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs';
336 import { OnionMessagePath } from '../structs/OnionMessagePath.mjs';
337 import { Result_OnionMessagePathNoneZ } from '../structs/Result_OnionMessagePathNoneZ.mjs';
338 import { SendError } from '../structs/SendError.mjs';
339 import { Result_NoneSendErrorZ } from '../structs/Result_NoneSendErrorZ.mjs';
340 import { Result_BlindedPathNoneZ } from '../structs/Result_BlindedPathNoneZ.mjs';
341 import { Result_BlindedPathDecodeErrorZ } from '../structs/Result_BlindedPathDecodeErrorZ.mjs';
342 import { Result_BlindedHopDecodeErrorZ } from '../structs/Result_BlindedHopDecodeErrorZ.mjs';
343 import { GraphSyncError } from '../structs/GraphSyncError.mjs';
344 import { Result_u32GraphSyncErrorZ } from '../structs/Result_u32GraphSyncErrorZ.mjs';
345 import { Result_NoneErrorZ } from '../structs/Result_NoneErrorZ.mjs';
346 import { Option_ScriptZ } from '../structs/Option_ScriptZ.mjs';
347 import { Option_i64Z } from '../structs/Option_i64Z.mjs';
348 import { Option_TxidZ } from '../structs/Option_TxidZ.mjs';
349 import { Result_NetAddressDecodeErrorZ } from '../structs/Result_NetAddressDecodeErrorZ.mjs';
350 import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs';
351 import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs';
352 import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs';
353 import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs';
354 import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs';
355 import { Result_AcceptChannelV2DecodeErrorZ } from '../structs/Result_AcceptChannelV2DecodeErrorZ.mjs';
356 import { Result_TxAddInputDecodeErrorZ } from '../structs/Result_TxAddInputDecodeErrorZ.mjs';
357 import { Result_TxAddOutputDecodeErrorZ } from '../structs/Result_TxAddOutputDecodeErrorZ.mjs';
358 import { Result_TxRemoveInputDecodeErrorZ } from '../structs/Result_TxRemoveInputDecodeErrorZ.mjs';
359 import { Result_TxRemoveOutputDecodeErrorZ } from '../structs/Result_TxRemoveOutputDecodeErrorZ.mjs';
360 import { Result_TxCompleteDecodeErrorZ } from '../structs/Result_TxCompleteDecodeErrorZ.mjs';
361 import { Result_TxSignaturesDecodeErrorZ } from '../structs/Result_TxSignaturesDecodeErrorZ.mjs';
362 import { Result_TxInitRbfDecodeErrorZ } from '../structs/Result_TxInitRbfDecodeErrorZ.mjs';
363 import { Result_TxAckRbfDecodeErrorZ } from '../structs/Result_TxAckRbfDecodeErrorZ.mjs';
364 import { TxAbort } from '../structs/TxAbort.mjs';
365 import { Result_TxAbortDecodeErrorZ } from '../structs/Result_TxAbortDecodeErrorZ.mjs';
366 import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs';
367 import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs';
368 import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs';
369 import { ClosingSignedFeeRange } from '../structs/ClosingSignedFeeRange.mjs';
370 import { Result_ClosingSignedFeeRangeDecodeErrorZ } from '../structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mjs';
371 import { CommitmentSigned } from '../structs/CommitmentSigned.mjs';
372 import { Result_CommitmentSignedDecodeErrorZ } from '../structs/Result_CommitmentSignedDecodeErrorZ.mjs';
373 import { Result_FundingCreatedDecodeErrorZ } from '../structs/Result_FundingCreatedDecodeErrorZ.mjs';
374 import { Result_FundingSignedDecodeErrorZ } from '../structs/Result_FundingSignedDecodeErrorZ.mjs';
375 import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyDecodeErrorZ.mjs';
376 import { Init } from '../structs/Init.mjs';
377 import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs';
378 import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs';
379 import { Result_OpenChannelV2DecodeErrorZ } from '../structs/Result_OpenChannelV2DecodeErrorZ.mjs';
380 import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs';
381 import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
382 import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs';
383 import { Result_UpdateFailMalformedHTLCDecodeErrorZ } from '../structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mjs';
384 import { UpdateFee } from '../structs/UpdateFee.mjs';
385 import { Result_UpdateFeeDecodeErrorZ } from '../structs/Result_UpdateFeeDecodeErrorZ.mjs';
386 import { Result_UpdateFulfillHTLCDecodeErrorZ } from '../structs/Result_UpdateFulfillHTLCDecodeErrorZ.mjs';
387 import { Result_UpdateAddHTLCDecodeErrorZ } from '../structs/Result_UpdateAddHTLCDecodeErrorZ.mjs';
388 import { OnionMessage } from '../structs/OnionMessage.mjs';
389 import { Result_OnionMessageDecodeErrorZ } from '../structs/Result_OnionMessageDecodeErrorZ.mjs';
390 import { Ping } from '../structs/Ping.mjs';
391 import { Result_PingDecodeErrorZ } from '../structs/Result_PingDecodeErrorZ.mjs';
392 import { Pong } from '../structs/Pong.mjs';
393 import { Result_PongDecodeErrorZ } from '../structs/Result_PongDecodeErrorZ.mjs';
394 import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs';
395 import { Result_ChannelAnnouncementDecodeErrorZ } from '../structs/Result_ChannelAnnouncementDecodeErrorZ.mjs';
396 import { Result_UnsignedChannelUpdateDecodeErrorZ } from '../structs/Result_UnsignedChannelUpdateDecodeErrorZ.mjs';
397 import { Result_ChannelUpdateDecodeErrorZ } from '../structs/Result_ChannelUpdateDecodeErrorZ.mjs';
398 import { Result_ErrorMessageDecodeErrorZ } from '../structs/Result_ErrorMessageDecodeErrorZ.mjs';
399 import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs';
400 import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
401 import { Result_NodeAnnouncementDecodeErrorZ } from '../structs/Result_NodeAnnouncementDecodeErrorZ.mjs';
402 import { Result_QueryShortChannelIdsDecodeErrorZ } from '../structs/Result_QueryShortChannelIdsDecodeErrorZ.mjs';
403 import { ReplyShortChannelIdsEnd } from '../structs/ReplyShortChannelIdsEnd.mjs';
404 import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mjs';
405 import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs';
406 import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs';
407 import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs';
408 import { Option_KeyPairZ } from '../structs/Option_KeyPairZ.mjs';
409 import { Result_COption_KeyPairZNoneZ } from '../structs/Result_COption_KeyPairZNoneZ.mjs';
410 import { Result_InvoiceErrorDecodeErrorZ } from '../structs/Result_InvoiceErrorDecodeErrorZ.mjs';
411 import { WatchedOutput } from '../structs/WatchedOutput.mjs';
412 import { Filter, FilterInterface } from '../structs/Filter.mjs';
413 import { Option_FilterZ } from '../structs/Option_FilterZ.mjs';
414 import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs';
415 import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs';
416 import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs';
417 import { TwoTuple_OutPointCVec_MonitorUpdateIdZZ } from '../structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.mjs';
418 import { Bolt11Invoice } from '../structs/Bolt11Invoice.mjs';
419 import { SignOrCreationError } from '../structs/SignOrCreationError.mjs';
420 import { Result_Bolt11InvoiceSignOrCreationErrorZ } from '../structs/Result_Bolt11InvoiceSignOrCreationErrorZ.mjs';
421 import { Bolt11ParseError } from '../structs/Bolt11ParseError.mjs';
422 import { Result_SiPrefixBolt11ParseErrorZ } from '../structs/Result_SiPrefixBolt11ParseErrorZ.mjs';
423 import { ParseOrSemanticError } from '../structs/ParseOrSemanticError.mjs';
424 import { Result_Bolt11InvoiceParseOrSemanticErrorZ } from '../structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.mjs';
425 import { SignedRawBolt11Invoice } from '../structs/SignedRawBolt11Invoice.mjs';
426 import { Result_SignedRawBolt11InvoiceBolt11ParseErrorZ } from '../structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.mjs';
427 import { RawBolt11Invoice } from '../structs/RawBolt11Invoice.mjs';
428 import { Bolt11InvoiceSignature } from '../structs/Bolt11InvoiceSignature.mjs';
429 import { ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ } from '../structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.mjs';
430 import { PayeePubKey } from '../structs/PayeePubKey.mjs';
431 import { Result_PayeePubKeyErrorZ } from '../structs/Result_PayeePubKeyErrorZ.mjs';
432 import { PrivateRoute } from '../structs/PrivateRoute.mjs';
433 import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs';
434 import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs';
435 import { Result_NoneBolt11SemanticErrorZ } from '../structs/Result_NoneBolt11SemanticErrorZ.mjs';
436 import { Result_Bolt11InvoiceBolt11SemanticErrorZ } from '../structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.mjs';
437 import { Description } from '../structs/Description.mjs';
438 import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs';
439 import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs';
440 import { ChannelUsage } from '../structs/ChannelUsage.mjs';
441 import { ProbabilisticScoringFeeParameters } from '../structs/ProbabilisticScoringFeeParameters.mjs';
442 import { Score, ScoreInterface } from '../structs/Score.mjs';
443 import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs';
444 import { WriteableScore, WriteableScoreInterface } from '../structs/WriteableScore.mjs';
445 import { Persister, PersisterInterface } from '../structs/Persister.mjs';
446 import { PrintableString } from '../structs/PrintableString.mjs';
447 import { FutureCallback, FutureCallbackInterface } from '../structs/FutureCallback.mjs';
448 import { Future } from '../structs/Future.mjs';
449 import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs';
450 import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs';
451 import { ChannelConfigUpdate } from '../structs/ChannelConfigUpdate.mjs';
452 import { UserConfig } from '../structs/UserConfig.mjs';
453 import { BestBlock } from '../structs/BestBlock.mjs';
454 import { Listen, ListenInterface } from '../structs/Listen.mjs';
455 import { Confirm, ConfirmInterface } from '../structs/Confirm.mjs';
456 import { Persist, PersistInterface } from '../structs/Persist.mjs';
457 import { ChainMonitor } from '../structs/ChainMonitor.mjs';
458 import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs';
459 import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs';
460 import { ChainParameters } from '../structs/ChainParameters.mjs';
461 import { Retry } from '../structs/Retry.mjs';
462 import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs';
463 import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs';
464 import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs';
465 import { ExpandedKey } from '../structs/ExpandedKey.mjs';
466 import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs';
467 import { OnionMessageProvider, OnionMessageProviderInterface } from '../structs/OnionMessageProvider.mjs';
468 import { OnionMessageHandler, OnionMessageHandlerInterface } from '../structs/OnionMessageHandler.mjs';
469 import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs';
470 import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs';
471 import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs';
472 import { OffersMessageHandler, OffersMessageHandlerInterface } from '../structs/OffersMessageHandler.mjs';
473 import { CustomOnionMessageHandler, CustomOnionMessageHandlerInterface } from '../structs/CustomOnionMessageHandler.mjs';
474 import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs';
475 import { MessageHandler } from '../structs/MessageHandler.mjs';
476 import { SocketDescriptor, SocketDescriptorInterface } from '../structs/SocketDescriptor.mjs';
477 import { PeerManager } from '../structs/PeerManager.mjs';
478 import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs';
479 import { OfferFeatures } from '../structs/OfferFeatures.mjs';
480 import { InvoiceRequestFeatures } from '../structs/InvoiceRequestFeatures.mjs';
481 import { UnsignedBolt12Invoice } from '../structs/UnsignedBolt12Invoice.mjs';
482 import { ErroneousField } from '../structs/ErroneousField.mjs';
483 import { UnsignedInvoiceRequest } from '../structs/UnsignedInvoiceRequest.mjs';
484 import { Amount } from '../structs/Amount.mjs';
485 import { Quantity } from '../structs/Quantity.mjs';
486 import { P2PGossipSync } from '../structs/P2PGossipSync.mjs';
487 import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs';
488 import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs';
489 import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs';
490 import { DefaultRouter } from '../structs/DefaultRouter.mjs';
491 import { ScorerAccountingForInFlightHtlcs } from '../structs/ScorerAccountingForInFlightHtlcs.mjs';
492 import { Payee } from '../structs/Payee.mjs';
493 import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs';
494 import { MultiThreadedScoreLock } from '../structs/MultiThreadedScoreLock.mjs';
495 import { ProbabilisticScoringDecayParameters } from '../structs/ProbabilisticScoringDecayParameters.mjs';
496 import { KeysManager } from '../structs/KeysManager.mjs';
497 import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs';
498 import { Destination } from '../structs/Destination.mjs';
499 import { MessageRouter, MessageRouterInterface } from '../structs/MessageRouter.mjs';
500 import { OnionMessenger } from '../structs/OnionMessenger.mjs';
501 import { DefaultMessageRouter } from '../structs/DefaultMessageRouter.mjs';
502 import { OnionMessageContents } from '../structs/OnionMessageContents.mjs';
503 import { ChannelDerivationParameters } from '../structs/ChannelDerivationParameters.mjs';
504 import { CoinSelectionSource, CoinSelectionSourceInterface } from '../structs/CoinSelectionSource.mjs';
505 import { WalletSource, WalletSourceInterface } from '../structs/WalletSource.mjs';
506 import { Wallet } from '../structs/Wallet.mjs';
507 import { BumpTransactionEventHandler } from '../structs/BumpTransactionEventHandler.mjs';
508 import { RapidGossipSync } from '../structs/RapidGossipSync.mjs';
509 import { GossipSync } from '../structs/GossipSync.mjs';
510 import { RawDataPart } from '../structs/RawDataPart.mjs';
511 import { Sha256 } from '../structs/Sha256.mjs';
512 import { ExpiryTime } from '../structs/ExpiryTime.mjs';
513 import { MinFinalCltvExpiryDelta } from '../structs/MinFinalCltvExpiryDelta.mjs';
514 import { Fallback } from '../structs/Fallback.mjs';
515
516 import { CommonBase, UInt5, WitnessVersion, UnqualifiedError } from './CommonBase.mjs';
517 import * as bindings from '../bindings.mjs'
518
519 /**
520  * An Event which you should probably take some action in response to.
521  * 
522  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
523  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
524  * written as it makes no sense to respond to it after reconnecting to peers).
525  */
526 export class Event extends CommonBase {
527         protected constructor(_dummy: null, ptr: bigint) { super(ptr, bindings.Event_free); }
528         /* @internal */
529         public static constr_from_ptr(ptr: bigint): Event {
530                 const raw_ty: number = bindings.LDKEvent_ty_from_ptr(ptr);
531                 switch (raw_ty) {
532                         case 0: return new Event_FundingGenerationReady(ptr);
533                         case 1: return new Event_PaymentClaimable(ptr);
534                         case 2: return new Event_PaymentClaimed(ptr);
535                         case 3: return new Event_PaymentSent(ptr);
536                         case 4: return new Event_PaymentFailed(ptr);
537                         case 5: return new Event_PaymentPathSuccessful(ptr);
538                         case 6: return new Event_PaymentPathFailed(ptr);
539                         case 7: return new Event_ProbeSuccessful(ptr);
540                         case 8: return new Event_ProbeFailed(ptr);
541                         case 9: return new Event_PendingHTLCsForwardable(ptr);
542                         case 10: return new Event_HTLCIntercepted(ptr);
543                         case 11: return new Event_SpendableOutputs(ptr);
544                         case 12: return new Event_PaymentForwarded(ptr);
545                         case 13: return new Event_ChannelPending(ptr);
546                         case 14: return new Event_ChannelReady(ptr);
547                         case 15: return new Event_ChannelClosed(ptr);
548                         case 16: return new Event_DiscardFunding(ptr);
549                         case 17: return new Event_OpenChannelRequest(ptr);
550                         case 18: return new Event_HTLCHandlingFailed(ptr);
551                         case 19: return new Event_BumpTransaction(ptr);
552                         default:
553                                 throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
554                 }
555         }
556
557         public clone_ptr(): bigint {
558                 const ret: bigint = bindings.Event_clone_ptr(this.ptr);
559                 return ret;
560         }
561
562         /**
563          * Creates a copy of the Event
564          */
565         public clone(): Event {
566                 const ret: bigint = bindings.Event_clone(this.ptr);
567                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
568                 CommonBase.add_ref_from(ret_hu_conv, this);
569                 return ret_hu_conv;
570         }
571
572         /**
573          * Utility method to constructs a new FundingGenerationReady-variant Event
574          */
575         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 {
576                 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));
577                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
578                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
579                 return ret_hu_conv;
580         }
581
582         /**
583          * Utility method to constructs a new PaymentClaimable-variant Event
584          */
585         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: Uint8Array, via_user_channel_id: Option_u128Z, claim_deadline: Option_u32Z): Event {
586                 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), bindings.encodeUint8Array(bindings.check_arr_len(via_channel_id, 32)), CommonBase.get_ptr_of(via_user_channel_id), CommonBase.get_ptr_of(claim_deadline));
587                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
588                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
589                 CommonBase.add_ref_from(ret_hu_conv, onion_fields);
590                 CommonBase.add_ref_from(ret_hu_conv, purpose);
591                 CommonBase.add_ref_from(ret_hu_conv, via_user_channel_id);
592                 CommonBase.add_ref_from(ret_hu_conv, claim_deadline);
593                 return ret_hu_conv;
594         }
595
596         /**
597          * Utility method to constructs a new PaymentClaimed-variant Event
598          */
599         public static constructor_payment_claimed(receiver_node_id: Uint8Array, payment_hash: Uint8Array, amount_msat: bigint, purpose: PaymentPurpose): Event {
600                 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));
601                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
602                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
603                 CommonBase.add_ref_from(ret_hu_conv, purpose);
604                 return ret_hu_conv;
605         }
606
607         /**
608          * Utility method to constructs a new PaymentSent-variant Event
609          */
610         public static constructor_payment_sent(payment_id: Option_PaymentIdZ, payment_preimage: Uint8Array, payment_hash: Uint8Array, fee_paid_msat: Option_u64Z): Event {
611                 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));
612                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
613                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
614                 CommonBase.add_ref_from(ret_hu_conv, payment_id);
615                 CommonBase.add_ref_from(ret_hu_conv, fee_paid_msat);
616                 return ret_hu_conv;
617         }
618
619         /**
620          * Utility method to constructs a new PaymentFailed-variant Event
621          */
622         public static constructor_payment_failed(payment_id: Uint8Array, payment_hash: Uint8Array, reason: Option_PaymentFailureReasonZ): Event {
623                 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));
624                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
625                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
626                 CommonBase.add_ref_from(ret_hu_conv, reason);
627                 return ret_hu_conv;
628         }
629
630         /**
631          * Utility method to constructs a new PaymentPathSuccessful-variant Event
632          */
633         public static constructor_payment_path_successful(payment_id: Uint8Array, payment_hash: Option_PaymentHashZ, path: Path): Event {
634                 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));
635                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
636                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
637                 CommonBase.add_ref_from(ret_hu_conv, payment_hash);
638                 CommonBase.add_ref_from(ret_hu_conv, path);
639                 return ret_hu_conv;
640         }
641
642         /**
643          * Utility method to constructs a new PaymentPathFailed-variant Event
644          */
645         public static constructor_payment_path_failed(payment_id: Option_PaymentIdZ, payment_hash: Uint8Array, payment_failed_permanently: boolean, failure: PathFailure, path: Path, short_channel_id: Option_u64Z): Event {
646                 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));
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, failure);
651                 CommonBase.add_ref_from(ret_hu_conv, path);
652                 CommonBase.add_ref_from(ret_hu_conv, short_channel_id);
653                 return ret_hu_conv;
654         }
655
656         /**
657          * Utility method to constructs a new ProbeSuccessful-variant Event
658          */
659         public static constructor_probe_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: Path): Event {
660                 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));
661                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
662                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
663                 CommonBase.add_ref_from(ret_hu_conv, path);
664                 return ret_hu_conv;
665         }
666
667         /**
668          * Utility method to constructs a new ProbeFailed-variant Event
669          */
670         public static constructor_probe_failed(payment_id: Uint8Array, payment_hash: Uint8Array, path: Path, short_channel_id: Option_u64Z): Event {
671                 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));
672                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
673                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
674                 CommonBase.add_ref_from(ret_hu_conv, path);
675                 CommonBase.add_ref_from(ret_hu_conv, short_channel_id);
676                 return ret_hu_conv;
677         }
678
679         /**
680          * Utility method to constructs a new PendingHTLCsForwardable-variant Event
681          */
682         public static constructor_pending_htlcs_forwardable(time_forwardable: bigint): Event {
683                 const ret: bigint = bindings.Event_pending_htlcs_forwardable(time_forwardable);
684                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
685                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
686                 return ret_hu_conv;
687         }
688
689         /**
690          * Utility method to constructs a new HTLCIntercepted-variant Event
691          */
692         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 {
693                 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);
694                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
695                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
696                 return ret_hu_conv;
697         }
698
699         /**
700          * Utility method to constructs a new SpendableOutputs-variant Event
701          */
702         public static constructor_spendable_outputs(outputs: SpendableOutputDescriptor[]): Event {
703                 const ret: bigint = bindings.Event_spendable_outputs(bindings.encodeUint64Array(outputs != null ? outputs.map(outputs_conv_27 => CommonBase.get_ptr_of(outputs_conv_27)) : null));
704                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
705                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
706                 outputs.forEach((outputs_conv_27: SpendableOutputDescriptor) => { CommonBase.add_ref_from(ret_hu_conv, outputs_conv_27); });
707                 return ret_hu_conv;
708         }
709
710         /**
711          * Utility method to constructs a new PaymentForwarded-variant Event
712          */
713         public static constructor_payment_forwarded(prev_channel_id: Uint8Array, next_channel_id: Uint8Array, fee_earned_msat: Option_u64Z, claim_from_onchain_tx: boolean, outbound_amount_forwarded_msat: Option_u64Z): Event {
714                 const ret: bigint = bindings.Event_payment_forwarded(bindings.encodeUint8Array(bindings.check_arr_len(prev_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(next_channel_id, 32)), CommonBase.get_ptr_of(fee_earned_msat), claim_from_onchain_tx, CommonBase.get_ptr_of(outbound_amount_forwarded_msat));
715                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
716                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
717                 CommonBase.add_ref_from(ret_hu_conv, fee_earned_msat);
718                 CommonBase.add_ref_from(ret_hu_conv, outbound_amount_forwarded_msat);
719                 return ret_hu_conv;
720         }
721
722         /**
723          * Utility method to constructs a new ChannelPending-variant Event
724          */
725         public static constructor_channel_pending(channel_id: Uint8Array, user_channel_id: bigint, former_temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_txo: OutPoint): Event {
726                 const ret: bigint = bindings.Event_channel_pending(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint128(user_channel_id), bindings.encodeUint8Array(bindings.check_arr_len(former_temporary_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), funding_txo == null ? 0n : CommonBase.get_ptr_of(funding_txo));
727                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
728                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
729                 CommonBase.add_ref_from(ret_hu_conv, funding_txo);
730                 return ret_hu_conv;
731         }
732
733         /**
734          * Utility method to constructs a new ChannelReady-variant Event
735          */
736         public static constructor_channel_ready(channel_id: Uint8Array, user_channel_id: bigint, counterparty_node_id: Uint8Array, channel_type: ChannelTypeFeatures): Event {
737                 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));
738                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
739                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
740                 CommonBase.add_ref_from(ret_hu_conv, channel_type);
741                 return ret_hu_conv;
742         }
743
744         /**
745          * Utility method to constructs a new ChannelClosed-variant Event
746          */
747         public static constructor_channel_closed(channel_id: Uint8Array, user_channel_id: bigint, reason: ClosureReason): Event {
748                 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));
749                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
750                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
751                 CommonBase.add_ref_from(ret_hu_conv, reason);
752                 return ret_hu_conv;
753         }
754
755         /**
756          * Utility method to constructs a new DiscardFunding-variant Event
757          */
758         public static constructor_discard_funding(channel_id: Uint8Array, transaction: Uint8Array): Event {
759                 const ret: bigint = bindings.Event_discard_funding(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(transaction));
760                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
761                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
762                 return ret_hu_conv;
763         }
764
765         /**
766          * Utility method to constructs a new OpenChannelRequest-variant Event
767          */
768         public static constructor_open_channel_request(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_satoshis: bigint, push_msat: bigint, channel_type: ChannelTypeFeatures): Event {
769                 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));
770                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
771                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
772                 CommonBase.add_ref_from(ret_hu_conv, channel_type);
773                 return ret_hu_conv;
774         }
775
776         /**
777          * Utility method to constructs a new HTLCHandlingFailed-variant Event
778          */
779         public static constructor_htlchandling_failed(prev_channel_id: Uint8Array, failed_next_destination: HTLCDestination): Event {
780                 const ret: bigint = bindings.Event_htlchandling_failed(bindings.encodeUint8Array(bindings.check_arr_len(prev_channel_id, 32)), CommonBase.get_ptr_of(failed_next_destination));
781                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
782                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
783                 CommonBase.add_ref_from(ret_hu_conv, failed_next_destination);
784                 return ret_hu_conv;
785         }
786
787         /**
788          * Utility method to constructs a new BumpTransaction-variant Event
789          */
790         public static constructor_bump_transaction(a: BumpTransactionEvent): Event {
791                 const ret: bigint = bindings.Event_bump_transaction(CommonBase.get_ptr_of(a));
792                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
793                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
794                 CommonBase.add_ref_from(ret_hu_conv, a);
795                 return ret_hu_conv;
796         }
797
798         /**
799          * Checks if two Events contain equal inner contents.
800          * This ignores pointers and is_owned flags and looks at the values in fields.
801          */
802         public eq(b: Event): boolean {
803                 const ret: boolean = bindings.Event_eq(this.ptr, b == null ? 0n : CommonBase.get_ptr_of(b));
804                 return ret;
805         }
806
807         /**
808          * Serialize the Event object into a byte array which can be read by Event_read
809          */
810         public write(): Uint8Array {
811                 const ret: number = bindings.Event_write(this.ptr);
812                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
813                 return ret_conv;
814         }
815
816 }
817 /** A Event of type FundingGenerationReady */
818 export class Event_FundingGenerationReady extends Event {
819         /**
820          * The random channel_id we picked which you'll need to pass into
821          * [`ChannelManager::funding_transaction_generated`].
822          * 
823          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
824          */
825         public temporary_channel_id: Uint8Array;
826         /**
827          * The counterparty's node_id, which you'll need to pass back into
828          * [`ChannelManager::funding_transaction_generated`].
829          * 
830          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
831          */
832         public counterparty_node_id: Uint8Array;
833         /**
834          * The value, in satoshis, that the output should have.
835          */
836         public channel_value_satoshis: bigint;
837         /**
838          * The script which should be used in the transaction output.
839          */
840         public output_script: Uint8Array;
841         /**
842          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a
843          * random value for an inbound channel. This may be zero for objects serialized with LDK
844          * versions prior to 0.0.113.
845          * 
846          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
847          */
848         public user_channel_id: bigint;
849         /* @internal */
850         public constructor(ptr: bigint) {
851                 super(null, ptr);
852                 const temporary_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr);
853                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
854                 this.temporary_channel_id = temporary_channel_id_conv;
855                 const counterparty_node_id: number = bindings.LDKEvent_FundingGenerationReady_get_counterparty_node_id(ptr);
856                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
857                 this.counterparty_node_id = counterparty_node_id_conv;
858                 this.channel_value_satoshis = bindings.LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr);
859                 const output_script: number = bindings.LDKEvent_FundingGenerationReady_get_output_script(ptr);
860                 const output_script_conv: Uint8Array = bindings.decodeUint8Array(output_script);
861                 this.output_script = output_script_conv;
862                 const user_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_user_channel_id(ptr);
863                 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
864                 this.user_channel_id = user_channel_id_conv;
865         }
866 }
867 /** A Event of type PaymentClaimable */
868 export class Event_PaymentClaimable extends Event {
869         /**
870          * The node that will receive the payment after it has been claimed.
871          * This is useful to identify payments received via [phantom nodes].
872          * This field will always be filled in when the event was generated by LDK versions
873          * 0.0.113 and above.
874          * 
875          * [phantom nodes]: crate::sign::PhantomKeysManager
876          * 
877          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
878          */
879         public receiver_node_id: Uint8Array;
880         /**
881          * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
882          * not stop you from registering duplicate payment hashes for inbound payments.
883          */
884         public payment_hash: Uint8Array;
885         /**
886          * The fields in the onion which were received with each HTLC. Only fields which were
887          * identical in each HTLC involved in the payment will be included here.
888          * 
889          * Payments received on LDK versions prior to 0.0.115 will have this field unset.
890          * 
891          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
892          */
893         public onion_fields: RecipientOnionFields;
894         /**
895          * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
896          * than the invoice amount.
897          * 
898          * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
899          * and the previous hop took an extra fee.
900          * 
901          * # Note
902          * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
903          * field, you may lose money!
904          * 
905          * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
906          */
907         public amount_msat: bigint;
908         /**
909          * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
910          * taken by our channel counterparty.
911          * 
912          * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
913          * 
914          * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
915          */
916         public counterparty_skimmed_fee_msat: bigint;
917         /**
918          * Information for claiming this received payment, based on whether the purpose of the
919          * payment is to pay an invoice or to send a spontaneous payment.
920          */
921         public purpose: PaymentPurpose;
922         /**
923          * The `channel_id` indicating over which channel we received the payment.
924          * 
925          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
926          */
927         public via_channel_id: Uint8Array;
928         /**
929          * The `user_channel_id` indicating over which channel we received the payment.
930          */
931         public via_user_channel_id: Option_u128Z;
932         /**
933          * The block height at which this payment will be failed back and will no longer be
934          * eligible for claiming.
935          * 
936          * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
937          * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
938          * 
939          * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
940          */
941         public claim_deadline: Option_u32Z;
942         /* @internal */
943         public constructor(ptr: bigint) {
944                 super(null, ptr);
945                 const receiver_node_id: number = bindings.LDKEvent_PaymentClaimable_get_receiver_node_id(ptr);
946                 const receiver_node_id_conv: Uint8Array = bindings.decodeUint8Array(receiver_node_id);
947                 this.receiver_node_id = receiver_node_id_conv;
948                 const payment_hash: number = bindings.LDKEvent_PaymentClaimable_get_payment_hash(ptr);
949                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
950                 this.payment_hash = payment_hash_conv;
951                 const onion_fields: bigint = bindings.LDKEvent_PaymentClaimable_get_onion_fields(ptr);
952                 const onion_fields_hu_conv: RecipientOnionFields = new RecipientOnionFields(null, onion_fields);
953                         CommonBase.add_ref_from(onion_fields_hu_conv, this);
954                 this.onion_fields = onion_fields_hu_conv;
955                 this.amount_msat = bindings.LDKEvent_PaymentClaimable_get_amount_msat(ptr);
956                 this.counterparty_skimmed_fee_msat = bindings.LDKEvent_PaymentClaimable_get_counterparty_skimmed_fee_msat(ptr);
957                 const purpose: bigint = bindings.LDKEvent_PaymentClaimable_get_purpose(ptr);
958                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
959                         CommonBase.add_ref_from(purpose_hu_conv, this);
960                 this.purpose = purpose_hu_conv;
961                 const via_channel_id: number = bindings.LDKEvent_PaymentClaimable_get_via_channel_id(ptr);
962                 const via_channel_id_conv: Uint8Array = bindings.decodeUint8Array(via_channel_id);
963                 this.via_channel_id = via_channel_id_conv;
964                 const via_user_channel_id: bigint = bindings.LDKEvent_PaymentClaimable_get_via_user_channel_id(ptr);
965                 const via_user_channel_id_hu_conv: Option_u128Z = Option_u128Z.constr_from_ptr(via_user_channel_id);
966                         CommonBase.add_ref_from(via_user_channel_id_hu_conv, this);
967                 this.via_user_channel_id = via_user_channel_id_hu_conv;
968                 const claim_deadline: bigint = bindings.LDKEvent_PaymentClaimable_get_claim_deadline(ptr);
969                 const claim_deadline_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(claim_deadline);
970                         CommonBase.add_ref_from(claim_deadline_hu_conv, this);
971                 this.claim_deadline = claim_deadline_hu_conv;
972         }
973 }
974 /** A Event of type PaymentClaimed */
975 export class Event_PaymentClaimed extends Event {
976         /**
977          * The node that received the payment.
978          * This is useful to identify payments which were received via [phantom nodes].
979          * This field will always be filled in when the event was generated by LDK versions
980          * 0.0.113 and above.
981          * 
982          * [phantom nodes]: crate::sign::PhantomKeysManager
983          * 
984          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
985          */
986         public receiver_node_id: Uint8Array;
987         /**
988          * The payment hash of the claimed payment. Note that LDK will not stop you from
989          * registering duplicate payment hashes for inbound payments.
990          */
991         public payment_hash: Uint8Array;
992         /**
993          * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
994          * invoice amount.
995          */
996         public amount_msat: bigint;
997         /**
998          * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
999          * spontaneous payment.
1000          */
1001         public purpose: PaymentPurpose;
1002         /* @internal */
1003         public constructor(ptr: bigint) {
1004                 super(null, ptr);
1005                 const receiver_node_id: number = bindings.LDKEvent_PaymentClaimed_get_receiver_node_id(ptr);
1006                 const receiver_node_id_conv: Uint8Array = bindings.decodeUint8Array(receiver_node_id);
1007                 this.receiver_node_id = receiver_node_id_conv;
1008                 const payment_hash: number = bindings.LDKEvent_PaymentClaimed_get_payment_hash(ptr);
1009                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1010                 this.payment_hash = payment_hash_conv;
1011                 this.amount_msat = bindings.LDKEvent_PaymentClaimed_get_amount_msat(ptr);
1012                 const purpose: bigint = bindings.LDKEvent_PaymentClaimed_get_purpose(ptr);
1013                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
1014                         CommonBase.add_ref_from(purpose_hu_conv, this);
1015                 this.purpose = purpose_hu_conv;
1016         }
1017 }
1018 /** A Event of type PaymentSent */
1019 export class Event_PaymentSent extends Event {
1020         /**
1021          * The `payment_id` passed to [`ChannelManager::send_payment`].
1022          * 
1023          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1024          */
1025         public payment_id: Option_PaymentIdZ;
1026         /**
1027          * The preimage to the hash given to ChannelManager::send_payment.
1028          * Note that this serves as a payment receipt, if you wish to have such a thing, you must
1029          * store it somehow!
1030          */
1031         public payment_preimage: Uint8Array;
1032         /**
1033          * The hash that was given to [`ChannelManager::send_payment`].
1034          * 
1035          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1036          */
1037         public payment_hash: Uint8Array;
1038         /**
1039          * The total fee which was spent at intermediate hops in this payment, across all paths.
1040          * 
1041          * Note that, like [`Route::get_total_fees`] this does *not* include any potential
1042          * overpayment to the recipient node.
1043          * 
1044          * If the recipient or an intermediate node misbehaves and gives us free money, this may
1045          * overstate the amount paid, though this is unlikely.
1046          * 
1047          * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
1048          */
1049         public fee_paid_msat: Option_u64Z;
1050         /* @internal */
1051         public constructor(ptr: bigint) {
1052                 super(null, ptr);
1053                 const payment_id: bigint = bindings.LDKEvent_PaymentSent_get_payment_id(ptr);
1054                 const payment_id_hu_conv: Option_PaymentIdZ = Option_PaymentIdZ.constr_from_ptr(payment_id);
1055                         CommonBase.add_ref_from(payment_id_hu_conv, this);
1056                 this.payment_id = payment_id_hu_conv;
1057                 const payment_preimage: number = bindings.LDKEvent_PaymentSent_get_payment_preimage(ptr);
1058                 const payment_preimage_conv: Uint8Array = bindings.decodeUint8Array(payment_preimage);
1059                 this.payment_preimage = payment_preimage_conv;
1060                 const payment_hash: number = bindings.LDKEvent_PaymentSent_get_payment_hash(ptr);
1061                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1062                 this.payment_hash = payment_hash_conv;
1063                 const fee_paid_msat: bigint = bindings.LDKEvent_PaymentSent_get_fee_paid_msat(ptr);
1064                 const fee_paid_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_paid_msat);
1065                         CommonBase.add_ref_from(fee_paid_msat_hu_conv, this);
1066                 this.fee_paid_msat = fee_paid_msat_hu_conv;
1067         }
1068 }
1069 /** A Event of type PaymentFailed */
1070 export class Event_PaymentFailed extends Event {
1071         /**
1072          * The `payment_id` passed to [`ChannelManager::send_payment`].
1073          * 
1074          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1075          */
1076         public payment_id: Uint8Array;
1077         /**
1078          * The hash that was given to [`ChannelManager::send_payment`].
1079          * 
1080          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1081          */
1082         public payment_hash: Uint8Array;
1083         /**
1084          * The reason the payment failed. This is only `None` for events generated or serialized
1085          * by versions prior to 0.0.115.
1086          */
1087         public reason: Option_PaymentFailureReasonZ;
1088         /* @internal */
1089         public constructor(ptr: bigint) {
1090                 super(null, ptr);
1091                 const payment_id: number = bindings.LDKEvent_PaymentFailed_get_payment_id(ptr);
1092                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1093                 this.payment_id = payment_id_conv;
1094                 const payment_hash: number = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr);
1095                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1096                 this.payment_hash = payment_hash_conv;
1097                 const reason: bigint = bindings.LDKEvent_PaymentFailed_get_reason(ptr);
1098                 const reason_hu_conv: Option_PaymentFailureReasonZ = Option_PaymentFailureReasonZ.constr_from_ptr(reason);
1099                         CommonBase.add_ref_from(reason_hu_conv, this);
1100                 this.reason = reason_hu_conv;
1101         }
1102 }
1103 /** A Event of type PaymentPathSuccessful */
1104 export class Event_PaymentPathSuccessful extends Event {
1105         /**
1106          * The `payment_id` passed to [`ChannelManager::send_payment`].
1107          * 
1108          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1109          */
1110         public payment_id: Uint8Array;
1111         /**
1112          * The hash that was given to [`ChannelManager::send_payment`].
1113          * 
1114          * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
1115          * 
1116          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1117          */
1118         public payment_hash: Option_PaymentHashZ;
1119         /**
1120          * The payment path that was successful.
1121          * 
1122          * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
1123          */
1124         public path: Path;
1125         /* @internal */
1126         public constructor(ptr: bigint) {
1127                 super(null, ptr);
1128                 const payment_id: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_id(ptr);
1129                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1130                 this.payment_id = payment_id_conv;
1131                 const payment_hash: bigint = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr);
1132                 const payment_hash_hu_conv: Option_PaymentHashZ = Option_PaymentHashZ.constr_from_ptr(payment_hash);
1133                         CommonBase.add_ref_from(payment_hash_hu_conv, this);
1134                 this.payment_hash = payment_hash_hu_conv;
1135                 const path: bigint = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr);
1136                 const path_hu_conv: Path = new Path(null, path);
1137                         CommonBase.add_ref_from(path_hu_conv, this);
1138                 this.path = path_hu_conv;
1139         }
1140 }
1141 /** A Event of type PaymentPathFailed */
1142 export class Event_PaymentPathFailed extends Event {
1143         /**
1144          * The `payment_id` passed to [`ChannelManager::send_payment`].
1145          * 
1146          * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
1147          * 
1148          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1149          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
1150          */
1151         public payment_id: Option_PaymentIdZ;
1152         /**
1153          * The hash that was given to [`ChannelManager::send_payment`].
1154          * 
1155          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1156          */
1157         public payment_hash: Uint8Array;
1158         /**
1159          * Indicates the payment was rejected for some reason by the recipient. This implies that
1160          * the payment has failed, not just the route in question. If this is not set, the payment may
1161          * be retried via a different route.
1162          */
1163         public payment_failed_permanently: boolean;
1164         /**
1165          * Extra error details based on the failure type. May contain an update that needs to be
1166          * applied to the [`NetworkGraph`].
1167          * 
1168          * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
1169          */
1170         public failure: PathFailure;
1171         /**
1172          * The payment path that failed.
1173          */
1174         public path: Path;
1175         /**
1176          * The channel responsible for the failed payment path.
1177          * 
1178          * Note that for route hints or for the first hop in a path this may be an SCID alias and
1179          * may not refer to a channel in the public network graph. These aliases may also collide
1180          * with channels in the public network graph.
1181          * 
1182          * If this is `Some`, then the corresponding channel should be avoided when the payment is
1183          * retried. May be `None` for older [`Event`] serializations.
1184          */
1185         public short_channel_id: Option_u64Z;
1186         /* @internal */
1187         public constructor(ptr: bigint) {
1188                 super(null, ptr);
1189                 const payment_id: bigint = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr);
1190                 const payment_id_hu_conv: Option_PaymentIdZ = Option_PaymentIdZ.constr_from_ptr(payment_id);
1191                         CommonBase.add_ref_from(payment_id_hu_conv, this);
1192                 this.payment_id = payment_id_hu_conv;
1193                 const payment_hash: number = bindings.LDKEvent_PaymentPathFailed_get_payment_hash(ptr);
1194                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1195                 this.payment_hash = payment_hash_conv;
1196                 this.payment_failed_permanently = bindings.LDKEvent_PaymentPathFailed_get_payment_failed_permanently(ptr);
1197                 const failure: bigint = bindings.LDKEvent_PaymentPathFailed_get_failure(ptr);
1198                 const failure_hu_conv: PathFailure = PathFailure.constr_from_ptr(failure);
1199                         CommonBase.add_ref_from(failure_hu_conv, this);
1200                 this.failure = failure_hu_conv;
1201                 const path: bigint = bindings.LDKEvent_PaymentPathFailed_get_path(ptr);
1202                 const path_hu_conv: Path = new Path(null, path);
1203                         CommonBase.add_ref_from(path_hu_conv, this);
1204                 this.path = path_hu_conv;
1205                 const short_channel_id: bigint = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr);
1206                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1207                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1208                 this.short_channel_id = short_channel_id_hu_conv;
1209         }
1210 }
1211 /** A Event of type ProbeSuccessful */
1212 export class Event_ProbeSuccessful extends Event {
1213         /**
1214          * The id returned by [`ChannelManager::send_probe`].
1215          * 
1216          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1217          */
1218         public payment_id: Uint8Array;
1219         /**
1220          * The hash generated by [`ChannelManager::send_probe`].
1221          * 
1222          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1223          */
1224         public payment_hash: Uint8Array;
1225         /**
1226          * The payment path that was successful.
1227          */
1228         public path: Path;
1229         /* @internal */
1230         public constructor(ptr: bigint) {
1231                 super(null, ptr);
1232                 const payment_id: number = bindings.LDKEvent_ProbeSuccessful_get_payment_id(ptr);
1233                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1234                 this.payment_id = payment_id_conv;
1235                 const payment_hash: number = bindings.LDKEvent_ProbeSuccessful_get_payment_hash(ptr);
1236                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1237                 this.payment_hash = payment_hash_conv;
1238                 const path: bigint = bindings.LDKEvent_ProbeSuccessful_get_path(ptr);
1239                 const path_hu_conv: Path = new Path(null, path);
1240                         CommonBase.add_ref_from(path_hu_conv, this);
1241                 this.path = path_hu_conv;
1242         }
1243 }
1244 /** A Event of type ProbeFailed */
1245 export class Event_ProbeFailed extends Event {
1246         /**
1247          * The id returned by [`ChannelManager::send_probe`].
1248          * 
1249          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1250          */
1251         public payment_id: Uint8Array;
1252         /**
1253          * The hash generated by [`ChannelManager::send_probe`].
1254          * 
1255          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1256          */
1257         public payment_hash: Uint8Array;
1258         /**
1259          * The payment path that failed.
1260          */
1261         public path: Path;
1262         /**
1263          * The channel responsible for the failed probe.
1264          * 
1265          * Note that for route hints or for the first hop in a path this may be an SCID alias and
1266          * may not refer to a channel in the public network graph. These aliases may also collide
1267          * with channels in the public network graph.
1268          */
1269         public short_channel_id: Option_u64Z;
1270         /* @internal */
1271         public constructor(ptr: bigint) {
1272                 super(null, ptr);
1273                 const payment_id: number = bindings.LDKEvent_ProbeFailed_get_payment_id(ptr);
1274                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1275                 this.payment_id = payment_id_conv;
1276                 const payment_hash: number = bindings.LDKEvent_ProbeFailed_get_payment_hash(ptr);
1277                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1278                 this.payment_hash = payment_hash_conv;
1279                 const path: bigint = bindings.LDKEvent_ProbeFailed_get_path(ptr);
1280                 const path_hu_conv: Path = new Path(null, path);
1281                         CommonBase.add_ref_from(path_hu_conv, this);
1282                 this.path = path_hu_conv;
1283                 const short_channel_id: bigint = bindings.LDKEvent_ProbeFailed_get_short_channel_id(ptr);
1284                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1285                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1286                 this.short_channel_id = short_channel_id_hu_conv;
1287         }
1288 }
1289 /** A Event of type PendingHTLCsForwardable */
1290 export class Event_PendingHTLCsForwardable extends Event {
1291         /**
1292          * The minimum amount of time that should be waited prior to calling
1293          * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1294          * you should wait a random amount of time in roughly the range (now + time_forwardable,
1295          * now + 5*time_forwardable).
1296          */
1297         public time_forwardable: bigint;
1298         /* @internal */
1299         public constructor(ptr: bigint) {
1300                 super(null, ptr);
1301                 this.time_forwardable = bindings.LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr);
1302         }
1303 }
1304 /** A Event of type HTLCIntercepted */
1305 export class Event_HTLCIntercepted extends Event {
1306         /**
1307          * An id to help LDK identify which HTLC is being forwarded or failed.
1308          */
1309         public intercept_id: Uint8Array;
1310         /**
1311          * The fake scid that was programmed as the next hop's scid, generated using
1312          * [`ChannelManager::get_intercept_scid`].
1313          * 
1314          * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
1315          */
1316         public requested_next_hop_scid: bigint;
1317         /**
1318          * The payment hash used for this HTLC.
1319          */
1320         public payment_hash: Uint8Array;
1321         /**
1322          * How many msats were received on the inbound edge of this HTLC.
1323          */
1324         public inbound_amount_msat: bigint;
1325         /**
1326          * How many msats the payer intended to route to the next node. Depending on the reason you are
1327          * intercepting this payment, you might take a fee by forwarding less than this amount.
1328          * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
1329          * 
1330          * Note that LDK will NOT check that expected fees were factored into this value. You MUST
1331          * check that whatever fee you want has been included here or subtract it as required. Further,
1332          * LDK will not stop you from forwarding more than you received.
1333          */
1334         public expected_outbound_amount_msat: bigint;
1335         /* @internal */
1336         public constructor(ptr: bigint) {
1337                 super(null, ptr);
1338                 const intercept_id: number = bindings.LDKEvent_HTLCIntercepted_get_intercept_id(ptr);
1339                 const intercept_id_conv: Uint8Array = bindings.decodeUint8Array(intercept_id);
1340                 this.intercept_id = intercept_id_conv;
1341                 this.requested_next_hop_scid = bindings.LDKEvent_HTLCIntercepted_get_requested_next_hop_scid(ptr);
1342                 const payment_hash: number = bindings.LDKEvent_HTLCIntercepted_get_payment_hash(ptr);
1343                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1344                 this.payment_hash = payment_hash_conv;
1345                 this.inbound_amount_msat = bindings.LDKEvent_HTLCIntercepted_get_inbound_amount_msat(ptr);
1346                 this.expected_outbound_amount_msat = bindings.LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat(ptr);
1347         }
1348 }
1349 /** A Event of type SpendableOutputs */
1350 export class Event_SpendableOutputs extends Event {
1351         /**
1352          * The outputs which you should store as spendable by you.
1353          */
1354         public outputs: SpendableOutputDescriptor[];
1355         /* @internal */
1356         public constructor(ptr: bigint) {
1357                 super(null, ptr);
1358                 const outputs: number = bindings.LDKEvent_SpendableOutputs_get_outputs(ptr);
1359                 const outputs_conv_27_len: number = bindings.getArrayLength(outputs);
1360                         const outputs_conv_27_arr: SpendableOutputDescriptor[] = new Array(outputs_conv_27_len).fill(null);
1361                         for (var b = 0; b < outputs_conv_27_len; b++) {
1362                                 const outputs_conv_27: bigint = bindings.getU64ArrayElem(outputs, b);
1363                                 const outputs_conv_27_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
1364                                 CommonBase.add_ref_from(outputs_conv_27_hu_conv, this);
1365                                 outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
1366                         }
1367                         bindings.freeWasmMemory(outputs)
1368                 this.outputs = outputs_conv_27_arr;
1369         }
1370 }
1371 /** A Event of type PaymentForwarded */
1372 export class Event_PaymentForwarded extends Event {
1373         /**
1374          * The incoming channel between the previous node and us. This is only `None` for events
1375          * generated or serialized by versions prior to 0.0.107.
1376          * 
1377          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1378          */
1379         public prev_channel_id: Uint8Array;
1380         /**
1381          * The outgoing channel between the next node and us. This is only `None` for events
1382          * generated or serialized by versions prior to 0.0.107.
1383          * 
1384          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1385          */
1386         public next_channel_id: Uint8Array;
1387         /**
1388          * The fee, in milli-satoshis, which was earned as a result of the payment.
1389          * 
1390          * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
1391          * was pending, the amount the next hop claimed will have been rounded down to the nearest
1392          * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
1393          * claimed the full value in millisatoshis from the source. In this case,
1394          * `claim_from_onchain_tx` will be set.
1395          * 
1396          * If the channel which sent us the payment has been force-closed, we will claim the funds
1397          * via an on-chain transaction. In that case we do not yet know the on-chain transaction
1398          * fees which we will spend and will instead set this to `None`. It is possible duplicate
1399          * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
1400          * `None`.
1401          */
1402         public fee_earned_msat: Option_u64Z;
1403         /**
1404          * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
1405          * transaction.
1406          */
1407         public claim_from_onchain_tx: boolean;
1408         /**
1409          * The final amount forwarded, in milli-satoshis, after the fee is deducted.
1410          * 
1411          * The caveat described above the `fee_earned_msat` field applies here as well.
1412          */
1413         public outbound_amount_forwarded_msat: Option_u64Z;
1414         /* @internal */
1415         public constructor(ptr: bigint) {
1416                 super(null, ptr);
1417                 const prev_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr);
1418                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1419                 this.prev_channel_id = prev_channel_id_conv;
1420                 const next_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr);
1421                 const next_channel_id_conv: Uint8Array = bindings.decodeUint8Array(next_channel_id);
1422                 this.next_channel_id = next_channel_id_conv;
1423                 const fee_earned_msat: bigint = bindings.LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr);
1424                 const fee_earned_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_earned_msat);
1425                         CommonBase.add_ref_from(fee_earned_msat_hu_conv, this);
1426                 this.fee_earned_msat = fee_earned_msat_hu_conv;
1427                 this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr);
1428                 const outbound_amount_forwarded_msat: bigint = bindings.LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(ptr);
1429                 const outbound_amount_forwarded_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(outbound_amount_forwarded_msat);
1430                         CommonBase.add_ref_from(outbound_amount_forwarded_msat_hu_conv, this);
1431                 this.outbound_amount_forwarded_msat = outbound_amount_forwarded_msat_hu_conv;
1432         }
1433 }
1434 /** A Event of type ChannelPending */
1435 export class Event_ChannelPending extends Event {
1436         /**
1437          * The `channel_id` of the channel that is pending confirmation.
1438          */
1439         public channel_id: Uint8Array;
1440         /**
1441          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1442          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1443          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1444          * `user_channel_id` will be randomized for an inbound channel.
1445          * 
1446          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1447          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1448          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1449          */
1450         public user_channel_id: bigint;
1451         /**
1452          * The `temporary_channel_id` this channel used to be known by during channel establishment.
1453          * 
1454          * Will be `None` for channels created prior to LDK version 0.0.115.
1455          * 
1456          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1457          */
1458         public former_temporary_channel_id: Uint8Array;
1459         /**
1460          * The `node_id` of the channel counterparty.
1461          */
1462         public counterparty_node_id: Uint8Array;
1463         /**
1464          * The outpoint of the channel's funding transaction.
1465          */
1466         public funding_txo: OutPoint;
1467         /* @internal */
1468         public constructor(ptr: bigint) {
1469                 super(null, ptr);
1470                 const channel_id: number = bindings.LDKEvent_ChannelPending_get_channel_id(ptr);
1471                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1472                 this.channel_id = channel_id_conv;
1473                 const user_channel_id: number = bindings.LDKEvent_ChannelPending_get_user_channel_id(ptr);
1474                 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1475                 this.user_channel_id = user_channel_id_conv;
1476                 const former_temporary_channel_id: number = bindings.LDKEvent_ChannelPending_get_former_temporary_channel_id(ptr);
1477                 const former_temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(former_temporary_channel_id);
1478                 this.former_temporary_channel_id = former_temporary_channel_id_conv;
1479                 const counterparty_node_id: number = bindings.LDKEvent_ChannelPending_get_counterparty_node_id(ptr);
1480                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1481                 this.counterparty_node_id = counterparty_node_id_conv;
1482                 const funding_txo: bigint = bindings.LDKEvent_ChannelPending_get_funding_txo(ptr);
1483                 const funding_txo_hu_conv: OutPoint = new OutPoint(null, funding_txo);
1484                         CommonBase.add_ref_from(funding_txo_hu_conv, this);
1485                 this.funding_txo = funding_txo_hu_conv;
1486         }
1487 }
1488 /** A Event of type ChannelReady */
1489 export class Event_ChannelReady extends Event {
1490         /**
1491          * The `channel_id` of the channel that is ready.
1492          */
1493         public channel_id: Uint8Array;
1494         /**
1495          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1496          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1497          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1498          * `user_channel_id` will be randomized for an inbound channel.
1499          * 
1500          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1501          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1502          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1503          */
1504         public user_channel_id: bigint;
1505         /**
1506          * The `node_id` of the channel counterparty.
1507          */
1508         public counterparty_node_id: Uint8Array;
1509         /**
1510          * The features that this channel will operate with.
1511          */
1512         public channel_type: ChannelTypeFeatures;
1513         /* @internal */
1514         public constructor(ptr: bigint) {
1515                 super(null, ptr);
1516                 const channel_id: number = bindings.LDKEvent_ChannelReady_get_channel_id(ptr);
1517                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1518                 this.channel_id = channel_id_conv;
1519                 const user_channel_id: number = bindings.LDKEvent_ChannelReady_get_user_channel_id(ptr);
1520                 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1521                 this.user_channel_id = user_channel_id_conv;
1522                 const counterparty_node_id: number = bindings.LDKEvent_ChannelReady_get_counterparty_node_id(ptr);
1523                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1524                 this.counterparty_node_id = counterparty_node_id_conv;
1525                 const channel_type: bigint = bindings.LDKEvent_ChannelReady_get_channel_type(ptr);
1526                 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1527                         CommonBase.add_ref_from(channel_type_hu_conv, this);
1528                 this.channel_type = channel_type_hu_conv;
1529         }
1530 }
1531 /** A Event of type ChannelClosed */
1532 export class Event_ChannelClosed extends Event {
1533         /**
1534          * The `channel_id` of the channel which has been closed. Note that on-chain transactions
1535          * resolving the channel are likely still awaiting confirmation.
1536          */
1537         public channel_id: Uint8Array;
1538         /**
1539          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1540          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1541          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1542          * `user_channel_id` will be randomized for inbound channels.
1543          * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
1544          * zero for objects serialized with LDK versions prior to 0.0.102.
1545          * 
1546          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1547          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1548          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1549          */
1550         public user_channel_id: bigint;
1551         /**
1552          * The reason the channel was closed.
1553          */
1554         public reason: ClosureReason;
1555         /* @internal */
1556         public constructor(ptr: bigint) {
1557                 super(null, ptr);
1558                 const channel_id: number = bindings.LDKEvent_ChannelClosed_get_channel_id(ptr);
1559                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1560                 this.channel_id = channel_id_conv;
1561                 const user_channel_id: number = bindings.LDKEvent_ChannelClosed_get_user_channel_id(ptr);
1562                 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1563                 this.user_channel_id = user_channel_id_conv;
1564                 const reason: bigint = bindings.LDKEvent_ChannelClosed_get_reason(ptr);
1565                 const reason_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(reason);
1566                         CommonBase.add_ref_from(reason_hu_conv, this);
1567                 this.reason = reason_hu_conv;
1568         }
1569 }
1570 /** A Event of type DiscardFunding */
1571 export class Event_DiscardFunding extends Event {
1572         /**
1573          * The channel_id of the channel which has been closed.
1574          */
1575         public channel_id: Uint8Array;
1576         /**
1577          * The full transaction received from the user
1578          */
1579         public transaction: Uint8Array;
1580         /* @internal */
1581         public constructor(ptr: bigint) {
1582                 super(null, ptr);
1583                 const channel_id: number = bindings.LDKEvent_DiscardFunding_get_channel_id(ptr);
1584                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1585                 this.channel_id = channel_id_conv;
1586                 const transaction: number = bindings.LDKEvent_DiscardFunding_get_transaction(ptr);
1587                 const transaction_conv: Uint8Array = bindings.decodeUint8Array(transaction);
1588                 this.transaction = transaction_conv;
1589         }
1590 }
1591 /** A Event of type OpenChannelRequest */
1592 export class Event_OpenChannelRequest extends Event {
1593         /**
1594          * The temporary channel ID of the channel requested to be opened.
1595          * 
1596          * When responding to the request, the `temporary_channel_id` should be passed
1597          * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
1598          * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
1599          * 
1600          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1601          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1602          */
1603         public temporary_channel_id: Uint8Array;
1604         /**
1605          * The node_id of the counterparty requesting to open the channel.
1606          * 
1607          * When responding to the request, the `counterparty_node_id` should be passed
1608          * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
1609          * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
1610          * request.
1611          * 
1612          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1613          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1614          */
1615         public counterparty_node_id: Uint8Array;
1616         /**
1617          * The channel value of the requested channel.
1618          */
1619         public funding_satoshis: bigint;
1620         /**
1621          * Our starting balance in the channel if the request is accepted, in milli-satoshi.
1622          */
1623         public push_msat: bigint;
1624         /**
1625          * The features that this channel will operate with. If you reject the channel, a
1626          * well-behaved counterparty may automatically re-attempt the channel with a new set of
1627          * feature flags.
1628          * 
1629          * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
1630          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1631          * 0.0.106.
1632          * 
1633          * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
1634          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1635          * 0.0.107. Channels setting this type also need to get manually accepted via
1636          * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
1637          * or will be rejected otherwise.
1638          * 
1639          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1640          */
1641         public channel_type: ChannelTypeFeatures;
1642         /* @internal */
1643         public constructor(ptr: bigint) {
1644                 super(null, ptr);
1645                 const temporary_channel_id: number = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr);
1646                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
1647                 this.temporary_channel_id = temporary_channel_id_conv;
1648                 const counterparty_node_id: number = bindings.LDKEvent_OpenChannelRequest_get_counterparty_node_id(ptr);
1649                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1650                 this.counterparty_node_id = counterparty_node_id_conv;
1651                 this.funding_satoshis = bindings.LDKEvent_OpenChannelRequest_get_funding_satoshis(ptr);
1652                 this.push_msat = bindings.LDKEvent_OpenChannelRequest_get_push_msat(ptr);
1653                 const channel_type: bigint = bindings.LDKEvent_OpenChannelRequest_get_channel_type(ptr);
1654                 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1655                         CommonBase.add_ref_from(channel_type_hu_conv, this);
1656                 this.channel_type = channel_type_hu_conv;
1657         }
1658 }
1659 /** A Event of type HTLCHandlingFailed */
1660 export class Event_HTLCHandlingFailed extends Event {
1661         /**
1662          * The channel over which the HTLC was received.
1663          */
1664         public prev_channel_id: Uint8Array;
1665         /**
1666          * Destination of the HTLC that failed to be processed.
1667          */
1668         public failed_next_destination: HTLCDestination;
1669         /* @internal */
1670         public constructor(ptr: bigint) {
1671                 super(null, ptr);
1672                 const prev_channel_id: number = bindings.LDKEvent_HTLCHandlingFailed_get_prev_channel_id(ptr);
1673                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1674                 this.prev_channel_id = prev_channel_id_conv;
1675                 const failed_next_destination: bigint = bindings.LDKEvent_HTLCHandlingFailed_get_failed_next_destination(ptr);
1676                 const failed_next_destination_hu_conv: HTLCDestination = HTLCDestination.constr_from_ptr(failed_next_destination);
1677                         CommonBase.add_ref_from(failed_next_destination_hu_conv, this);
1678                 this.failed_next_destination = failed_next_destination_hu_conv;
1679         }
1680 }
1681 /** A Event of type BumpTransaction */
1682 export class Event_BumpTransaction extends Event {
1683         public bump_transaction: BumpTransactionEvent;
1684         /* @internal */
1685         public constructor(ptr: bigint) {
1686                 super(null, ptr);
1687                 const bump_transaction: bigint = bindings.LDKEvent_BumpTransaction_get_bump_transaction(ptr);
1688                 const bump_transaction_hu_conv: BumpTransactionEvent = BumpTransactionEvent.constr_from_ptr(bump_transaction);
1689                         CommonBase.add_ref_from(bump_transaction_hu_conv, this);
1690                 this.bump_transaction = bump_transaction_hu_conv;
1691         }
1692 }