[TS] Update auto-generated TS bindings to LDK 0.0.110
[ldk-java] / ts / structs / Event.mts
1 import { TxOut } from '../structs/TxOut.mjs';
2 import { AccessError } from '../enums/AccessError.mjs';
3 import { COption_NoneZ } from '../enums/COption_NoneZ.mjs';
4 import { ChannelMonitorUpdateErr } from '../enums/ChannelMonitorUpdateErr.mjs';
5 import { ConfirmationTarget } from '../enums/ConfirmationTarget.mjs';
6 import { CreationError } from '../enums/CreationError.mjs';
7 import { Currency } from '../enums/Currency.mjs';
8 import { IOError } from '../enums/IOError.mjs';
9 import { Level } from '../enums/Level.mjs';
10 import { Network } from '../enums/Network.mjs';
11 import { Recipient } from '../enums/Recipient.mjs';
12 import { Secp256k1Error } from '../enums/Secp256k1Error.mjs';
13 import { SemanticError } from '../enums/SemanticError.mjs';
14 import { SiPrefix } from '../enums/SiPrefix.mjs';
15 import { Bech32Error } from '../structs/Bech32Error.mjs';
16 import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs';
17 import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs';
18 import { DecodeError } from '../structs/DecodeError.mjs';
19 import { Result_CounterpartyCommitmentSecretsDecodeErrorZ } from '../structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.mjs';
20 import { Result_SecretKeyErrorZ } from '../structs/Result_SecretKeyErrorZ.mjs';
21 import { Result_PublicKeyErrorZ } from '../structs/Result_PublicKeyErrorZ.mjs';
22 import { TxCreationKeys } from '../structs/TxCreationKeys.mjs';
23 import { Result_TxCreationKeysDecodeErrorZ } from '../structs/Result_TxCreationKeysDecodeErrorZ.mjs';
24 import { ChannelPublicKeys } from '../structs/ChannelPublicKeys.mjs';
25 import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelPublicKeysDecodeErrorZ.mjs';
26 import { Result_TxCreationKeysErrorZ } from '../structs/Result_TxCreationKeysErrorZ.mjs';
27 import { Option_u32Z } from '../structs/Option_u32Z.mjs';
28 import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs';
29 import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs';
30 import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs';
31 import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs';
32 import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs';
33 import { Result_ChannelTransactionParametersDecodeErrorZ } from '../structs/Result_ChannelTransactionParametersDecodeErrorZ.mjs';
34 import { HolderCommitmentTransaction } from '../structs/HolderCommitmentTransaction.mjs';
35 import { Result_HolderCommitmentTransactionDecodeErrorZ } from '../structs/Result_HolderCommitmentTransactionDecodeErrorZ.mjs';
36 import { BuiltCommitmentTransaction } from '../structs/BuiltCommitmentTransaction.mjs';
37 import { Result_BuiltCommitmentTransactionDecodeErrorZ } from '../structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mjs';
38 import { TrustedClosingTransaction } from '../structs/TrustedClosingTransaction.mjs';
39 import { Result_TrustedClosingTransactionNoneZ } from '../structs/Result_TrustedClosingTransactionNoneZ.mjs';
40 import { CommitmentTransaction } from '../structs/CommitmentTransaction.mjs';
41 import { Result_CommitmentTransactionDecodeErrorZ } from '../structs/Result_CommitmentTransactionDecodeErrorZ.mjs';
42 import { TrustedCommitmentTransaction } from '../structs/TrustedCommitmentTransaction.mjs';
43 import { Result_TrustedCommitmentTransactionNoneZ } from '../structs/Result_TrustedCommitmentTransactionNoneZ.mjs';
44 import { Result_CVec_SignatureZNoneZ } from '../structs/Result_CVec_SignatureZNoneZ.mjs';
45 import { ShutdownScript } from '../structs/ShutdownScript.mjs';
46 import { Result_ShutdownScriptDecodeErrorZ } from '../structs/Result_ShutdownScriptDecodeErrorZ.mjs';
47 import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs';
48 import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs';
49 import { RouteHop } from '../structs/RouteHop.mjs';
50 import { Result_RouteHopDecodeErrorZ } from '../structs/Result_RouteHopDecodeErrorZ.mjs';
51 import { Route } from '../structs/Route.mjs';
52 import { Result_RouteDecodeErrorZ } from '../structs/Result_RouteDecodeErrorZ.mjs';
53 import { RouteParameters } from '../structs/RouteParameters.mjs';
54 import { Result_RouteParametersDecodeErrorZ } from '../structs/Result_RouteParametersDecodeErrorZ.mjs';
55 import { RouteHint } from '../structs/RouteHint.mjs';
56 import { Option_u64Z } from '../structs/Option_u64Z.mjs';
57 import { PaymentParameters } from '../structs/PaymentParameters.mjs';
58 import { Result_PaymentParametersDecodeErrorZ } from '../structs/Result_PaymentParametersDecodeErrorZ.mjs';
59 import { RouteHintHop } from '../structs/RouteHintHop.mjs';
60 import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs';
61 import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs';
62 import { ChannelDetails } from '../structs/ChannelDetails.mjs';
63 import { LightningError } from '../structs/LightningError.mjs';
64 import { Result_RouteLightningErrorZ } from '../structs/Result_RouteLightningErrorZ.mjs';
65 import { PaymentPurpose } from '../structs/PaymentPurpose.mjs';
66 import { Result_PaymentPurposeDecodeErrorZ } from '../structs/Result_PaymentPurposeDecodeErrorZ.mjs';
67 import { ClosureReason } from '../structs/ClosureReason.mjs';
68 import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
69 import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
70 import { HTLCDestination } from '../structs/HTLCDestination.mjs';
71 import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs';
72 import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs';
73 import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
74 import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
75 import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
76 import { OutPoint } from '../structs/OutPoint.mjs';
77 import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs';
78 import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs';
79 import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs';
80 import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs';
81 import { Option_EventZ } from '../structs/Option_EventZ.mjs';
82 import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs';
83 import { AcceptChannel } from '../structs/AcceptChannel.mjs';
84 import { OpenChannel } from '../structs/OpenChannel.mjs';
85 import { FundingCreated } from '../structs/FundingCreated.mjs';
86 import { FundingSigned } from '../structs/FundingSigned.mjs';
87 import { ChannelReady } from '../structs/ChannelReady.mjs';
88 import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs';
89 import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs';
90 import { RevokeAndACK } from '../structs/RevokeAndACK.mjs';
91 import { ClosingSigned } from '../structs/ClosingSigned.mjs';
92 import { Shutdown } from '../structs/Shutdown.mjs';
93 import { ChannelReestablish } from '../structs/ChannelReestablish.mjs';
94 import { ChannelAnnouncement } from '../structs/ChannelAnnouncement.mjs';
95 import { NodeAnnouncement } from '../structs/NodeAnnouncement.mjs';
96 import { ErrorMessage } from '../structs/ErrorMessage.mjs';
97 import { WarningMessage } from '../structs/WarningMessage.mjs';
98 import { ErrorAction } from '../structs/ErrorAction.mjs';
99 import { QueryChannelRange } from '../structs/QueryChannelRange.mjs';
100 import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs';
101 import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs';
102 import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs';
103 import { MessageSendEvent } from '../structs/MessageSendEvent.mjs';
104 import { Result_TxOutAccessErrorZ } from '../structs/Result_TxOutAccessErrorZ.mjs';
105 import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs';
106 import { Result_NoneChannelMonitorUpdateErrZ } from '../structs/Result_NoneChannelMonitorUpdateErrZ.mjs';
107 import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
108 import { MonitorEvent } from '../structs/MonitorEvent.mjs';
109 import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs';
110 import { Option_C2Tuple_usizeTransactionZZ } from '../structs/Option_C2Tuple_usizeTransactionZZ.mjs';
111 import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
112 import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
113 import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs';
114 import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs';
115 import { NodeId } from '../structs/NodeId.mjs';
116 import { Record } from '../structs/Record.mjs';
117 import { Logger, LoggerInterface } from '../structs/Logger.mjs';
118 import { NetworkGraph } from '../structs/NetworkGraph.mjs';
119 import { ProbabilisticScorer } from '../structs/ProbabilisticScorer.mjs';
120 import { Result_ProbabilisticScorerDecodeErrorZ } from '../structs/Result_ProbabilisticScorerDecodeErrorZ.mjs';
121 import { InitFeatures } from '../structs/InitFeatures.mjs';
122 import { Result_InitFeaturesDecodeErrorZ } from '../structs/Result_InitFeaturesDecodeErrorZ.mjs';
123 import { ChannelFeatures } from '../structs/ChannelFeatures.mjs';
124 import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs';
125 import { NodeFeatures } from '../structs/NodeFeatures.mjs';
126 import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs';
127 import { InvoiceFeatures } from '../structs/InvoiceFeatures.mjs';
128 import { Result_InvoiceFeaturesDecodeErrorZ } from '../structs/Result_InvoiceFeaturesDecodeErrorZ.mjs';
129 import { Result_ChannelTypeFeaturesDecodeErrorZ } from '../structs/Result_ChannelTypeFeaturesDecodeErrorZ.mjs';
130 import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs';
131 import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs';
132 import { Access, AccessInterface } from '../structs/Access.mjs';
133 import { Option_AccessZ } from '../structs/Option_AccessZ.mjs';
134 import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs';
135 import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs';
136 import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs';
137 import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs';
138 import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs';
139 import { ChannelInfo } from '../structs/ChannelInfo.mjs';
140 import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
141 import { RoutingFees } from '../structs/RoutingFees.mjs';
142 import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
143 import { Hostname } from '../structs/Hostname.mjs';
144 import { NetAddress } from '../structs/NetAddress.mjs';
145 import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
146 import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
147 import { NodeAlias } from '../structs/NodeAlias.mjs';
148 import { Result_NodeAliasDecodeErrorZ } from '../structs/Result_NodeAliasDecodeErrorZ.mjs';
149 import { NodeInfo } from '../structs/NodeInfo.mjs';
150 import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs';
151 import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs';
152 import { Option_CVec_NetAddressZZ } from '../structs/Option_CVec_NetAddressZZ.mjs';
153 import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs';
154 import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs';
155 import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs';
156 import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs';
157 import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs';
158 import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs';
159 import { TwoTuple_SignatureSignatureZ } from '../structs/TwoTuple_SignatureSignatureZ.mjs';
160 import { Result_C2Tuple_SignatureSignatureZNoneZ } from '../structs/Result_C2Tuple_SignatureSignatureZNoneZ.mjs';
161 import { Result_SecretKeyNoneZ } from '../structs/Result_SecretKeyNoneZ.mjs';
162 import { ClosingTransaction } from '../structs/ClosingTransaction.mjs';
163 import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs';
164 import { BaseSign, BaseSignInterface } from '../structs/BaseSign.mjs';
165 import { Sign, SignInterface } from '../structs/Sign.mjs';
166 import { Result_SignDecodeErrorZ } from '../structs/Result_SignDecodeErrorZ.mjs';
167 import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs';
168 import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs';
169 import { InMemorySigner } from '../structs/InMemorySigner.mjs';
170 import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs';
171 import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs';
172 import { Option_u16Z } from '../structs/Option_u16Z.mjs';
173 import { APIError } from '../structs/APIError.mjs';
174 import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs';
175 import { Result__u832APIErrorZ } from '../structs/Result__u832APIErrorZ.mjs';
176 import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs';
177 import { Result_PaymentIdPaymentSendFailureZ } from '../structs/Result_PaymentIdPaymentSendFailureZ.mjs';
178 import { Result_NonePaymentSendFailureZ } from '../structs/Result_NonePaymentSendFailureZ.mjs';
179 import { TwoTuple_PaymentHashPaymentIdZ } from '../structs/TwoTuple_PaymentHashPaymentIdZ.mjs';
180 import { Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ } from '../structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mjs';
181 import { TwoTuple_PaymentHashPaymentSecretZ } from '../structs/TwoTuple_PaymentHashPaymentSecretZ.mjs';
182 import { Result_C2Tuple_PaymentHashPaymentSecretZNoneZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mjs';
183 import { Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mjs';
184 import { Result_PaymentSecretNoneZ } from '../structs/Result_PaymentSecretNoneZ.mjs';
185 import { Result_PaymentSecretAPIErrorZ } from '../structs/Result_PaymentSecretAPIErrorZ.mjs';
186 import { Result_PaymentPreimageAPIErrorZ } from '../structs/Result_PaymentPreimageAPIErrorZ.mjs';
187 import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs';
188 import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs';
189 import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs';
190 import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_ChannelCounterpartyDecodeErrorZ.mjs';
191 import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs';
192 import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs';
193 import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs';
194 import { ChannelMonitor } from '../structs/ChannelMonitor.mjs';
195 import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs';
196 import { Watch, WatchInterface } from '../structs/Watch.mjs';
197 import { BroadcasterInterface, BroadcasterInterfaceInterface } from '../structs/BroadcasterInterface.mjs';
198 import { KeysInterface, KeysInterfaceInterface } from '../structs/KeysInterface.mjs';
199 import { FeeEstimator, FeeEstimatorInterface } from '../structs/FeeEstimator.mjs';
200 import { ChannelManager } from '../structs/ChannelManager.mjs';
201 import { TwoTuple_BlockHashChannelManagerZ } from '../structs/TwoTuple_BlockHashChannelManagerZ.mjs';
202 import { Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mjs';
203 import { ChannelConfig } from '../structs/ChannelConfig.mjs';
204 import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs';
205 import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs';
206 import { Type, TypeInterface } from '../structs/Type.mjs';
207 import { Option_TypeZ } from '../structs/Option_TypeZ.mjs';
208 import { Result_COption_TypeZDecodeErrorZ } from '../structs/Result_COption_TypeZDecodeErrorZ.mjs';
209 import { PaymentError } from '../structs/PaymentError.mjs';
210 import { Result_PaymentIdPaymentErrorZ } from '../structs/Result_PaymentIdPaymentErrorZ.mjs';
211 import { ParseError } from '../structs/ParseError.mjs';
212 import { Result_SiPrefixParseErrorZ } from '../structs/Result_SiPrefixParseErrorZ.mjs';
213 import { Invoice } from '../structs/Invoice.mjs';
214 import { ParseOrSemanticError } from '../structs/ParseOrSemanticError.mjs';
215 import { Result_InvoiceParseOrSemanticErrorZ } from '../structs/Result_InvoiceParseOrSemanticErrorZ.mjs';
216 import { SignedRawInvoice } from '../structs/SignedRawInvoice.mjs';
217 import { Result_SignedRawInvoiceParseErrorZ } from '../structs/Result_SignedRawInvoiceParseErrorZ.mjs';
218 import { RawInvoice } from '../structs/RawInvoice.mjs';
219 import { InvoiceSignature } from '../structs/InvoiceSignature.mjs';
220 import { ThreeTuple_RawInvoice_u832InvoiceSignatureZ } from '../structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.mjs';
221 import { PayeePubKey } from '../structs/PayeePubKey.mjs';
222 import { Result_PayeePubKeyErrorZ } from '../structs/Result_PayeePubKeyErrorZ.mjs';
223 import { PrivateRoute } from '../structs/PrivateRoute.mjs';
224 import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs';
225 import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs';
226 import { Result_NoneSemanticErrorZ } from '../structs/Result_NoneSemanticErrorZ.mjs';
227 import { Result_InvoiceSemanticErrorZ } from '../structs/Result_InvoiceSemanticErrorZ.mjs';
228 import { Description } from '../structs/Description.mjs';
229 import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs';
230 import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs';
231 import { Result_StringErrorZ } from '../structs/Result_StringErrorZ.mjs';
232 import { Result_ChannelMonitorUpdateDecodeErrorZ } from '../structs/Result_ChannelMonitorUpdateDecodeErrorZ.mjs';
233 import { Option_MonitorEventZ } from '../structs/Option_MonitorEventZ.mjs';
234 import { Result_COption_MonitorEventZDecodeErrorZ } from '../structs/Result_COption_MonitorEventZDecodeErrorZ.mjs';
235 import { Result_HTLCUpdateDecodeErrorZ } from '../structs/Result_HTLCUpdateDecodeErrorZ.mjs';
236 import { TwoTuple_OutPointScriptZ } from '../structs/TwoTuple_OutPointScriptZ.mjs';
237 import { TwoTuple_u32ScriptZ } from '../structs/TwoTuple_u32ScriptZ.mjs';
238 import { TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mjs';
239 import { TwoTuple_u32TxOutZ } from '../structs/TwoTuple_u32TxOutZ.mjs';
240 import { TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mjs';
241 import { Balance } from '../structs/Balance.mjs';
242 import { TwoTuple_BlockHashChannelMonitorZ } from '../structs/TwoTuple_BlockHashChannelMonitorZ.mjs';
243 import { Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mjs';
244 import { TwoTuple_PublicKeyTypeZ } from '../structs/TwoTuple_PublicKeyTypeZ.mjs';
245 import { Option_NetAddressZ } from '../structs/Option_NetAddressZ.mjs';
246 import { PeerHandleError } from '../structs/PeerHandleError.mjs';
247 import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs';
248 import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs';
249 import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs';
250 import { Result_NoneErrorZ } from '../structs/Result_NoneErrorZ.mjs';
251 import { Result_NetAddressDecodeErrorZ } from '../structs/Result_NetAddressDecodeErrorZ.mjs';
252 import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs';
253 import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs';
254 import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs';
255 import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs';
256 import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs';
257 import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs';
258 import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs';
259 import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs';
260 import { ClosingSignedFeeRange } from '../structs/ClosingSignedFeeRange.mjs';
261 import { Result_ClosingSignedFeeRangeDecodeErrorZ } from '../structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mjs';
262 import { CommitmentSigned } from '../structs/CommitmentSigned.mjs';
263 import { Result_CommitmentSignedDecodeErrorZ } from '../structs/Result_CommitmentSignedDecodeErrorZ.mjs';
264 import { Result_FundingCreatedDecodeErrorZ } from '../structs/Result_FundingCreatedDecodeErrorZ.mjs';
265 import { Result_FundingSignedDecodeErrorZ } from '../structs/Result_FundingSignedDecodeErrorZ.mjs';
266 import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyDecodeErrorZ.mjs';
267 import { Init } from '../structs/Init.mjs';
268 import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs';
269 import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs';
270 import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs';
271 import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
272 import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs';
273 import { Result_UpdateFailMalformedHTLCDecodeErrorZ } from '../structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mjs';
274 import { UpdateFee } from '../structs/UpdateFee.mjs';
275 import { Result_UpdateFeeDecodeErrorZ } from '../structs/Result_UpdateFeeDecodeErrorZ.mjs';
276 import { Result_UpdateFulfillHTLCDecodeErrorZ } from '../structs/Result_UpdateFulfillHTLCDecodeErrorZ.mjs';
277 import { Result_UpdateAddHTLCDecodeErrorZ } from '../structs/Result_UpdateAddHTLCDecodeErrorZ.mjs';
278 import { Ping } from '../structs/Ping.mjs';
279 import { Result_PingDecodeErrorZ } from '../structs/Result_PingDecodeErrorZ.mjs';
280 import { Pong } from '../structs/Pong.mjs';
281 import { Result_PongDecodeErrorZ } from '../structs/Result_PongDecodeErrorZ.mjs';
282 import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs';
283 import { Result_ChannelAnnouncementDecodeErrorZ } from '../structs/Result_ChannelAnnouncementDecodeErrorZ.mjs';
284 import { UnsignedChannelUpdate } from '../structs/UnsignedChannelUpdate.mjs';
285 import { Result_UnsignedChannelUpdateDecodeErrorZ } from '../structs/Result_UnsignedChannelUpdateDecodeErrorZ.mjs';
286 import { Result_ChannelUpdateDecodeErrorZ } from '../structs/Result_ChannelUpdateDecodeErrorZ.mjs';
287 import { Result_ErrorMessageDecodeErrorZ } from '../structs/Result_ErrorMessageDecodeErrorZ.mjs';
288 import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs';
289 import { UnsignedNodeAnnouncement } from '../structs/UnsignedNodeAnnouncement.mjs';
290 import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
291 import { Result_NodeAnnouncementDecodeErrorZ } from '../structs/Result_NodeAnnouncementDecodeErrorZ.mjs';
292 import { Result_QueryShortChannelIdsDecodeErrorZ } from '../structs/Result_QueryShortChannelIdsDecodeErrorZ.mjs';
293 import { ReplyShortChannelIdsEnd } from '../structs/ReplyShortChannelIdsEnd.mjs';
294 import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mjs';
295 import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs';
296 import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs';
297 import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs';
298 import { SignOrCreationError } from '../structs/SignOrCreationError.mjs';
299 import { Result_InvoiceSignOrCreationErrorZ } from '../structs/Result_InvoiceSignOrCreationErrorZ.mjs';
300 import { WatchedOutput } from '../structs/WatchedOutput.mjs';
301 import { Filter, FilterInterface } from '../structs/Filter.mjs';
302 import { Option_FilterZ } from '../structs/Option_FilterZ.mjs';
303 import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs';
304 import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs';
305 import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs';
306 import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs';
307 import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs';
308 import { BigSize } from '../structs/BigSize.mjs';
309 import { ChannelUsage } from '../structs/ChannelUsage.mjs';
310 import { Score, ScoreInterface } from '../structs/Score.mjs';
311 import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs';
312 import { Persister, PersisterInterface } from '../structs/Persister.mjs';
313 import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs';
314 import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs';
315 import { UserConfig } from '../structs/UserConfig.mjs';
316 import { BestBlock } from '../structs/BestBlock.mjs';
317 import { Listen, ListenInterface } from '../structs/Listen.mjs';
318 import { Confirm, ConfirmInterface } from '../structs/Confirm.mjs';
319 import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs';
320 import { Persist, PersistInterface } from '../structs/Persist.mjs';
321 import { ChainMonitor } from '../structs/ChainMonitor.mjs';
322 import { KeysManager } from '../structs/KeysManager.mjs';
323 import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs';
324 import { ChainParameters } from '../structs/ChainParameters.mjs';
325 import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs';
326 import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs';
327 import { ExpandedKey } from '../structs/ExpandedKey.mjs';
328 import { DataLossProtect } from '../structs/DataLossProtect.mjs';
329 import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs';
330 import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs';
331 import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs';
332 import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs';
333 import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs';
334 import { MessageHandler } from '../structs/MessageHandler.mjs';
335 import { SocketDescriptor, SocketDescriptorInterface } from '../structs/SocketDescriptor.mjs';
336 import { PeerManager } from '../structs/PeerManager.mjs';
337 import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs';
338 import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs';
339 import { P2PGossipSync } from '../structs/P2PGossipSync.mjs';
340 import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs';
341 import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs';
342 import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs';
343 import { ProbabilisticScoringParameters } from '../structs/ProbabilisticScoringParameters.mjs';
344 import { RawDataPart } from '../structs/RawDataPart.mjs';
345 import { Sha256 } from '../structs/Sha256.mjs';
346 import { ExpiryTime } from '../structs/ExpiryTime.mjs';
347 import { MinFinalCltvExpiry } from '../structs/MinFinalCltvExpiry.mjs';
348 import { Fallback } from '../structs/Fallback.mjs';
349 import { Payer, PayerInterface } from '../structs/Payer.mjs';
350 import { Router, RouterInterface } from '../structs/Router.mjs';
351 import { InvoicePayer } from '../structs/InvoicePayer.mjs';
352 import { Retry } from '../structs/Retry.mjs';
353 import { DefaultRouter } from '../structs/DefaultRouter.mjs';
354
355 import { CommonBase, UInt5, WitnessVersion, UnqualifiedError } from './CommonBase.mjs';
356 import * as bindings from '../bindings.mjs'
357
358 /**
359  * An Event which you should probably take some action in response to.
360  * 
361  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
362  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
363  * written as it makes no sense to respond to it after reconnecting to peers).
364  */
365 export class Event extends CommonBase {
366         protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.Event_free); }
367         /* @internal */
368         public static constr_from_ptr(ptr: number): Event {
369                 const raw_ty: number = bindings.LDKEvent_ty_from_ptr(ptr);
370                 switch (raw_ty) {
371                         case 0: return new Event_FundingGenerationReady(ptr);
372                         case 1: return new Event_PaymentReceived(ptr);
373                         case 2: return new Event_PaymentClaimed(ptr);
374                         case 3: return new Event_PaymentSent(ptr);
375                         case 4: return new Event_PaymentFailed(ptr);
376                         case 5: return new Event_PaymentPathSuccessful(ptr);
377                         case 6: return new Event_PaymentPathFailed(ptr);
378                         case 7: return new Event_ProbeSuccessful(ptr);
379                         case 8: return new Event_ProbeFailed(ptr);
380                         case 9: return new Event_PendingHTLCsForwardable(ptr);
381                         case 10: return new Event_SpendableOutputs(ptr);
382                         case 11: return new Event_PaymentForwarded(ptr);
383                         case 12: return new Event_ChannelClosed(ptr);
384                         case 13: return new Event_DiscardFunding(ptr);
385                         case 14: return new Event_OpenChannelRequest(ptr);
386                         case 15: return new Event_HTLCHandlingFailed(ptr);
387                         default:
388                                 throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
389                 }
390         }
391
392         public clone_ptr(): number {
393                 const ret: number = bindings.Event_clone_ptr(this.ptr);
394                 return ret;
395         }
396
397         /**
398          * Creates a copy of the Event
399          */
400         public clone(): Event {
401                 const ret: number = bindings.Event_clone(this.ptr);
402                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
403                 CommonBase.add_ref_from(ret_hu_conv, this);
404                 return ret_hu_conv;
405         }
406
407         /**
408          * Utility method to constructs a new FundingGenerationReady-variant Event
409          */
410         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 {
411                 const ret: number = 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), user_channel_id);
412                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
413                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
414                 return ret_hu_conv;
415         }
416
417         /**
418          * Utility method to constructs a new PaymentReceived-variant Event
419          */
420         public static constructor_payment_received(payment_hash: Uint8Array, amount_msat: bigint, purpose: PaymentPurpose): Event {
421                 const ret: number = bindings.Event_payment_received(bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), amount_msat, CommonBase.get_ptr_of(purpose));
422                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
423                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
424                 return ret_hu_conv;
425         }
426
427         /**
428          * Utility method to constructs a new PaymentClaimed-variant Event
429          */
430         public static constructor_payment_claimed(payment_hash: Uint8Array, amount_msat: bigint, purpose: PaymentPurpose): Event {
431                 const ret: number = bindings.Event_payment_claimed(bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), amount_msat, CommonBase.get_ptr_of(purpose));
432                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
433                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
434                 return ret_hu_conv;
435         }
436
437         /**
438          * Utility method to constructs a new PaymentSent-variant Event
439          */
440         public static constructor_payment_sent(payment_id: Uint8Array, payment_preimage: Uint8Array, payment_hash: Uint8Array, fee_paid_msat: Option_u64Z): Event {
441                 const ret: number = bindings.Event_payment_sent(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), 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));
442                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
443                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
444                 return ret_hu_conv;
445         }
446
447         /**
448          * Utility method to constructs a new PaymentFailed-variant Event
449          */
450         public static constructor_payment_failed(payment_id: Uint8Array, payment_hash: Uint8Array): Event {
451                 const ret: number = bindings.Event_payment_failed(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)));
452                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
453                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
454                 return ret_hu_conv;
455         }
456
457         /**
458          * Utility method to constructs a new PaymentPathSuccessful-variant Event
459          */
460         public static constructor_payment_path_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[]): Event {
461                 const ret: number = bindings.Event_payment_path_successful(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeUint32Array(path != null ? path.map(path_conv_10 => path_conv_10 == null ? 0 : CommonBase.get_ptr_of(path_conv_10) & ~1) : null));
462                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
463                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
464                 return ret_hu_conv;
465         }
466
467         /**
468          * Utility method to constructs a new PaymentPathFailed-variant Event
469          */
470         public static constructor_payment_path_failed(payment_id: Uint8Array, payment_hash: Uint8Array, rejected_by_dest: boolean, network_update: Option_NetworkUpdateZ, all_paths_failed: boolean, path: RouteHop[], short_channel_id: Option_u64Z, retry: RouteParameters): Event {
471                 const ret: number = bindings.Event_payment_path_failed(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), rejected_by_dest, CommonBase.get_ptr_of(network_update), all_paths_failed, bindings.encodeUint32Array(path != null ? path.map(path_conv_10 => path_conv_10 == null ? 0 : CommonBase.get_ptr_of(path_conv_10) & ~1) : null), CommonBase.get_ptr_of(short_channel_id), retry == null ? 0 : CommonBase.get_ptr_of(retry) & ~1);
472                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
473                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
474                 return ret_hu_conv;
475         }
476
477         /**
478          * Utility method to constructs a new ProbeSuccessful-variant Event
479          */
480         public static constructor_probe_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[]): Event {
481                 const ret: number = bindings.Event_probe_successful(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeUint32Array(path != null ? path.map(path_conv_10 => path_conv_10 == null ? 0 : CommonBase.get_ptr_of(path_conv_10) & ~1) : null));
482                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
483                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
484                 return ret_hu_conv;
485         }
486
487         /**
488          * Utility method to constructs a new ProbeFailed-variant Event
489          */
490         public static constructor_probe_failed(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[], short_channel_id: Option_u64Z): Event {
491                 const ret: number = bindings.Event_probe_failed(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeUint32Array(path != null ? path.map(path_conv_10 => path_conv_10 == null ? 0 : CommonBase.get_ptr_of(path_conv_10) & ~1) : null), CommonBase.get_ptr_of(short_channel_id));
492                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
493                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
494                 return ret_hu_conv;
495         }
496
497         /**
498          * Utility method to constructs a new PendingHTLCsForwardable-variant Event
499          */
500         public static constructor_pending_htlcs_forwardable(time_forwardable: bigint): Event {
501                 const ret: number = bindings.Event_pending_htlcs_forwardable(time_forwardable);
502                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
503                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
504                 return ret_hu_conv;
505         }
506
507         /**
508          * Utility method to constructs a new SpendableOutputs-variant Event
509          */
510         public static constructor_spendable_outputs(outputs: SpendableOutputDescriptor[]): Event {
511                 const ret: number = bindings.Event_spendable_outputs(bindings.encodeUint32Array(outputs != null ? outputs.map(outputs_conv_27 => CommonBase.get_ptr_of(outputs_conv_27)) : null));
512                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
513                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
514                 return ret_hu_conv;
515         }
516
517         /**
518          * Utility method to constructs a new PaymentForwarded-variant Event
519          */
520         public static constructor_payment_forwarded(prev_channel_id: Uint8Array, next_channel_id: Uint8Array, fee_earned_msat: Option_u64Z, claim_from_onchain_tx: boolean): Event {
521                 const ret: number = 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);
522                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
523                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
524                 return ret_hu_conv;
525         }
526
527         /**
528          * Utility method to constructs a new ChannelClosed-variant Event
529          */
530         public static constructor_channel_closed(channel_id: Uint8Array, user_channel_id: bigint, reason: ClosureReason): Event {
531                 const ret: number = bindings.Event_channel_closed(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), user_channel_id, CommonBase.get_ptr_of(reason));
532                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
533                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
534                 return ret_hu_conv;
535         }
536
537         /**
538          * Utility method to constructs a new DiscardFunding-variant Event
539          */
540         public static constructor_discard_funding(channel_id: Uint8Array, transaction: Uint8Array): Event {
541                 const ret: number = bindings.Event_discard_funding(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(transaction));
542                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
543                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
544                 return ret_hu_conv;
545         }
546
547         /**
548          * Utility method to constructs a new OpenChannelRequest-variant Event
549          */
550         public static constructor_open_channel_request(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_satoshis: bigint, push_msat: bigint, channel_type: ChannelTypeFeatures): Event {
551                 const ret: number = 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 ? 0 : CommonBase.get_ptr_of(channel_type) & ~1);
552                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
553                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
554                 return ret_hu_conv;
555         }
556
557         /**
558          * Utility method to constructs a new HTLCHandlingFailed-variant Event
559          */
560         public static constructor_htlchandling_failed(prev_channel_id: Uint8Array, failed_next_destination: HTLCDestination): Event {
561                 const ret: number = bindings.Event_htlchandling_failed(bindings.encodeUint8Array(bindings.check_arr_len(prev_channel_id, 32)), CommonBase.get_ptr_of(failed_next_destination));
562                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
563                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
564                 return ret_hu_conv;
565         }
566
567         /**
568          * Serialize the Event object into a byte array which can be read by Event_read
569          */
570         public write(): Uint8Array {
571                 const ret: number = bindings.Event_write(this.ptr);
572                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
573                 return ret_conv;
574         }
575
576 }
577 /** A Event of type FundingGenerationReady */
578 export class Event_FundingGenerationReady extends Event {
579         /**
580          * The random channel_id we picked which you'll need to pass into
581          * [`ChannelManager::funding_transaction_generated`].
582          * 
583          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
584          */
585         public temporary_channel_id: Uint8Array;
586         /**
587          * The counterparty's node_id, which you'll need to pass back into
588          * [`ChannelManager::funding_transaction_generated`].
589          * 
590          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
591          */
592         public counterparty_node_id: Uint8Array;
593         /**
594          * The value, in satoshis, that the output should have.
595          */
596         public channel_value_satoshis: bigint;
597         /**
598          * The script which should be used in the transaction output.
599          */
600         public output_script: Uint8Array;
601         /**
602          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
603          * an inbound channel.
604          * 
605          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
606          */
607         public user_channel_id: bigint;
608         /* @internal */
609         public constructor(ptr: number) {
610                 super(null, ptr);
611                 const temporary_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr);
612                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
613                 this.temporary_channel_id = temporary_channel_id_conv;
614                 const counterparty_node_id: number = bindings.LDKEvent_FundingGenerationReady_get_counterparty_node_id(ptr);
615                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
616                 this.counterparty_node_id = counterparty_node_id_conv;
617                 this.channel_value_satoshis = bindings.LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr);
618                 const output_script: number = bindings.LDKEvent_FundingGenerationReady_get_output_script(ptr);
619                 const output_script_conv: Uint8Array = bindings.decodeUint8Array(output_script);
620                 this.output_script = output_script_conv;
621                 this.user_channel_id = bindings.LDKEvent_FundingGenerationReady_get_user_channel_id(ptr);
622         }
623 }
624 /** A Event of type PaymentReceived */
625 export class Event_PaymentReceived extends Event {
626         /**
627          * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
628          * not stop you from registering duplicate payment hashes for inbound payments.
629          */
630         public payment_hash: Uint8Array;
631         /**
632          * The value, in thousandths of a satoshi, that this payment is for.
633          */
634         public amount_msat: bigint;
635         /**
636          * Information for claiming this received payment, based on whether the purpose of the
637          * payment is to pay an invoice or to send a spontaneous payment.
638          */
639         public purpose: PaymentPurpose;
640         /* @internal */
641         public constructor(ptr: number) {
642                 super(null, ptr);
643                 const payment_hash: number = bindings.LDKEvent_PaymentReceived_get_payment_hash(ptr);
644                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
645                 this.payment_hash = payment_hash_conv;
646                 this.amount_msat = bindings.LDKEvent_PaymentReceived_get_amount_msat(ptr);
647                 const purpose: number = bindings.LDKEvent_PaymentReceived_get_purpose(ptr);
648                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
649                         CommonBase.add_ref_from(purpose_hu_conv, this);
650                 this.purpose = purpose_hu_conv;
651         }
652 }
653 /** A Event of type PaymentClaimed */
654 export class Event_PaymentClaimed extends Event {
655         /**
656          * The payment hash of the claimed payment. Note that LDK will not stop you from
657          * registering duplicate payment hashes for inbound payments.
658          */
659         public payment_hash: Uint8Array;
660         /**
661          * The value, in thousandths of a satoshi, that this payment is for.
662          */
663         public amount_msat: bigint;
664         /**
665          * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
666          * spontaneous payment.
667          */
668         public purpose: PaymentPurpose;
669         /* @internal */
670         public constructor(ptr: number) {
671                 super(null, ptr);
672                 const payment_hash: number = bindings.LDKEvent_PaymentClaimed_get_payment_hash(ptr);
673                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
674                 this.payment_hash = payment_hash_conv;
675                 this.amount_msat = bindings.LDKEvent_PaymentClaimed_get_amount_msat(ptr);
676                 const purpose: number = bindings.LDKEvent_PaymentClaimed_get_purpose(ptr);
677                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
678                         CommonBase.add_ref_from(purpose_hu_conv, this);
679                 this.purpose = purpose_hu_conv;
680         }
681 }
682 /** A Event of type PaymentSent */
683 export class Event_PaymentSent extends Event {
684         /**
685          * The id returned by [`ChannelManager::send_payment`] and used with
686          * [`ChannelManager::retry_payment`].
687          * 
688          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
689          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
690          * 
691          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
692          */
693         public payment_id: Uint8Array;
694         /**
695          * The preimage to the hash given to ChannelManager::send_payment.
696          * Note that this serves as a payment receipt, if you wish to have such a thing, you must
697          * store it somehow!
698          */
699         public payment_preimage: Uint8Array;
700         /**
701          * The hash that was given to [`ChannelManager::send_payment`].
702          * 
703          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
704          */
705         public payment_hash: Uint8Array;
706         /**
707          * The total fee which was spent at intermediate hops in this payment, across all paths.
708          * 
709          * Note that, like [`Route::get_total_fees`] this does *not* include any potential
710          * overpayment to the recipient node.
711          * 
712          * If the recipient or an intermediate node misbehaves and gives us free money, this may
713          * overstate the amount paid, though this is unlikely.
714          * 
715          * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
716          */
717         public fee_paid_msat: Option_u64Z;
718         /* @internal */
719         public constructor(ptr: number) {
720                 super(null, ptr);
721                 const payment_id: number = bindings.LDKEvent_PaymentSent_get_payment_id(ptr);
722                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
723                 this.payment_id = payment_id_conv;
724                 const payment_preimage: number = bindings.LDKEvent_PaymentSent_get_payment_preimage(ptr);
725                 const payment_preimage_conv: Uint8Array = bindings.decodeUint8Array(payment_preimage);
726                 this.payment_preimage = payment_preimage_conv;
727                 const payment_hash: number = bindings.LDKEvent_PaymentSent_get_payment_hash(ptr);
728                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
729                 this.payment_hash = payment_hash_conv;
730                 const fee_paid_msat: number = bindings.LDKEvent_PaymentSent_get_fee_paid_msat(ptr);
731                 const fee_paid_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_paid_msat);
732                         CommonBase.add_ref_from(fee_paid_msat_hu_conv, this);
733                 this.fee_paid_msat = fee_paid_msat_hu_conv;
734         }
735 }
736 /** A Event of type PaymentFailed */
737 export class Event_PaymentFailed extends Event {
738         /**
739          * The id returned by [`ChannelManager::send_payment`] and used with
740          * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
741          * 
742          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
743          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
744          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
745          */
746         public payment_id: Uint8Array;
747         /**
748          * The hash that was given to [`ChannelManager::send_payment`].
749          * 
750          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
751          */
752         public payment_hash: Uint8Array;
753         /* @internal */
754         public constructor(ptr: number) {
755                 super(null, ptr);
756                 const payment_id: number = bindings.LDKEvent_PaymentFailed_get_payment_id(ptr);
757                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
758                 this.payment_id = payment_id_conv;
759                 const payment_hash: number = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr);
760                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
761                 this.payment_hash = payment_hash_conv;
762         }
763 }
764 /** A Event of type PaymentPathSuccessful */
765 export class Event_PaymentPathSuccessful extends Event {
766         /**
767          * The id returned by [`ChannelManager::send_payment`] and used with
768          * [`ChannelManager::retry_payment`].
769          * 
770          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
771          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
772          */
773         public payment_id: Uint8Array;
774         /**
775          * The hash that was given to [`ChannelManager::send_payment`].
776          * 
777          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
778          * 
779          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
780          */
781         public payment_hash: Uint8Array;
782         /**
783          * The payment path that was successful.
784          * 
785          * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
786          */
787         public path: RouteHop[];
788         /* @internal */
789         public constructor(ptr: number) {
790                 super(null, ptr);
791                 const payment_id: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_id(ptr);
792                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
793                 this.payment_id = payment_id_conv;
794                 const payment_hash: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr);
795                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
796                 this.payment_hash = payment_hash_conv;
797                 const path: number = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr);
798                 const path_conv_10_len: number = bindings.getArrayLength(path);
799                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
800                         for (var k = 0; k < path_conv_10_len; k++) {
801                                 const path_conv_10: number = bindings.getU32ArrayElem(path, k);
802                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
803                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
804                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
805                         }
806                         bindings.freeWasmMemory(path)
807                 this.path = path_conv_10_arr;
808         }
809 }
810 /** A Event of type PaymentPathFailed */
811 export class Event_PaymentPathFailed extends Event {
812         /**
813          * The id returned by [`ChannelManager::send_payment`] and used with
814          * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
815          * 
816          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
817          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
818          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
819          * 
820          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
821          */
822         public payment_id: Uint8Array;
823         /**
824          * The hash that was given to [`ChannelManager::send_payment`].
825          * 
826          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
827          */
828         public payment_hash: Uint8Array;
829         /**
830          * Indicates the payment was rejected for some reason by the recipient. This implies that
831          * the payment has failed, not just the route in question. If this is not set, you may
832          * retry the payment via a different route.
833          */
834         public rejected_by_dest: boolean;
835         /**
836          * Any failure information conveyed via the Onion return packet by a node along the failed
837          * payment route.
838          * 
839          * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
840          * account the update.
841          * 
842          * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
843          */
844         public network_update: Option_NetworkUpdateZ;
845         /**
846          * For both single-path and multi-path payments, this is set if all paths of the payment have
847          * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
848          * larger MPP payment were still in flight when this event was generated.
849          * 
850          * Note that if you are retrying individual MPP parts, using this value to determine if a
851          * payment has fully failed is race-y. Because multiple failures can happen prior to events
852          * being processed, you may retry in response to a first failure, with a second failure
853          * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
854          * you will see `all_paths_failed` set even though the retry of the first failure still
855          * has an associated in-flight HTLC. See (1) for an example of such a failure.
856          * 
857          * If you wish to retry individual MPP parts and learn when a payment has failed, you must
858          * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
859          * 
860          * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
861          * 
862          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
863          */
864         public all_paths_failed: boolean;
865         /**
866          * The payment path that failed.
867          */
868         public path: RouteHop[];
869         /**
870          * The channel responsible for the failed payment path.
871          * 
872          * Note that for route hints or for the first hop in a path this may be an SCID alias and
873          * may not refer to a channel in the public network graph. These aliases may also collide
874          * with channels in the public network graph.
875          * 
876          * If this is `Some`, then the corresponding channel should be avoided when the payment is
877          * retried. May be `None` for older [`Event`] serializations.
878          */
879         public short_channel_id: Option_u64Z;
880         /**
881          * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
882          * 
883          * See [`find_route`] for details.
884          * 
885          * [`Route`]: crate::routing::router::Route
886          * [`find_route`]: crate::routing::router::find_route
887          * 
888          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
889          */
890         public retry: RouteParameters;
891         /* @internal */
892         public constructor(ptr: number) {
893                 super(null, ptr);
894                 const payment_id: number = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr);
895                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
896                 this.payment_id = payment_id_conv;
897                 const payment_hash: number = bindings.LDKEvent_PaymentPathFailed_get_payment_hash(ptr);
898                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
899                 this.payment_hash = payment_hash_conv;
900                 this.rejected_by_dest = bindings.LDKEvent_PaymentPathFailed_get_rejected_by_dest(ptr);
901                 const network_update: number = bindings.LDKEvent_PaymentPathFailed_get_network_update(ptr);
902                 const network_update_hu_conv: Option_NetworkUpdateZ = Option_NetworkUpdateZ.constr_from_ptr(network_update);
903                         CommonBase.add_ref_from(network_update_hu_conv, this);
904                 this.network_update = network_update_hu_conv;
905                 this.all_paths_failed = bindings.LDKEvent_PaymentPathFailed_get_all_paths_failed(ptr);
906                 const path: number = bindings.LDKEvent_PaymentPathFailed_get_path(ptr);
907                 const path_conv_10_len: number = bindings.getArrayLength(path);
908                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
909                         for (var k = 0; k < path_conv_10_len; k++) {
910                                 const path_conv_10: number = bindings.getU32ArrayElem(path, k);
911                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
912                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
913                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
914                         }
915                         bindings.freeWasmMemory(path)
916                 this.path = path_conv_10_arr;
917                 const short_channel_id: number = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr);
918                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
919                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
920                 this.short_channel_id = short_channel_id_hu_conv;
921                 const retry: number = bindings.LDKEvent_PaymentPathFailed_get_retry(ptr);
922                 const retry_hu_conv: RouteParameters = new RouteParameters(null, retry);
923                         CommonBase.add_ref_from(retry_hu_conv, this);
924                 this.retry = retry_hu_conv;
925         }
926 }
927 /** A Event of type ProbeSuccessful */
928 export class Event_ProbeSuccessful extends Event {
929         /**
930          * The id returned by [`ChannelManager::send_probe`].
931          * 
932          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
933          */
934         public payment_id: Uint8Array;
935         /**
936          * The hash generated by [`ChannelManager::send_probe`].
937          * 
938          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
939          */
940         public payment_hash: Uint8Array;
941         /**
942          * The payment path that was successful.
943          */
944         public path: RouteHop[];
945         /* @internal */
946         public constructor(ptr: number) {
947                 super(null, ptr);
948                 const payment_id: number = bindings.LDKEvent_ProbeSuccessful_get_payment_id(ptr);
949                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
950                 this.payment_id = payment_id_conv;
951                 const payment_hash: number = bindings.LDKEvent_ProbeSuccessful_get_payment_hash(ptr);
952                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
953                 this.payment_hash = payment_hash_conv;
954                 const path: number = bindings.LDKEvent_ProbeSuccessful_get_path(ptr);
955                 const path_conv_10_len: number = bindings.getArrayLength(path);
956                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
957                         for (var k = 0; k < path_conv_10_len; k++) {
958                                 const path_conv_10: number = bindings.getU32ArrayElem(path, k);
959                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
960                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
961                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
962                         }
963                         bindings.freeWasmMemory(path)
964                 this.path = path_conv_10_arr;
965         }
966 }
967 /** A Event of type ProbeFailed */
968 export class Event_ProbeFailed extends Event {
969         /**
970          * The id returned by [`ChannelManager::send_probe`].
971          * 
972          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
973          */
974         public payment_id: Uint8Array;
975         /**
976          * The hash generated by [`ChannelManager::send_probe`].
977          * 
978          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
979          */
980         public payment_hash: Uint8Array;
981         /**
982          * The payment path that failed.
983          */
984         public path: RouteHop[];
985         /**
986          * The channel responsible for the failed probe.
987          * 
988          * Note that for route hints or for the first hop in a path this may be an SCID alias and
989          * may not refer to a channel in the public network graph. These aliases may also collide
990          * with channels in the public network graph.
991          */
992         public short_channel_id: Option_u64Z;
993         /* @internal */
994         public constructor(ptr: number) {
995                 super(null, ptr);
996                 const payment_id: number = bindings.LDKEvent_ProbeFailed_get_payment_id(ptr);
997                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
998                 this.payment_id = payment_id_conv;
999                 const payment_hash: number = bindings.LDKEvent_ProbeFailed_get_payment_hash(ptr);
1000                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1001                 this.payment_hash = payment_hash_conv;
1002                 const path: number = bindings.LDKEvent_ProbeFailed_get_path(ptr);
1003                 const path_conv_10_len: number = bindings.getArrayLength(path);
1004                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
1005                         for (var k = 0; k < path_conv_10_len; k++) {
1006                                 const path_conv_10: number = bindings.getU32ArrayElem(path, k);
1007                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
1008                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
1009                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
1010                         }
1011                         bindings.freeWasmMemory(path)
1012                 this.path = path_conv_10_arr;
1013                 const short_channel_id: number = bindings.LDKEvent_ProbeFailed_get_short_channel_id(ptr);
1014                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1015                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1016                 this.short_channel_id = short_channel_id_hu_conv;
1017         }
1018 }
1019 /** A Event of type PendingHTLCsForwardable */
1020 export class Event_PendingHTLCsForwardable extends Event {
1021         /**
1022          * The minimum amount of time that should be waited prior to calling
1023          * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1024          * you should wait a random amount of time in roughly the range (now + time_forwardable,
1025          * now + 5*time_forwardable).
1026          */
1027         public time_forwardable: bigint;
1028         /* @internal */
1029         public constructor(ptr: number) {
1030                 super(null, ptr);
1031                 this.time_forwardable = bindings.LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr);
1032         }
1033 }
1034 /** A Event of type SpendableOutputs */
1035 export class Event_SpendableOutputs extends Event {
1036         /**
1037          * The outputs which you should store as spendable by you.
1038          */
1039         public outputs: SpendableOutputDescriptor[];
1040         /* @internal */
1041         public constructor(ptr: number) {
1042                 super(null, ptr);
1043                 const outputs: number = bindings.LDKEvent_SpendableOutputs_get_outputs(ptr);
1044                 const outputs_conv_27_len: number = bindings.getArrayLength(outputs);
1045                         const outputs_conv_27_arr: SpendableOutputDescriptor[] = new Array(outputs_conv_27_len).fill(null);
1046                         for (var b = 0; b < outputs_conv_27_len; b++) {
1047                                 const outputs_conv_27: number = bindings.getU32ArrayElem(outputs, b);
1048                                 const outputs_conv_27_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
1049                                 CommonBase.add_ref_from(outputs_conv_27_hu_conv, this);
1050                                 outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
1051                         }
1052                         bindings.freeWasmMemory(outputs)
1053                 this.outputs = outputs_conv_27_arr;
1054         }
1055 }
1056 /** A Event of type PaymentForwarded */
1057 export class Event_PaymentForwarded extends Event {
1058         /**
1059          * The incoming channel between the previous node and us. This is only `None` for events
1060          * generated or serialized by versions prior to 0.0.107.
1061          * 
1062          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1063          */
1064         public prev_channel_id: Uint8Array;
1065         /**
1066          * The outgoing channel between the next node and us. This is only `None` for events
1067          * generated or serialized by versions prior to 0.0.107.
1068          * 
1069          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1070          */
1071         public next_channel_id: Uint8Array;
1072         /**
1073          * The fee, in milli-satoshis, which was earned as a result of the payment.
1074          * 
1075          * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
1076          * was pending, the amount the next hop claimed will have been rounded down to the nearest
1077          * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
1078          * claimed the full value in millisatoshis from the source. In this case,
1079          * `claim_from_onchain_tx` will be set.
1080          * 
1081          * If the channel which sent us the payment has been force-closed, we will claim the funds
1082          * via an on-chain transaction. In that case we do not yet know the on-chain transaction
1083          * fees which we will spend and will instead set this to `None`. It is possible duplicate
1084          * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
1085          * `None`.
1086          */
1087         public fee_earned_msat: Option_u64Z;
1088         /**
1089          * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
1090          * transaction.
1091          */
1092         public claim_from_onchain_tx: boolean;
1093         /* @internal */
1094         public constructor(ptr: number) {
1095                 super(null, ptr);
1096                 const prev_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr);
1097                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1098                 this.prev_channel_id = prev_channel_id_conv;
1099                 const next_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr);
1100                 const next_channel_id_conv: Uint8Array = bindings.decodeUint8Array(next_channel_id);
1101                 this.next_channel_id = next_channel_id_conv;
1102                 const fee_earned_msat: number = bindings.LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr);
1103                 const fee_earned_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_earned_msat);
1104                         CommonBase.add_ref_from(fee_earned_msat_hu_conv, this);
1105                 this.fee_earned_msat = fee_earned_msat_hu_conv;
1106                 this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr);
1107         }
1108 }
1109 /** A Event of type ChannelClosed */
1110 export class Event_ChannelClosed extends Event {
1111         /**
1112          * The channel_id of the channel which has been closed. Note that on-chain transactions
1113          * resolving the channel are likely still awaiting confirmation.
1114          */
1115         public channel_id: Uint8Array;
1116         /**
1117          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1118          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1119          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1120          * `user_channel_id` will be 0 for an inbound channel.
1121          * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
1122          * 
1123          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1124          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1125          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1126          */
1127         public user_channel_id: bigint;
1128         /**
1129          * The reason the channel was closed.
1130          */
1131         public reason: ClosureReason;
1132         /* @internal */
1133         public constructor(ptr: number) {
1134                 super(null, ptr);
1135                 const channel_id: number = bindings.LDKEvent_ChannelClosed_get_channel_id(ptr);
1136                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1137                 this.channel_id = channel_id_conv;
1138                 this.user_channel_id = bindings.LDKEvent_ChannelClosed_get_user_channel_id(ptr);
1139                 const reason: number = bindings.LDKEvent_ChannelClosed_get_reason(ptr);
1140                 const reason_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(reason);
1141                         CommonBase.add_ref_from(reason_hu_conv, this);
1142                 this.reason = reason_hu_conv;
1143         }
1144 }
1145 /** A Event of type DiscardFunding */
1146 export class Event_DiscardFunding extends Event {
1147         /**
1148          * The channel_id of the channel which has been closed.
1149          */
1150         public channel_id: Uint8Array;
1151         /**
1152          * The full transaction received from the user
1153          */
1154         public transaction: Uint8Array;
1155         /* @internal */
1156         public constructor(ptr: number) {
1157                 super(null, ptr);
1158                 const channel_id: number = bindings.LDKEvent_DiscardFunding_get_channel_id(ptr);
1159                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1160                 this.channel_id = channel_id_conv;
1161                 const transaction: number = bindings.LDKEvent_DiscardFunding_get_transaction(ptr);
1162                 const transaction_conv: Uint8Array = bindings.decodeUint8Array(transaction);
1163                 this.transaction = transaction_conv;
1164         }
1165 }
1166 /** A Event of type OpenChannelRequest */
1167 export class Event_OpenChannelRequest extends Event {
1168         /**
1169          * The temporary channel ID of the channel requested to be opened.
1170          * 
1171          * When responding to the request, the `temporary_channel_id` should be passed
1172          * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
1173          * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
1174          * 
1175          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1176          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1177          */
1178         public temporary_channel_id: Uint8Array;
1179         /**
1180          * The node_id of the counterparty requesting to open the channel.
1181          * 
1182          * When responding to the request, the `counterparty_node_id` should be passed
1183          * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
1184          * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
1185          * request.
1186          * 
1187          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1188          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1189          */
1190         public counterparty_node_id: Uint8Array;
1191         /**
1192          * The channel value of the requested channel.
1193          */
1194         public funding_satoshis: bigint;
1195         /**
1196          * Our starting balance in the channel if the request is accepted, in milli-satoshi.
1197          */
1198         public push_msat: bigint;
1199         /**
1200          * The features that this channel will operate with. If you reject the channel, a
1201          * well-behaved counterparty may automatically re-attempt the channel with a new set of
1202          * feature flags.
1203          * 
1204          * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
1205          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1206          * 0.0.106.
1207          * 
1208          * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
1209          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1210          * 0.0.107. Channels setting this type also need to get manually accepted via
1211          * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
1212          * or will be rejected otherwise.
1213          * 
1214          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1215          */
1216         public channel_type: ChannelTypeFeatures;
1217         /* @internal */
1218         public constructor(ptr: number) {
1219                 super(null, ptr);
1220                 const temporary_channel_id: number = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr);
1221                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
1222                 this.temporary_channel_id = temporary_channel_id_conv;
1223                 const counterparty_node_id: number = bindings.LDKEvent_OpenChannelRequest_get_counterparty_node_id(ptr);
1224                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1225                 this.counterparty_node_id = counterparty_node_id_conv;
1226                 this.funding_satoshis = bindings.LDKEvent_OpenChannelRequest_get_funding_satoshis(ptr);
1227                 this.push_msat = bindings.LDKEvent_OpenChannelRequest_get_push_msat(ptr);
1228                 const channel_type: number = bindings.LDKEvent_OpenChannelRequest_get_channel_type(ptr);
1229                 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1230                         CommonBase.add_ref_from(channel_type_hu_conv, this);
1231                 this.channel_type = channel_type_hu_conv;
1232         }
1233 }
1234 /** A Event of type HTLCHandlingFailed */
1235 export class Event_HTLCHandlingFailed extends Event {
1236         /**
1237          * The channel over which the HTLC was received.
1238          */
1239         public prev_channel_id: Uint8Array;
1240         /**
1241          * Destination of the HTLC that failed to be processed.
1242          */
1243         public failed_next_destination: HTLCDestination;
1244         /* @internal */
1245         public constructor(ptr: number) {
1246                 super(null, ptr);
1247                 const prev_channel_id: number = bindings.LDKEvent_HTLCHandlingFailed_get_prev_channel_id(ptr);
1248                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1249                 this.prev_channel_id = prev_channel_id_conv;
1250                 const failed_next_destination: number = bindings.LDKEvent_HTLCHandlingFailed_get_failed_next_destination(ptr);
1251                 const failed_next_destination_hu_conv: HTLCDestination = HTLCDestination.constr_from_ptr(failed_next_destination);
1252                         CommonBase.add_ref_from(failed_next_destination_hu_conv, this);
1253                 this.failed_next_destination = failed_next_destination_hu_conv;
1254         }
1255 }