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