[TS] Update auto-generated TS bindings
[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: bigint) { super(ptr, bindings.Event_free); }
367         /* @internal */
368         public static constr_from_ptr(ptr: bigint): 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(): bigint {
393                 const ret: bigint = 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: bigint = 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: 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);
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: bigint = 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: bigint = 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: 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));
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: bigint = 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: 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));
462                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
463                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
464                 path.forEach((path_conv_10: RouteHop) => { CommonBase.add_ref_from(ret_hu_conv, path_conv_10); });
465                 return ret_hu_conv;
466         }
467
468         /**
469          * Utility method to constructs a new PaymentPathFailed-variant Event
470          */
471         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 {
472                 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)), rejected_by_dest, 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));
473                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
474                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
475                 path.forEach((path_conv_10: RouteHop) => { CommonBase.add_ref_from(ret_hu_conv, path_conv_10); });
476                 CommonBase.add_ref_from(ret_hu_conv, retry);
477                 return ret_hu_conv;
478         }
479
480         /**
481          * Utility method to constructs a new ProbeSuccessful-variant Event
482          */
483         public static constructor_probe_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[]): Event {
484                 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));
485                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
486                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
487                 path.forEach((path_conv_10: RouteHop) => { CommonBase.add_ref_from(ret_hu_conv, path_conv_10); });
488                 return ret_hu_conv;
489         }
490
491         /**
492          * Utility method to constructs a new ProbeFailed-variant Event
493          */
494         public static constructor_probe_failed(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[], short_channel_id: Option_u64Z): Event {
495                 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));
496                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
497                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
498                 path.forEach((path_conv_10: RouteHop) => { CommonBase.add_ref_from(ret_hu_conv, path_conv_10); });
499                 return ret_hu_conv;
500         }
501
502         /**
503          * Utility method to constructs a new PendingHTLCsForwardable-variant Event
504          */
505         public static constructor_pending_htlcs_forwardable(time_forwardable: bigint): Event {
506                 const ret: bigint = bindings.Event_pending_htlcs_forwardable(time_forwardable);
507                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
508                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
509                 return ret_hu_conv;
510         }
511
512         /**
513          * Utility method to constructs a new SpendableOutputs-variant Event
514          */
515         public static constructor_spendable_outputs(outputs: SpendableOutputDescriptor[]): Event {
516                 const ret: bigint = bindings.Event_spendable_outputs(bindings.encodeUint64Array(outputs != null ? outputs.map(outputs_conv_27 => CommonBase.get_ptr_of(outputs_conv_27)) : null));
517                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
518                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
519                 return ret_hu_conv;
520         }
521
522         /**
523          * Utility method to constructs a new PaymentForwarded-variant Event
524          */
525         public static constructor_payment_forwarded(prev_channel_id: Uint8Array, next_channel_id: Uint8Array, fee_earned_msat: Option_u64Z, claim_from_onchain_tx: boolean): Event {
526                 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);
527                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
528                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
529                 return ret_hu_conv;
530         }
531
532         /**
533          * Utility method to constructs a new ChannelClosed-variant Event
534          */
535         public static constructor_channel_closed(channel_id: Uint8Array, user_channel_id: bigint, reason: ClosureReason): Event {
536                 const ret: bigint = bindings.Event_channel_closed(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), user_channel_id, CommonBase.get_ptr_of(reason));
537                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
538                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
539                 return ret_hu_conv;
540         }
541
542         /**
543          * Utility method to constructs a new DiscardFunding-variant Event
544          */
545         public static constructor_discard_funding(channel_id: Uint8Array, transaction: Uint8Array): Event {
546                 const ret: bigint = bindings.Event_discard_funding(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(transaction));
547                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
548                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
549                 return ret_hu_conv;
550         }
551
552         /**
553          * Utility method to constructs a new OpenChannelRequest-variant Event
554          */
555         public static constructor_open_channel_request(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_satoshis: bigint, push_msat: bigint, channel_type: ChannelTypeFeatures): Event {
556                 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));
557                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
558                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
559                 CommonBase.add_ref_from(ret_hu_conv, channel_type);
560                 return ret_hu_conv;
561         }
562
563         /**
564          * Utility method to constructs a new HTLCHandlingFailed-variant Event
565          */
566         public static constructor_htlchandling_failed(prev_channel_id: Uint8Array, failed_next_destination: HTLCDestination): Event {
567                 const ret: bigint = bindings.Event_htlchandling_failed(bindings.encodeUint8Array(bindings.check_arr_len(prev_channel_id, 32)), CommonBase.get_ptr_of(failed_next_destination));
568                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
569                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
570                 return ret_hu_conv;
571         }
572
573         /**
574          * Serialize the Event object into a byte array which can be read by Event_read
575          */
576         public write(): Uint8Array {
577                 const ret: number = bindings.Event_write(this.ptr);
578                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
579                 return ret_conv;
580         }
581
582 }
583 /** A Event of type FundingGenerationReady */
584 export class Event_FundingGenerationReady extends Event {
585         /**
586          * The random channel_id we picked which you'll need to pass into
587          * [`ChannelManager::funding_transaction_generated`].
588          * 
589          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
590          */
591         public temporary_channel_id: Uint8Array;
592         /**
593          * The counterparty's node_id, which you'll need to pass back into
594          * [`ChannelManager::funding_transaction_generated`].
595          * 
596          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
597          */
598         public counterparty_node_id: Uint8Array;
599         /**
600          * The value, in satoshis, that the output should have.
601          */
602         public channel_value_satoshis: bigint;
603         /**
604          * The script which should be used in the transaction output.
605          */
606         public output_script: Uint8Array;
607         /**
608          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
609          * an inbound channel.
610          * 
611          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
612          */
613         public user_channel_id: bigint;
614         /* @internal */
615         public constructor(ptr: bigint) {
616                 super(null, ptr);
617                 const temporary_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr);
618                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
619                 this.temporary_channel_id = temporary_channel_id_conv;
620                 const counterparty_node_id: number = bindings.LDKEvent_FundingGenerationReady_get_counterparty_node_id(ptr);
621                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
622                 this.counterparty_node_id = counterparty_node_id_conv;
623                 this.channel_value_satoshis = bindings.LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr);
624                 const output_script: number = bindings.LDKEvent_FundingGenerationReady_get_output_script(ptr);
625                 const output_script_conv: Uint8Array = bindings.decodeUint8Array(output_script);
626                 this.output_script = output_script_conv;
627                 this.user_channel_id = bindings.LDKEvent_FundingGenerationReady_get_user_channel_id(ptr);
628         }
629 }
630 /** A Event of type PaymentReceived */
631 export class Event_PaymentReceived extends Event {
632         /**
633          * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
634          * not stop you from registering duplicate payment hashes for inbound payments.
635          */
636         public payment_hash: Uint8Array;
637         /**
638          * The value, in thousandths of a satoshi, that this payment is for.
639          */
640         public amount_msat: bigint;
641         /**
642          * Information for claiming this received payment, based on whether the purpose of the
643          * payment is to pay an invoice or to send a spontaneous payment.
644          */
645         public purpose: PaymentPurpose;
646         /* @internal */
647         public constructor(ptr: bigint) {
648                 super(null, ptr);
649                 const payment_hash: number = bindings.LDKEvent_PaymentReceived_get_payment_hash(ptr);
650                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
651                 this.payment_hash = payment_hash_conv;
652                 this.amount_msat = bindings.LDKEvent_PaymentReceived_get_amount_msat(ptr);
653                 const purpose: bigint = bindings.LDKEvent_PaymentReceived_get_purpose(ptr);
654                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
655                         CommonBase.add_ref_from(purpose_hu_conv, this);
656                 this.purpose = purpose_hu_conv;
657         }
658 }
659 /** A Event of type PaymentClaimed */
660 export class Event_PaymentClaimed extends Event {
661         /**
662          * The payment hash of the claimed payment. Note that LDK will not stop you from
663          * registering duplicate payment hashes for inbound payments.
664          */
665         public payment_hash: Uint8Array;
666         /**
667          * The value, in thousandths of a satoshi, that this payment is for.
668          */
669         public amount_msat: bigint;
670         /**
671          * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
672          * spontaneous payment.
673          */
674         public purpose: PaymentPurpose;
675         /* @internal */
676         public constructor(ptr: bigint) {
677                 super(null, ptr);
678                 const payment_hash: number = bindings.LDKEvent_PaymentClaimed_get_payment_hash(ptr);
679                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
680                 this.payment_hash = payment_hash_conv;
681                 this.amount_msat = bindings.LDKEvent_PaymentClaimed_get_amount_msat(ptr);
682                 const purpose: bigint = bindings.LDKEvent_PaymentClaimed_get_purpose(ptr);
683                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
684                         CommonBase.add_ref_from(purpose_hu_conv, this);
685                 this.purpose = purpose_hu_conv;
686         }
687 }
688 /** A Event of type PaymentSent */
689 export class Event_PaymentSent extends Event {
690         /**
691          * The id returned by [`ChannelManager::send_payment`] and used with
692          * [`ChannelManager::retry_payment`].
693          * 
694          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
695          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
696          * 
697          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
698          */
699         public payment_id: Uint8Array;
700         /**
701          * The preimage to the hash given to ChannelManager::send_payment.
702          * Note that this serves as a payment receipt, if you wish to have such a thing, you must
703          * store it somehow!
704          */
705         public payment_preimage: Uint8Array;
706         /**
707          * The hash that was given to [`ChannelManager::send_payment`].
708          * 
709          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
710          */
711         public payment_hash: Uint8Array;
712         /**
713          * The total fee which was spent at intermediate hops in this payment, across all paths.
714          * 
715          * Note that, like [`Route::get_total_fees`] this does *not* include any potential
716          * overpayment to the recipient node.
717          * 
718          * If the recipient or an intermediate node misbehaves and gives us free money, this may
719          * overstate the amount paid, though this is unlikely.
720          * 
721          * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
722          */
723         public fee_paid_msat: Option_u64Z;
724         /* @internal */
725         public constructor(ptr: bigint) {
726                 super(null, ptr);
727                 const payment_id: number = bindings.LDKEvent_PaymentSent_get_payment_id(ptr);
728                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
729                 this.payment_id = payment_id_conv;
730                 const payment_preimage: number = bindings.LDKEvent_PaymentSent_get_payment_preimage(ptr);
731                 const payment_preimage_conv: Uint8Array = bindings.decodeUint8Array(payment_preimage);
732                 this.payment_preimage = payment_preimage_conv;
733                 const payment_hash: number = bindings.LDKEvent_PaymentSent_get_payment_hash(ptr);
734                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
735                 this.payment_hash = payment_hash_conv;
736                 const fee_paid_msat: bigint = bindings.LDKEvent_PaymentSent_get_fee_paid_msat(ptr);
737                 const fee_paid_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_paid_msat);
738                         CommonBase.add_ref_from(fee_paid_msat_hu_conv, this);
739                 this.fee_paid_msat = fee_paid_msat_hu_conv;
740         }
741 }
742 /** A Event of type PaymentFailed */
743 export class Event_PaymentFailed extends Event {
744         /**
745          * The id returned by [`ChannelManager::send_payment`] and used with
746          * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
747          * 
748          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
749          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
750          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
751          */
752         public payment_id: Uint8Array;
753         /**
754          * The hash that was given to [`ChannelManager::send_payment`].
755          * 
756          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
757          */
758         public payment_hash: Uint8Array;
759         /* @internal */
760         public constructor(ptr: bigint) {
761                 super(null, ptr);
762                 const payment_id: number = bindings.LDKEvent_PaymentFailed_get_payment_id(ptr);
763                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
764                 this.payment_id = payment_id_conv;
765                 const payment_hash: number = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr);
766                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
767                 this.payment_hash = payment_hash_conv;
768         }
769 }
770 /** A Event of type PaymentPathSuccessful */
771 export class Event_PaymentPathSuccessful extends Event {
772         /**
773          * The id returned by [`ChannelManager::send_payment`] and used with
774          * [`ChannelManager::retry_payment`].
775          * 
776          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
777          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
778          */
779         public payment_id: Uint8Array;
780         /**
781          * The hash that was given to [`ChannelManager::send_payment`].
782          * 
783          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
784          * 
785          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
786          */
787         public payment_hash: Uint8Array;
788         /**
789          * The payment path that was successful.
790          * 
791          * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
792          */
793         public path: RouteHop[];
794         /* @internal */
795         public constructor(ptr: bigint) {
796                 super(null, ptr);
797                 const payment_id: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_id(ptr);
798                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
799                 this.payment_id = payment_id_conv;
800                 const payment_hash: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr);
801                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
802                 this.payment_hash = payment_hash_conv;
803                 const path: number = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr);
804                 const path_conv_10_len: number = bindings.getArrayLength(path);
805                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
806                         for (var k = 0; k < path_conv_10_len; k++) {
807                                 const path_conv_10: bigint = bindings.getU64ArrayElem(path, k);
808                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
809                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
810                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
811                         }
812                         bindings.freeWasmMemory(path)
813                 this.path = path_conv_10_arr;
814         }
815 }
816 /** A Event of type PaymentPathFailed */
817 export class Event_PaymentPathFailed extends Event {
818         /**
819          * The id returned by [`ChannelManager::send_payment`] and used with
820          * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
821          * 
822          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
823          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
824          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
825          * 
826          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
827          */
828         public payment_id: Uint8Array;
829         /**
830          * The hash that was given to [`ChannelManager::send_payment`].
831          * 
832          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
833          */
834         public payment_hash: Uint8Array;
835         /**
836          * Indicates the payment was rejected for some reason by the recipient. This implies that
837          * the payment has failed, not just the route in question. If this is not set, you may
838          * retry the payment via a different route.
839          */
840         public rejected_by_dest: boolean;
841         /**
842          * Any failure information conveyed via the Onion return packet by a node along the failed
843          * payment route.
844          * 
845          * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
846          * account the update.
847          * 
848          * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
849          */
850         public network_update: Option_NetworkUpdateZ;
851         /**
852          * For both single-path and multi-path payments, this is set if all paths of the payment have
853          * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
854          * larger MPP payment were still in flight when this event was generated.
855          * 
856          * Note that if you are retrying individual MPP parts, using this value to determine if a
857          * payment has fully failed is race-y. Because multiple failures can happen prior to events
858          * being processed, you may retry in response to a first failure, with a second failure
859          * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
860          * you will see `all_paths_failed` set even though the retry of the first failure still
861          * has an associated in-flight HTLC. See (1) for an example of such a failure.
862          * 
863          * If you wish to retry individual MPP parts and learn when a payment has failed, you must
864          * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
865          * 
866          * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
867          * 
868          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
869          */
870         public all_paths_failed: boolean;
871         /**
872          * The payment path that failed.
873          */
874         public path: RouteHop[];
875         /**
876          * The channel responsible for the failed payment path.
877          * 
878          * Note that for route hints or for the first hop in a path this may be an SCID alias and
879          * may not refer to a channel in the public network graph. These aliases may also collide
880          * with channels in the public network graph.
881          * 
882          * If this is `Some`, then the corresponding channel should be avoided when the payment is
883          * retried. May be `None` for older [`Event`] serializations.
884          */
885         public short_channel_id: Option_u64Z;
886         /**
887          * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
888          * 
889          * See [`find_route`] for details.
890          * 
891          * [`Route`]: crate::routing::router::Route
892          * [`find_route`]: crate::routing::router::find_route
893          * 
894          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
895          */
896         public retry: RouteParameters;
897         /* @internal */
898         public constructor(ptr: bigint) {
899                 super(null, ptr);
900                 const payment_id: number = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr);
901                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
902                 this.payment_id = payment_id_conv;
903                 const payment_hash: number = bindings.LDKEvent_PaymentPathFailed_get_payment_hash(ptr);
904                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
905                 this.payment_hash = payment_hash_conv;
906                 this.rejected_by_dest = bindings.LDKEvent_PaymentPathFailed_get_rejected_by_dest(ptr);
907                 const network_update: bigint = bindings.LDKEvent_PaymentPathFailed_get_network_update(ptr);
908                 const network_update_hu_conv: Option_NetworkUpdateZ = Option_NetworkUpdateZ.constr_from_ptr(network_update);
909                         CommonBase.add_ref_from(network_update_hu_conv, this);
910                 this.network_update = network_update_hu_conv;
911                 this.all_paths_failed = bindings.LDKEvent_PaymentPathFailed_get_all_paths_failed(ptr);
912                 const path: number = bindings.LDKEvent_PaymentPathFailed_get_path(ptr);
913                 const path_conv_10_len: number = bindings.getArrayLength(path);
914                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
915                         for (var k = 0; k < path_conv_10_len; k++) {
916                                 const path_conv_10: bigint = bindings.getU64ArrayElem(path, k);
917                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
918                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
919                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
920                         }
921                         bindings.freeWasmMemory(path)
922                 this.path = path_conv_10_arr;
923                 const short_channel_id: bigint = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr);
924                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
925                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
926                 this.short_channel_id = short_channel_id_hu_conv;
927                 const retry: bigint = bindings.LDKEvent_PaymentPathFailed_get_retry(ptr);
928                 const retry_hu_conv: RouteParameters = new RouteParameters(null, retry);
929                         CommonBase.add_ref_from(retry_hu_conv, this);
930                 this.retry = retry_hu_conv;
931         }
932 }
933 /** A Event of type ProbeSuccessful */
934 export class Event_ProbeSuccessful extends Event {
935         /**
936          * The id returned by [`ChannelManager::send_probe`].
937          * 
938          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
939          */
940         public payment_id: Uint8Array;
941         /**
942          * The hash generated by [`ChannelManager::send_probe`].
943          * 
944          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
945          */
946         public payment_hash: Uint8Array;
947         /**
948          * The payment path that was successful.
949          */
950         public path: RouteHop[];
951         /* @internal */
952         public constructor(ptr: bigint) {
953                 super(null, ptr);
954                 const payment_id: number = bindings.LDKEvent_ProbeSuccessful_get_payment_id(ptr);
955                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
956                 this.payment_id = payment_id_conv;
957                 const payment_hash: number = bindings.LDKEvent_ProbeSuccessful_get_payment_hash(ptr);
958                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
959                 this.payment_hash = payment_hash_conv;
960                 const path: number = bindings.LDKEvent_ProbeSuccessful_get_path(ptr);
961                 const path_conv_10_len: number = bindings.getArrayLength(path);
962                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
963                         for (var k = 0; k < path_conv_10_len; k++) {
964                                 const path_conv_10: bigint = bindings.getU64ArrayElem(path, k);
965                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
966                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
967                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
968                         }
969                         bindings.freeWasmMemory(path)
970                 this.path = path_conv_10_arr;
971         }
972 }
973 /** A Event of type ProbeFailed */
974 export class Event_ProbeFailed extends Event {
975         /**
976          * The id returned by [`ChannelManager::send_probe`].
977          * 
978          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
979          */
980         public payment_id: Uint8Array;
981         /**
982          * The hash generated by [`ChannelManager::send_probe`].
983          * 
984          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
985          */
986         public payment_hash: Uint8Array;
987         /**
988          * The payment path that failed.
989          */
990         public path: RouteHop[];
991         /**
992          * The channel responsible for the failed probe.
993          * 
994          * Note that for route hints or for the first hop in a path this may be an SCID alias and
995          * may not refer to a channel in the public network graph. These aliases may also collide
996          * with channels in the public network graph.
997          */
998         public short_channel_id: Option_u64Z;
999         /* @internal */
1000         public constructor(ptr: bigint) {
1001                 super(null, ptr);
1002                 const payment_id: number = bindings.LDKEvent_ProbeFailed_get_payment_id(ptr);
1003                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1004                 this.payment_id = payment_id_conv;
1005                 const payment_hash: number = bindings.LDKEvent_ProbeFailed_get_payment_hash(ptr);
1006                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1007                 this.payment_hash = payment_hash_conv;
1008                 const path: number = bindings.LDKEvent_ProbeFailed_get_path(ptr);
1009                 const path_conv_10_len: number = bindings.getArrayLength(path);
1010                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
1011                         for (var k = 0; k < path_conv_10_len; k++) {
1012                                 const path_conv_10: bigint = bindings.getU64ArrayElem(path, k);
1013                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
1014                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
1015                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
1016                         }
1017                         bindings.freeWasmMemory(path)
1018                 this.path = path_conv_10_arr;
1019                 const short_channel_id: bigint = bindings.LDKEvent_ProbeFailed_get_short_channel_id(ptr);
1020                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1021                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1022                 this.short_channel_id = short_channel_id_hu_conv;
1023         }
1024 }
1025 /** A Event of type PendingHTLCsForwardable */
1026 export class Event_PendingHTLCsForwardable extends Event {
1027         /**
1028          * The minimum amount of time that should be waited prior to calling
1029          * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1030          * you should wait a random amount of time in roughly the range (now + time_forwardable,
1031          * now + 5*time_forwardable).
1032          */
1033         public time_forwardable: bigint;
1034         /* @internal */
1035         public constructor(ptr: bigint) {
1036                 super(null, ptr);
1037                 this.time_forwardable = bindings.LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr);
1038         }
1039 }
1040 /** A Event of type SpendableOutputs */
1041 export class Event_SpendableOutputs extends Event {
1042         /**
1043          * The outputs which you should store as spendable by you.
1044          */
1045         public outputs: SpendableOutputDescriptor[];
1046         /* @internal */
1047         public constructor(ptr: bigint) {
1048                 super(null, ptr);
1049                 const outputs: number = bindings.LDKEvent_SpendableOutputs_get_outputs(ptr);
1050                 const outputs_conv_27_len: number = bindings.getArrayLength(outputs);
1051                         const outputs_conv_27_arr: SpendableOutputDescriptor[] = new Array(outputs_conv_27_len).fill(null);
1052                         for (var b = 0; b < outputs_conv_27_len; b++) {
1053                                 const outputs_conv_27: bigint = bindings.getU64ArrayElem(outputs, b);
1054                                 const outputs_conv_27_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
1055                                 CommonBase.add_ref_from(outputs_conv_27_hu_conv, this);
1056                                 outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
1057                         }
1058                         bindings.freeWasmMemory(outputs)
1059                 this.outputs = outputs_conv_27_arr;
1060         }
1061 }
1062 /** A Event of type PaymentForwarded */
1063 export class Event_PaymentForwarded extends Event {
1064         /**
1065          * The incoming channel between the previous node and us. This is only `None` for events
1066          * generated or serialized by versions prior to 0.0.107.
1067          * 
1068          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1069          */
1070         public prev_channel_id: Uint8Array;
1071         /**
1072          * The outgoing channel between the next node and us. This is only `None` for events
1073          * generated or serialized by versions prior to 0.0.107.
1074          * 
1075          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1076          */
1077         public next_channel_id: Uint8Array;
1078         /**
1079          * The fee, in milli-satoshis, which was earned as a result of the payment.
1080          * 
1081          * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
1082          * was pending, the amount the next hop claimed will have been rounded down to the nearest
1083          * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
1084          * claimed the full value in millisatoshis from the source. In this case,
1085          * `claim_from_onchain_tx` will be set.
1086          * 
1087          * If the channel which sent us the payment has been force-closed, we will claim the funds
1088          * via an on-chain transaction. In that case we do not yet know the on-chain transaction
1089          * fees which we will spend and will instead set this to `None`. It is possible duplicate
1090          * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
1091          * `None`.
1092          */
1093         public fee_earned_msat: Option_u64Z;
1094         /**
1095          * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
1096          * transaction.
1097          */
1098         public claim_from_onchain_tx: boolean;
1099         /* @internal */
1100         public constructor(ptr: bigint) {
1101                 super(null, ptr);
1102                 const prev_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr);
1103                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1104                 this.prev_channel_id = prev_channel_id_conv;
1105                 const next_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr);
1106                 const next_channel_id_conv: Uint8Array = bindings.decodeUint8Array(next_channel_id);
1107                 this.next_channel_id = next_channel_id_conv;
1108                 const fee_earned_msat: bigint = bindings.LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr);
1109                 const fee_earned_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_earned_msat);
1110                         CommonBase.add_ref_from(fee_earned_msat_hu_conv, this);
1111                 this.fee_earned_msat = fee_earned_msat_hu_conv;
1112                 this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr);
1113         }
1114 }
1115 /** A Event of type ChannelClosed */
1116 export class Event_ChannelClosed extends Event {
1117         /**
1118          * The channel_id of the channel which has been closed. Note that on-chain transactions
1119          * resolving the channel are likely still awaiting confirmation.
1120          */
1121         public channel_id: Uint8Array;
1122         /**
1123          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1124          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1125          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1126          * `user_channel_id` will be 0 for an inbound channel.
1127          * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
1128          * 
1129          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1130          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1131          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1132          */
1133         public user_channel_id: bigint;
1134         /**
1135          * The reason the channel was closed.
1136          */
1137         public reason: ClosureReason;
1138         /* @internal */
1139         public constructor(ptr: bigint) {
1140                 super(null, ptr);
1141                 const channel_id: number = bindings.LDKEvent_ChannelClosed_get_channel_id(ptr);
1142                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1143                 this.channel_id = channel_id_conv;
1144                 this.user_channel_id = bindings.LDKEvent_ChannelClosed_get_user_channel_id(ptr);
1145                 const reason: bigint = bindings.LDKEvent_ChannelClosed_get_reason(ptr);
1146                 const reason_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(reason);
1147                         CommonBase.add_ref_from(reason_hu_conv, this);
1148                 this.reason = reason_hu_conv;
1149         }
1150 }
1151 /** A Event of type DiscardFunding */
1152 export class Event_DiscardFunding extends Event {
1153         /**
1154          * The channel_id of the channel which has been closed.
1155          */
1156         public channel_id: Uint8Array;
1157         /**
1158          * The full transaction received from the user
1159          */
1160         public transaction: Uint8Array;
1161         /* @internal */
1162         public constructor(ptr: bigint) {
1163                 super(null, ptr);
1164                 const channel_id: number = bindings.LDKEvent_DiscardFunding_get_channel_id(ptr);
1165                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1166                 this.channel_id = channel_id_conv;
1167                 const transaction: number = bindings.LDKEvent_DiscardFunding_get_transaction(ptr);
1168                 const transaction_conv: Uint8Array = bindings.decodeUint8Array(transaction);
1169                 this.transaction = transaction_conv;
1170         }
1171 }
1172 /** A Event of type OpenChannelRequest */
1173 export class Event_OpenChannelRequest extends Event {
1174         /**
1175          * The temporary channel ID of the channel requested to be opened.
1176          * 
1177          * When responding to the request, the `temporary_channel_id` should be passed
1178          * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
1179          * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
1180          * 
1181          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1182          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1183          */
1184         public temporary_channel_id: Uint8Array;
1185         /**
1186          * The node_id of the counterparty requesting to open the channel.
1187          * 
1188          * When responding to the request, the `counterparty_node_id` should be passed
1189          * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
1190          * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
1191          * request.
1192          * 
1193          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1194          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1195          */
1196         public counterparty_node_id: Uint8Array;
1197         /**
1198          * The channel value of the requested channel.
1199          */
1200         public funding_satoshis: bigint;
1201         /**
1202          * Our starting balance in the channel if the request is accepted, in milli-satoshi.
1203          */
1204         public push_msat: bigint;
1205         /**
1206          * The features that this channel will operate with. If you reject the channel, a
1207          * well-behaved counterparty may automatically re-attempt the channel with a new set of
1208          * feature flags.
1209          * 
1210          * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
1211          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1212          * 0.0.106.
1213          * 
1214          * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
1215          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1216          * 0.0.107. Channels setting this type also need to get manually accepted via
1217          * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
1218          * or will be rejected otherwise.
1219          * 
1220          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1221          */
1222         public channel_type: ChannelTypeFeatures;
1223         /* @internal */
1224         public constructor(ptr: bigint) {
1225                 super(null, ptr);
1226                 const temporary_channel_id: number = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr);
1227                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
1228                 this.temporary_channel_id = temporary_channel_id_conv;
1229                 const counterparty_node_id: number = bindings.LDKEvent_OpenChannelRequest_get_counterparty_node_id(ptr);
1230                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1231                 this.counterparty_node_id = counterparty_node_id_conv;
1232                 this.funding_satoshis = bindings.LDKEvent_OpenChannelRequest_get_funding_satoshis(ptr);
1233                 this.push_msat = bindings.LDKEvent_OpenChannelRequest_get_push_msat(ptr);
1234                 const channel_type: bigint = bindings.LDKEvent_OpenChannelRequest_get_channel_type(ptr);
1235                 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1236                         CommonBase.add_ref_from(channel_type_hu_conv, this);
1237                 this.channel_type = channel_type_hu_conv;
1238         }
1239 }
1240 /** A Event of type HTLCHandlingFailed */
1241 export class Event_HTLCHandlingFailed extends Event {
1242         /**
1243          * The channel over which the HTLC was received.
1244          */
1245         public prev_channel_id: Uint8Array;
1246         /**
1247          * Destination of the HTLC that failed to be processed.
1248          */
1249         public failed_next_destination: HTLCDestination;
1250         /* @internal */
1251         public constructor(ptr: bigint) {
1252                 super(null, ptr);
1253                 const prev_channel_id: number = bindings.LDKEvent_HTLCHandlingFailed_get_prev_channel_id(ptr);
1254                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1255                 this.prev_channel_id = prev_channel_id_conv;
1256                 const failed_next_destination: bigint = bindings.LDKEvent_HTLCHandlingFailed_get_failed_next_destination(ptr);
1257                 const failed_next_destination_hu_conv: HTLCDestination = HTLCDestination.constr_from_ptr(failed_next_destination);
1258                         CommonBase.add_ref_from(failed_next_destination_hu_conv, this);
1259                 this.failed_next_destination = failed_next_destination_hu_conv;
1260         }
1261 }