29ab18145ea5c1fec3d7d5126099783ea9af806c
[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 { GraphSyncError } from '../structs/GraphSyncError.mjs';
262 import { Result_u32GraphSyncErrorZ } from '../structs/Result_u32GraphSyncErrorZ.mjs';
263 import { Result_NoneErrorZ } from '../structs/Result_NoneErrorZ.mjs';
264 import { Result_NetAddressDecodeErrorZ } from '../structs/Result_NetAddressDecodeErrorZ.mjs';
265 import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs';
266 import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs';
267 import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs';
268 import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs';
269 import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs';
270 import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs';
271 import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs';
272 import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs';
273 import { ClosingSignedFeeRange } from '../structs/ClosingSignedFeeRange.mjs';
274 import { Result_ClosingSignedFeeRangeDecodeErrorZ } from '../structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mjs';
275 import { CommitmentSigned } from '../structs/CommitmentSigned.mjs';
276 import { Result_CommitmentSignedDecodeErrorZ } from '../structs/Result_CommitmentSignedDecodeErrorZ.mjs';
277 import { Result_FundingCreatedDecodeErrorZ } from '../structs/Result_FundingCreatedDecodeErrorZ.mjs';
278 import { Result_FundingSignedDecodeErrorZ } from '../structs/Result_FundingSignedDecodeErrorZ.mjs';
279 import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyDecodeErrorZ.mjs';
280 import { Init } from '../structs/Init.mjs';
281 import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs';
282 import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs';
283 import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs';
284 import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
285 import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs';
286 import { Result_UpdateFailMalformedHTLCDecodeErrorZ } from '../structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mjs';
287 import { UpdateFee } from '../structs/UpdateFee.mjs';
288 import { Result_UpdateFeeDecodeErrorZ } from '../structs/Result_UpdateFeeDecodeErrorZ.mjs';
289 import { Result_UpdateFulfillHTLCDecodeErrorZ } from '../structs/Result_UpdateFulfillHTLCDecodeErrorZ.mjs';
290 import { Result_UpdateAddHTLCDecodeErrorZ } from '../structs/Result_UpdateAddHTLCDecodeErrorZ.mjs';
291 import { OnionMessage } from '../structs/OnionMessage.mjs';
292 import { Result_OnionMessageDecodeErrorZ } from '../structs/Result_OnionMessageDecodeErrorZ.mjs';
293 import { Ping } from '../structs/Ping.mjs';
294 import { Result_PingDecodeErrorZ } from '../structs/Result_PingDecodeErrorZ.mjs';
295 import { Pong } from '../structs/Pong.mjs';
296 import { Result_PongDecodeErrorZ } from '../structs/Result_PongDecodeErrorZ.mjs';
297 import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs';
298 import { Result_ChannelAnnouncementDecodeErrorZ } from '../structs/Result_ChannelAnnouncementDecodeErrorZ.mjs';
299 import { UnsignedChannelUpdate } from '../structs/UnsignedChannelUpdate.mjs';
300 import { Result_UnsignedChannelUpdateDecodeErrorZ } from '../structs/Result_UnsignedChannelUpdateDecodeErrorZ.mjs';
301 import { Result_ChannelUpdateDecodeErrorZ } from '../structs/Result_ChannelUpdateDecodeErrorZ.mjs';
302 import { Result_ErrorMessageDecodeErrorZ } from '../structs/Result_ErrorMessageDecodeErrorZ.mjs';
303 import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs';
304 import { UnsignedNodeAnnouncement } from '../structs/UnsignedNodeAnnouncement.mjs';
305 import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
306 import { NodeAnnouncement } from '../structs/NodeAnnouncement.mjs';
307 import { Result_NodeAnnouncementDecodeErrorZ } from '../structs/Result_NodeAnnouncementDecodeErrorZ.mjs';
308 import { Result_QueryShortChannelIdsDecodeErrorZ } from '../structs/Result_QueryShortChannelIdsDecodeErrorZ.mjs';
309 import { ReplyShortChannelIdsEnd } from '../structs/ReplyShortChannelIdsEnd.mjs';
310 import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mjs';
311 import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs';
312 import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs';
313 import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs';
314 import { SignOrCreationError } from '../structs/SignOrCreationError.mjs';
315 import { Result_InvoiceSignOrCreationErrorZ } from '../structs/Result_InvoiceSignOrCreationErrorZ.mjs';
316 import { WatchedOutput } from '../structs/WatchedOutput.mjs';
317 import { Filter, FilterInterface } from '../structs/Filter.mjs';
318 import { Option_FilterZ } from '../structs/Option_FilterZ.mjs';
319 import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs';
320 import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs';
321 import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs';
322 import { OnionMessageProvider, OnionMessageProviderInterface } from '../structs/OnionMessageProvider.mjs';
323 import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs';
324 import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs';
325 import { BigSize } from '../structs/BigSize.mjs';
326 import { ChannelUsage } from '../structs/ChannelUsage.mjs';
327 import { Score, ScoreInterface } from '../structs/Score.mjs';
328 import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs';
329 import { WriteableScore, WriteableScoreInterface } from '../structs/WriteableScore.mjs';
330 import { Persister, PersisterInterface } from '../structs/Persister.mjs';
331 import { FutureCallback, FutureCallbackInterface } from '../structs/FutureCallback.mjs';
332 import { Future } from '../structs/Future.mjs';
333 import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs';
334 import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs';
335 import { UserConfig } from '../structs/UserConfig.mjs';
336 import { BestBlock } from '../structs/BestBlock.mjs';
337 import { Listen, ListenInterface } from '../structs/Listen.mjs';
338 import { Confirm, ConfirmInterface } from '../structs/Confirm.mjs';
339 import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs';
340 import { Persist, PersistInterface } from '../structs/Persist.mjs';
341 import { ChainMonitor } from '../structs/ChainMonitor.mjs';
342 import { KeysManager } from '../structs/KeysManager.mjs';
343 import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs';
344 import { ChainParameters } from '../structs/ChainParameters.mjs';
345 import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs';
346 import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs';
347 import { ExpandedKey } from '../structs/ExpandedKey.mjs';
348 import { DataLossProtect } from '../structs/DataLossProtect.mjs';
349 import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs';
350 import { OnionMessageHandler, OnionMessageHandlerInterface } from '../structs/OnionMessageHandler.mjs';
351 import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs';
352 import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs';
353 import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs';
354 import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs';
355 import { MessageHandler } from '../structs/MessageHandler.mjs';
356 import { SocketDescriptor, SocketDescriptorInterface } from '../structs/SocketDescriptor.mjs';
357 import { PeerManager } from '../structs/PeerManager.mjs';
358 import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs';
359 import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs';
360 import { P2PGossipSync } from '../structs/P2PGossipSync.mjs';
361 import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs';
362 import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs';
363 import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs';
364 import { MultiThreadedScoreLock } from '../structs/MultiThreadedScoreLock.mjs';
365 import { ProbabilisticScoringParameters } from '../structs/ProbabilisticScoringParameters.mjs';
366 import { OnionMessenger } from '../structs/OnionMessenger.mjs';
367 import { Destination } from '../structs/Destination.mjs';
368 import { RapidGossipSync } from '../structs/RapidGossipSync.mjs';
369 import { RawDataPart } from '../structs/RawDataPart.mjs';
370 import { Sha256 } from '../structs/Sha256.mjs';
371 import { ExpiryTime } from '../structs/ExpiryTime.mjs';
372 import { MinFinalCltvExpiry } from '../structs/MinFinalCltvExpiry.mjs';
373 import { Fallback } from '../structs/Fallback.mjs';
374 import { Payer, PayerInterface } from '../structs/Payer.mjs';
375 import { Router, RouterInterface } from '../structs/Router.mjs';
376 import { InvoicePayer } from '../structs/InvoicePayer.mjs';
377 import { Retry } from '../structs/Retry.mjs';
378 import { DefaultRouter } from '../structs/DefaultRouter.mjs';
379
380 import { CommonBase, UInt5, WitnessVersion, UnqualifiedError } from './CommonBase.mjs';
381 import * as bindings from '../bindings.mjs'
382
383 /**
384  * An Event which you should probably take some action in response to.
385  * 
386  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
387  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
388  * written as it makes no sense to respond to it after reconnecting to peers).
389  */
390 export class Event extends CommonBase {
391         protected constructor(_dummy: object, ptr: bigint) { super(ptr, bindings.Event_free); }
392         /* @internal */
393         public static constr_from_ptr(ptr: bigint): Event {
394                 const raw_ty: number = bindings.LDKEvent_ty_from_ptr(ptr);
395                 switch (raw_ty) {
396                         case 0: return new Event_FundingGenerationReady(ptr);
397                         case 1: return new Event_PaymentReceived(ptr);
398                         case 2: return new Event_PaymentClaimed(ptr);
399                         case 3: return new Event_PaymentSent(ptr);
400                         case 4: return new Event_PaymentFailed(ptr);
401                         case 5: return new Event_PaymentPathSuccessful(ptr);
402                         case 6: return new Event_PaymentPathFailed(ptr);
403                         case 7: return new Event_ProbeSuccessful(ptr);
404                         case 8: return new Event_ProbeFailed(ptr);
405                         case 9: return new Event_PendingHTLCsForwardable(ptr);
406                         case 10: return new Event_SpendableOutputs(ptr);
407                         case 11: return new Event_PaymentForwarded(ptr);
408                         case 12: return new Event_ChannelClosed(ptr);
409                         case 13: return new Event_DiscardFunding(ptr);
410                         case 14: return new Event_OpenChannelRequest(ptr);
411                         case 15: return new Event_HTLCHandlingFailed(ptr);
412                         default:
413                                 throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
414                 }
415         }
416
417         public clone_ptr(): bigint {
418                 const ret: bigint = bindings.Event_clone_ptr(this.ptr);
419                 return ret;
420         }
421
422         /**
423          * Creates a copy of the Event
424          */
425         public clone(): Event {
426                 const ret: bigint = bindings.Event_clone(this.ptr);
427                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
428                 CommonBase.add_ref_from(ret_hu_conv, this);
429                 return ret_hu_conv;
430         }
431
432         /**
433          * Utility method to constructs a new FundingGenerationReady-variant Event
434          */
435         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 {
436                 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);
437                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
438                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
439                 return ret_hu_conv;
440         }
441
442         /**
443          * Utility method to constructs a new PaymentReceived-variant Event
444          */
445         public static constructor_payment_received(payment_hash: Uint8Array, amount_msat: bigint, purpose: PaymentPurpose): Event {
446                 const ret: bigint = bindings.Event_payment_received(bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), amount_msat, CommonBase.get_ptr_of(purpose));
447                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
448                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
449                 return ret_hu_conv;
450         }
451
452         /**
453          * Utility method to constructs a new PaymentClaimed-variant Event
454          */
455         public static constructor_payment_claimed(payment_hash: Uint8Array, amount_msat: bigint, purpose: PaymentPurpose): Event {
456                 const ret: bigint = bindings.Event_payment_claimed(bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), amount_msat, CommonBase.get_ptr_of(purpose));
457                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
458                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
459                 return ret_hu_conv;
460         }
461
462         /**
463          * Utility method to constructs a new PaymentSent-variant Event
464          */
465         public static constructor_payment_sent(payment_id: Uint8Array, payment_preimage: Uint8Array, payment_hash: Uint8Array, fee_paid_msat: Option_u64Z): Event {
466                 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));
467                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
468                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
469                 return ret_hu_conv;
470         }
471
472         /**
473          * Utility method to constructs a new PaymentFailed-variant Event
474          */
475         public static constructor_payment_failed(payment_id: Uint8Array, payment_hash: Uint8Array): Event {
476                 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)));
477                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
478                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
479                 return ret_hu_conv;
480         }
481
482         /**
483          * Utility method to constructs a new PaymentPathSuccessful-variant Event
484          */
485         public static constructor_payment_path_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[]): Event {
486                 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));
487                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
488                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
489                 path.forEach((path_conv_10: RouteHop) => { CommonBase.add_ref_from(ret_hu_conv, path_conv_10); });
490                 return ret_hu_conv;
491         }
492
493         /**
494          * Utility method to constructs a new PaymentPathFailed-variant Event
495          */
496         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 {
497                 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));
498                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
499                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
500                 path.forEach((path_conv_10: RouteHop) => { CommonBase.add_ref_from(ret_hu_conv, path_conv_10); });
501                 CommonBase.add_ref_from(ret_hu_conv, retry);
502                 return ret_hu_conv;
503         }
504
505         /**
506          * Utility method to constructs a new ProbeSuccessful-variant Event
507          */
508         public static constructor_probe_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[]): Event {
509                 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));
510                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
511                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
512                 path.forEach((path_conv_10: RouteHop) => { CommonBase.add_ref_from(ret_hu_conv, path_conv_10); });
513                 return ret_hu_conv;
514         }
515
516         /**
517          * Utility method to constructs a new ProbeFailed-variant Event
518          */
519         public static constructor_probe_failed(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[], short_channel_id: Option_u64Z): Event {
520                 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));
521                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
522                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
523                 path.forEach((path_conv_10: RouteHop) => { CommonBase.add_ref_from(ret_hu_conv, path_conv_10); });
524                 return ret_hu_conv;
525         }
526
527         /**
528          * Utility method to constructs a new PendingHTLCsForwardable-variant Event
529          */
530         public static constructor_pending_htlcs_forwardable(time_forwardable: bigint): Event {
531                 const ret: bigint = bindings.Event_pending_htlcs_forwardable(time_forwardable);
532                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
533                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
534                 return ret_hu_conv;
535         }
536
537         /**
538          * Utility method to constructs a new SpendableOutputs-variant Event
539          */
540         public static constructor_spendable_outputs(outputs: SpendableOutputDescriptor[]): Event {
541                 const ret: bigint = bindings.Event_spendable_outputs(bindings.encodeUint64Array(outputs != null ? outputs.map(outputs_conv_27 => CommonBase.get_ptr_of(outputs_conv_27)) : null));
542                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
543                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
544                 return ret_hu_conv;
545         }
546
547         /**
548          * Utility method to constructs a new PaymentForwarded-variant Event
549          */
550         public static constructor_payment_forwarded(prev_channel_id: Uint8Array, next_channel_id: Uint8Array, fee_earned_msat: Option_u64Z, claim_from_onchain_tx: boolean): Event {
551                 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);
552                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
553                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
554                 return ret_hu_conv;
555         }
556
557         /**
558          * Utility method to constructs a new ChannelClosed-variant Event
559          */
560         public static constructor_channel_closed(channel_id: Uint8Array, user_channel_id: bigint, reason: ClosureReason): Event {
561                 const ret: bigint = bindings.Event_channel_closed(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), user_channel_id, CommonBase.get_ptr_of(reason));
562                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
563                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
564                 return ret_hu_conv;
565         }
566
567         /**
568          * Utility method to constructs a new DiscardFunding-variant Event
569          */
570         public static constructor_discard_funding(channel_id: Uint8Array, transaction: Uint8Array): Event {
571                 const ret: bigint = bindings.Event_discard_funding(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(transaction));
572                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
573                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
574                 return ret_hu_conv;
575         }
576
577         /**
578          * Utility method to constructs a new OpenChannelRequest-variant Event
579          */
580         public static constructor_open_channel_request(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_satoshis: bigint, push_msat: bigint, channel_type: ChannelTypeFeatures): Event {
581                 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));
582                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
583                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
584                 CommonBase.add_ref_from(ret_hu_conv, channel_type);
585                 return ret_hu_conv;
586         }
587
588         /**
589          * Utility method to constructs a new HTLCHandlingFailed-variant Event
590          */
591         public static constructor_htlchandling_failed(prev_channel_id: Uint8Array, failed_next_destination: HTLCDestination): Event {
592                 const ret: bigint = bindings.Event_htlchandling_failed(bindings.encodeUint8Array(bindings.check_arr_len(prev_channel_id, 32)), CommonBase.get_ptr_of(failed_next_destination));
593                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
594                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
595                 return ret_hu_conv;
596         }
597
598         /**
599          * Serialize the Event object into a byte array which can be read by Event_read
600          */
601         public write(): Uint8Array {
602                 const ret: number = bindings.Event_write(this.ptr);
603                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
604                 return ret_conv;
605         }
606
607 }
608 /** A Event of type FundingGenerationReady */
609 export class Event_FundingGenerationReady extends Event {
610         /**
611          * The random channel_id we picked which you'll need to pass into
612          * [`ChannelManager::funding_transaction_generated`].
613          * 
614          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
615          */
616         public temporary_channel_id: Uint8Array;
617         /**
618          * The counterparty's node_id, which you'll need to pass back into
619          * [`ChannelManager::funding_transaction_generated`].
620          * 
621          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
622          */
623         public counterparty_node_id: Uint8Array;
624         /**
625          * The value, in satoshis, that the output should have.
626          */
627         public channel_value_satoshis: bigint;
628         /**
629          * The script which should be used in the transaction output.
630          */
631         public output_script: Uint8Array;
632         /**
633          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
634          * an inbound channel.
635          * 
636          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
637          */
638         public user_channel_id: bigint;
639         /* @internal */
640         public constructor(ptr: bigint) {
641                 super(null, ptr);
642                 const temporary_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr);
643                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
644                 this.temporary_channel_id = temporary_channel_id_conv;
645                 const counterparty_node_id: number = bindings.LDKEvent_FundingGenerationReady_get_counterparty_node_id(ptr);
646                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
647                 this.counterparty_node_id = counterparty_node_id_conv;
648                 this.channel_value_satoshis = bindings.LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr);
649                 const output_script: number = bindings.LDKEvent_FundingGenerationReady_get_output_script(ptr);
650                 const output_script_conv: Uint8Array = bindings.decodeUint8Array(output_script);
651                 this.output_script = output_script_conv;
652                 this.user_channel_id = bindings.LDKEvent_FundingGenerationReady_get_user_channel_id(ptr);
653         }
654 }
655 /** A Event of type PaymentReceived */
656 export class Event_PaymentReceived extends Event {
657         /**
658          * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
659          * not stop you from registering duplicate payment hashes for inbound payments.
660          */
661         public payment_hash: Uint8Array;
662         /**
663          * The value, in thousandths of a satoshi, that this payment is for.
664          */
665         public amount_msat: bigint;
666         /**
667          * Information for claiming this received payment, based on whether the purpose of the
668          * payment is to pay an invoice or to send a spontaneous payment.
669          */
670         public purpose: PaymentPurpose;
671         /* @internal */
672         public constructor(ptr: bigint) {
673                 super(null, ptr);
674                 const payment_hash: number = bindings.LDKEvent_PaymentReceived_get_payment_hash(ptr);
675                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
676                 this.payment_hash = payment_hash_conv;
677                 this.amount_msat = bindings.LDKEvent_PaymentReceived_get_amount_msat(ptr);
678                 const purpose: bigint = bindings.LDKEvent_PaymentReceived_get_purpose(ptr);
679                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
680                         CommonBase.add_ref_from(purpose_hu_conv, this);
681                 this.purpose = purpose_hu_conv;
682         }
683 }
684 /** A Event of type PaymentClaimed */
685 export class Event_PaymentClaimed extends Event {
686         /**
687          * The payment hash of the claimed payment. Note that LDK will not stop you from
688          * registering duplicate payment hashes for inbound payments.
689          */
690         public payment_hash: Uint8Array;
691         /**
692          * The value, in thousandths of a satoshi, that this payment is for.
693          */
694         public amount_msat: bigint;
695         /**
696          * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
697          * spontaneous payment.
698          */
699         public purpose: PaymentPurpose;
700         /* @internal */
701         public constructor(ptr: bigint) {
702                 super(null, ptr);
703                 const payment_hash: number = bindings.LDKEvent_PaymentClaimed_get_payment_hash(ptr);
704                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
705                 this.payment_hash = payment_hash_conv;
706                 this.amount_msat = bindings.LDKEvent_PaymentClaimed_get_amount_msat(ptr);
707                 const purpose: bigint = bindings.LDKEvent_PaymentClaimed_get_purpose(ptr);
708                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
709                         CommonBase.add_ref_from(purpose_hu_conv, this);
710                 this.purpose = purpose_hu_conv;
711         }
712 }
713 /** A Event of type PaymentSent */
714 export class Event_PaymentSent extends Event {
715         /**
716          * The id returned by [`ChannelManager::send_payment`] and used with
717          * [`ChannelManager::retry_payment`].
718          * 
719          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
720          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
721          * 
722          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
723          */
724         public payment_id: Uint8Array;
725         /**
726          * The preimage to the hash given to ChannelManager::send_payment.
727          * Note that this serves as a payment receipt, if you wish to have such a thing, you must
728          * store it somehow!
729          */
730         public payment_preimage: Uint8Array;
731         /**
732          * The hash that was given to [`ChannelManager::send_payment`].
733          * 
734          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
735          */
736         public payment_hash: Uint8Array;
737         /**
738          * The total fee which was spent at intermediate hops in this payment, across all paths.
739          * 
740          * Note that, like [`Route::get_total_fees`] this does *not* include any potential
741          * overpayment to the recipient node.
742          * 
743          * If the recipient or an intermediate node misbehaves and gives us free money, this may
744          * overstate the amount paid, though this is unlikely.
745          * 
746          * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
747          */
748         public fee_paid_msat: Option_u64Z;
749         /* @internal */
750         public constructor(ptr: bigint) {
751                 super(null, ptr);
752                 const payment_id: number = bindings.LDKEvent_PaymentSent_get_payment_id(ptr);
753                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
754                 this.payment_id = payment_id_conv;
755                 const payment_preimage: number = bindings.LDKEvent_PaymentSent_get_payment_preimage(ptr);
756                 const payment_preimage_conv: Uint8Array = bindings.decodeUint8Array(payment_preimage);
757                 this.payment_preimage = payment_preimage_conv;
758                 const payment_hash: number = bindings.LDKEvent_PaymentSent_get_payment_hash(ptr);
759                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
760                 this.payment_hash = payment_hash_conv;
761                 const fee_paid_msat: bigint = bindings.LDKEvent_PaymentSent_get_fee_paid_msat(ptr);
762                 const fee_paid_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_paid_msat);
763                         CommonBase.add_ref_from(fee_paid_msat_hu_conv, this);
764                 this.fee_paid_msat = fee_paid_msat_hu_conv;
765         }
766 }
767 /** A Event of type PaymentFailed */
768 export class Event_PaymentFailed extends Event {
769         /**
770          * The id returned by [`ChannelManager::send_payment`] and used with
771          * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
772          * 
773          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
774          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
775          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
776          */
777         public payment_id: Uint8Array;
778         /**
779          * The hash that was given to [`ChannelManager::send_payment`].
780          * 
781          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
782          */
783         public payment_hash: Uint8Array;
784         /* @internal */
785         public constructor(ptr: bigint) {
786                 super(null, ptr);
787                 const payment_id: number = bindings.LDKEvent_PaymentFailed_get_payment_id(ptr);
788                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
789                 this.payment_id = payment_id_conv;
790                 const payment_hash: number = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr);
791                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
792                 this.payment_hash = payment_hash_conv;
793         }
794 }
795 /** A Event of type PaymentPathSuccessful */
796 export class Event_PaymentPathSuccessful extends Event {
797         /**
798          * The id returned by [`ChannelManager::send_payment`] and used with
799          * [`ChannelManager::retry_payment`].
800          * 
801          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
802          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
803          */
804         public payment_id: Uint8Array;
805         /**
806          * The hash that was given to [`ChannelManager::send_payment`].
807          * 
808          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
809          * 
810          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
811          */
812         public payment_hash: Uint8Array;
813         /**
814          * The payment path that was successful.
815          * 
816          * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
817          */
818         public path: RouteHop[];
819         /* @internal */
820         public constructor(ptr: bigint) {
821                 super(null, ptr);
822                 const payment_id: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_id(ptr);
823                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
824                 this.payment_id = payment_id_conv;
825                 const payment_hash: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr);
826                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
827                 this.payment_hash = payment_hash_conv;
828                 const path: number = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr);
829                 const path_conv_10_len: number = bindings.getArrayLength(path);
830                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
831                         for (var k = 0; k < path_conv_10_len; k++) {
832                                 const path_conv_10: bigint = bindings.getU64ArrayElem(path, k);
833                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
834                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
835                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
836                         }
837                         bindings.freeWasmMemory(path)
838                 this.path = path_conv_10_arr;
839         }
840 }
841 /** A Event of type PaymentPathFailed */
842 export class Event_PaymentPathFailed extends Event {
843         /**
844          * The id returned by [`ChannelManager::send_payment`] and used with
845          * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
846          * 
847          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
848          * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
849          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
850          * 
851          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
852          */
853         public payment_id: Uint8Array;
854         /**
855          * The hash that was given to [`ChannelManager::send_payment`].
856          * 
857          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
858          */
859         public payment_hash: Uint8Array;
860         /**
861          * Indicates the payment was rejected for some reason by the recipient. This implies that
862          * the payment has failed, not just the route in question. If this is not set, you may
863          * retry the payment via a different route.
864          */
865         public payment_failed_permanently: boolean;
866         /**
867          * Any failure information conveyed via the Onion return packet by a node along the failed
868          * payment route.
869          * 
870          * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
871          * account the update.
872          * 
873          * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
874          */
875         public network_update: Option_NetworkUpdateZ;
876         /**
877          * For both single-path and multi-path payments, this is set if all paths of the payment have
878          * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
879          * larger MPP payment were still in flight when this event was generated.
880          * 
881          * Note that if you are retrying individual MPP parts, using this value to determine if a
882          * payment has fully failed is race-y. Because multiple failures can happen prior to events
883          * being processed, you may retry in response to a first failure, with a second failure
884          * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
885          * you will see `all_paths_failed` set even though the retry of the first failure still
886          * has an associated in-flight HTLC. See (1) for an example of such a failure.
887          * 
888          * If you wish to retry individual MPP parts and learn when a payment has failed, you must
889          * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
890          * 
891          * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
892          * 
893          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
894          */
895         public all_paths_failed: boolean;
896         /**
897          * The payment path that failed.
898          */
899         public path: RouteHop[];
900         /**
901          * The channel responsible for the failed payment path.
902          * 
903          * Note that for route hints or for the first hop in a path this may be an SCID alias and
904          * may not refer to a channel in the public network graph. These aliases may also collide
905          * with channels in the public network graph.
906          * 
907          * If this is `Some`, then the corresponding channel should be avoided when the payment is
908          * retried. May be `None` for older [`Event`] serializations.
909          */
910         public short_channel_id: Option_u64Z;
911         /**
912          * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
913          * 
914          * See [`find_route`] for details.
915          * 
916          * [`Route`]: crate::routing::router::Route
917          * [`find_route`]: crate::routing::router::find_route
918          * 
919          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
920          */
921         public retry: RouteParameters;
922         /* @internal */
923         public constructor(ptr: bigint) {
924                 super(null, ptr);
925                 const payment_id: number = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr);
926                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
927                 this.payment_id = payment_id_conv;
928                 const payment_hash: number = bindings.LDKEvent_PaymentPathFailed_get_payment_hash(ptr);
929                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
930                 this.payment_hash = payment_hash_conv;
931                 this.payment_failed_permanently = bindings.LDKEvent_PaymentPathFailed_get_payment_failed_permanently(ptr);
932                 const network_update: bigint = bindings.LDKEvent_PaymentPathFailed_get_network_update(ptr);
933                 const network_update_hu_conv: Option_NetworkUpdateZ = Option_NetworkUpdateZ.constr_from_ptr(network_update);
934                         CommonBase.add_ref_from(network_update_hu_conv, this);
935                 this.network_update = network_update_hu_conv;
936                 this.all_paths_failed = bindings.LDKEvent_PaymentPathFailed_get_all_paths_failed(ptr);
937                 const path: number = bindings.LDKEvent_PaymentPathFailed_get_path(ptr);
938                 const path_conv_10_len: number = bindings.getArrayLength(path);
939                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
940                         for (var k = 0; k < path_conv_10_len; k++) {
941                                 const path_conv_10: bigint = bindings.getU64ArrayElem(path, k);
942                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
943                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
944                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
945                         }
946                         bindings.freeWasmMemory(path)
947                 this.path = path_conv_10_arr;
948                 const short_channel_id: bigint = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr);
949                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
950                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
951                 this.short_channel_id = short_channel_id_hu_conv;
952                 const retry: bigint = bindings.LDKEvent_PaymentPathFailed_get_retry(ptr);
953                 const retry_hu_conv: RouteParameters = new RouteParameters(null, retry);
954                         CommonBase.add_ref_from(retry_hu_conv, this);
955                 this.retry = retry_hu_conv;
956         }
957 }
958 /** A Event of type ProbeSuccessful */
959 export class Event_ProbeSuccessful extends Event {
960         /**
961          * The id returned by [`ChannelManager::send_probe`].
962          * 
963          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
964          */
965         public payment_id: Uint8Array;
966         /**
967          * The hash generated by [`ChannelManager::send_probe`].
968          * 
969          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
970          */
971         public payment_hash: Uint8Array;
972         /**
973          * The payment path that was successful.
974          */
975         public path: RouteHop[];
976         /* @internal */
977         public constructor(ptr: bigint) {
978                 super(null, ptr);
979                 const payment_id: number = bindings.LDKEvent_ProbeSuccessful_get_payment_id(ptr);
980                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
981                 this.payment_id = payment_id_conv;
982                 const payment_hash: number = bindings.LDKEvent_ProbeSuccessful_get_payment_hash(ptr);
983                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
984                 this.payment_hash = payment_hash_conv;
985                 const path: number = bindings.LDKEvent_ProbeSuccessful_get_path(ptr);
986                 const path_conv_10_len: number = bindings.getArrayLength(path);
987                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
988                         for (var k = 0; k < path_conv_10_len; k++) {
989                                 const path_conv_10: bigint = bindings.getU64ArrayElem(path, k);
990                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
991                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
992                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
993                         }
994                         bindings.freeWasmMemory(path)
995                 this.path = path_conv_10_arr;
996         }
997 }
998 /** A Event of type ProbeFailed */
999 export class Event_ProbeFailed extends Event {
1000         /**
1001          * The id returned by [`ChannelManager::send_probe`].
1002          * 
1003          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1004          */
1005         public payment_id: Uint8Array;
1006         /**
1007          * The hash generated by [`ChannelManager::send_probe`].
1008          * 
1009          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1010          */
1011         public payment_hash: Uint8Array;
1012         /**
1013          * The payment path that failed.
1014          */
1015         public path: RouteHop[];
1016         /**
1017          * The channel responsible for the failed probe.
1018          * 
1019          * Note that for route hints or for the first hop in a path this may be an SCID alias and
1020          * may not refer to a channel in the public network graph. These aliases may also collide
1021          * with channels in the public network graph.
1022          */
1023         public short_channel_id: Option_u64Z;
1024         /* @internal */
1025         public constructor(ptr: bigint) {
1026                 super(null, ptr);
1027                 const payment_id: number = bindings.LDKEvent_ProbeFailed_get_payment_id(ptr);
1028                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1029                 this.payment_id = payment_id_conv;
1030                 const payment_hash: number = bindings.LDKEvent_ProbeFailed_get_payment_hash(ptr);
1031                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1032                 this.payment_hash = payment_hash_conv;
1033                 const path: number = bindings.LDKEvent_ProbeFailed_get_path(ptr);
1034                 const path_conv_10_len: number = bindings.getArrayLength(path);
1035                         const path_conv_10_arr: RouteHop[] = new Array(path_conv_10_len).fill(null);
1036                         for (var k = 0; k < path_conv_10_len; k++) {
1037                                 const path_conv_10: bigint = bindings.getU64ArrayElem(path, k);
1038                                 const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
1039                                 CommonBase.add_ref_from(path_conv_10_hu_conv, this);
1040                                 path_conv_10_arr[k] = path_conv_10_hu_conv;
1041                         }
1042                         bindings.freeWasmMemory(path)
1043                 this.path = path_conv_10_arr;
1044                 const short_channel_id: bigint = bindings.LDKEvent_ProbeFailed_get_short_channel_id(ptr);
1045                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1046                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1047                 this.short_channel_id = short_channel_id_hu_conv;
1048         }
1049 }
1050 /** A Event of type PendingHTLCsForwardable */
1051 export class Event_PendingHTLCsForwardable extends Event {
1052         /**
1053          * The minimum amount of time that should be waited prior to calling
1054          * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1055          * you should wait a random amount of time in roughly the range (now + time_forwardable,
1056          * now + 5*time_forwardable).
1057          */
1058         public time_forwardable: bigint;
1059         /* @internal */
1060         public constructor(ptr: bigint) {
1061                 super(null, ptr);
1062                 this.time_forwardable = bindings.LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr);
1063         }
1064 }
1065 /** A Event of type SpendableOutputs */
1066 export class Event_SpendableOutputs extends Event {
1067         /**
1068          * The outputs which you should store as spendable by you.
1069          */
1070         public outputs: SpendableOutputDescriptor[];
1071         /* @internal */
1072         public constructor(ptr: bigint) {
1073                 super(null, ptr);
1074                 const outputs: number = bindings.LDKEvent_SpendableOutputs_get_outputs(ptr);
1075                 const outputs_conv_27_len: number = bindings.getArrayLength(outputs);
1076                         const outputs_conv_27_arr: SpendableOutputDescriptor[] = new Array(outputs_conv_27_len).fill(null);
1077                         for (var b = 0; b < outputs_conv_27_len; b++) {
1078                                 const outputs_conv_27: bigint = bindings.getU64ArrayElem(outputs, b);
1079                                 const outputs_conv_27_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
1080                                 CommonBase.add_ref_from(outputs_conv_27_hu_conv, this);
1081                                 outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
1082                         }
1083                         bindings.freeWasmMemory(outputs)
1084                 this.outputs = outputs_conv_27_arr;
1085         }
1086 }
1087 /** A Event of type PaymentForwarded */
1088 export class Event_PaymentForwarded extends Event {
1089         /**
1090          * The incoming channel between the previous node and us. This is only `None` for events
1091          * generated or serialized by versions prior to 0.0.107.
1092          * 
1093          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1094          */
1095         public prev_channel_id: Uint8Array;
1096         /**
1097          * The outgoing channel between the next node and us. This is only `None` for events
1098          * generated or serialized by versions prior to 0.0.107.
1099          * 
1100          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1101          */
1102         public next_channel_id: Uint8Array;
1103         /**
1104          * The fee, in milli-satoshis, which was earned as a result of the payment.
1105          * 
1106          * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
1107          * was pending, the amount the next hop claimed will have been rounded down to the nearest
1108          * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
1109          * claimed the full value in millisatoshis from the source. In this case,
1110          * `claim_from_onchain_tx` will be set.
1111          * 
1112          * If the channel which sent us the payment has been force-closed, we will claim the funds
1113          * via an on-chain transaction. In that case we do not yet know the on-chain transaction
1114          * fees which we will spend and will instead set this to `None`. It is possible duplicate
1115          * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
1116          * `None`.
1117          */
1118         public fee_earned_msat: Option_u64Z;
1119         /**
1120          * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
1121          * transaction.
1122          */
1123         public claim_from_onchain_tx: boolean;
1124         /* @internal */
1125         public constructor(ptr: bigint) {
1126                 super(null, ptr);
1127                 const prev_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr);
1128                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1129                 this.prev_channel_id = prev_channel_id_conv;
1130                 const next_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr);
1131                 const next_channel_id_conv: Uint8Array = bindings.decodeUint8Array(next_channel_id);
1132                 this.next_channel_id = next_channel_id_conv;
1133                 const fee_earned_msat: bigint = bindings.LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr);
1134                 const fee_earned_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_earned_msat);
1135                         CommonBase.add_ref_from(fee_earned_msat_hu_conv, this);
1136                 this.fee_earned_msat = fee_earned_msat_hu_conv;
1137                 this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr);
1138         }
1139 }
1140 /** A Event of type ChannelClosed */
1141 export class Event_ChannelClosed extends Event {
1142         /**
1143          * The channel_id of the channel which has been closed. Note that on-chain transactions
1144          * resolving the channel are likely still awaiting confirmation.
1145          */
1146         public channel_id: Uint8Array;
1147         /**
1148          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1149          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1150          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1151          * `user_channel_id` will be 0 for an inbound channel.
1152          * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
1153          * 
1154          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1155          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1156          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1157          */
1158         public user_channel_id: bigint;
1159         /**
1160          * The reason the channel was closed.
1161          */
1162         public reason: ClosureReason;
1163         /* @internal */
1164         public constructor(ptr: bigint) {
1165                 super(null, ptr);
1166                 const channel_id: number = bindings.LDKEvent_ChannelClosed_get_channel_id(ptr);
1167                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1168                 this.channel_id = channel_id_conv;
1169                 this.user_channel_id = bindings.LDKEvent_ChannelClosed_get_user_channel_id(ptr);
1170                 const reason: bigint = bindings.LDKEvent_ChannelClosed_get_reason(ptr);
1171                 const reason_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(reason);
1172                         CommonBase.add_ref_from(reason_hu_conv, this);
1173                 this.reason = reason_hu_conv;
1174         }
1175 }
1176 /** A Event of type DiscardFunding */
1177 export class Event_DiscardFunding extends Event {
1178         /**
1179          * The channel_id of the channel which has been closed.
1180          */
1181         public channel_id: Uint8Array;
1182         /**
1183          * The full transaction received from the user
1184          */
1185         public transaction: Uint8Array;
1186         /* @internal */
1187         public constructor(ptr: bigint) {
1188                 super(null, ptr);
1189                 const channel_id: number = bindings.LDKEvent_DiscardFunding_get_channel_id(ptr);
1190                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1191                 this.channel_id = channel_id_conv;
1192                 const transaction: number = bindings.LDKEvent_DiscardFunding_get_transaction(ptr);
1193                 const transaction_conv: Uint8Array = bindings.decodeUint8Array(transaction);
1194                 this.transaction = transaction_conv;
1195         }
1196 }
1197 /** A Event of type OpenChannelRequest */
1198 export class Event_OpenChannelRequest extends Event {
1199         /**
1200          * The temporary channel ID of the channel requested to be opened.
1201          * 
1202          * When responding to the request, the `temporary_channel_id` should be passed
1203          * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
1204          * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
1205          * 
1206          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1207          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1208          */
1209         public temporary_channel_id: Uint8Array;
1210         /**
1211          * The node_id of the counterparty requesting to open the channel.
1212          * 
1213          * When responding to the request, the `counterparty_node_id` should be passed
1214          * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
1215          * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
1216          * request.
1217          * 
1218          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1219          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1220          */
1221         public counterparty_node_id: Uint8Array;
1222         /**
1223          * The channel value of the requested channel.
1224          */
1225         public funding_satoshis: bigint;
1226         /**
1227          * Our starting balance in the channel if the request is accepted, in milli-satoshi.
1228          */
1229         public push_msat: bigint;
1230         /**
1231          * The features that this channel will operate with. If you reject the channel, a
1232          * well-behaved counterparty may automatically re-attempt the channel with a new set of
1233          * feature flags.
1234          * 
1235          * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
1236          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1237          * 0.0.106.
1238          * 
1239          * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
1240          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1241          * 0.0.107. Channels setting this type also need to get manually accepted via
1242          * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
1243          * or will be rejected otherwise.
1244          * 
1245          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1246          */
1247         public channel_type: ChannelTypeFeatures;
1248         /* @internal */
1249         public constructor(ptr: bigint) {
1250                 super(null, ptr);
1251                 const temporary_channel_id: number = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr);
1252                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
1253                 this.temporary_channel_id = temporary_channel_id_conv;
1254                 const counterparty_node_id: number = bindings.LDKEvent_OpenChannelRequest_get_counterparty_node_id(ptr);
1255                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1256                 this.counterparty_node_id = counterparty_node_id_conv;
1257                 this.funding_satoshis = bindings.LDKEvent_OpenChannelRequest_get_funding_satoshis(ptr);
1258                 this.push_msat = bindings.LDKEvent_OpenChannelRequest_get_push_msat(ptr);
1259                 const channel_type: bigint = bindings.LDKEvent_OpenChannelRequest_get_channel_type(ptr);
1260                 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1261                         CommonBase.add_ref_from(channel_type_hu_conv, this);
1262                 this.channel_type = channel_type_hu_conv;
1263         }
1264 }
1265 /** A Event of type HTLCHandlingFailed */
1266 export class Event_HTLCHandlingFailed extends Event {
1267         /**
1268          * The channel over which the HTLC was received.
1269          */
1270         public prev_channel_id: Uint8Array;
1271         /**
1272          * Destination of the HTLC that failed to be processed.
1273          */
1274         public failed_next_destination: HTLCDestination;
1275         /* @internal */
1276         public constructor(ptr: bigint) {
1277                 super(null, ptr);
1278                 const prev_channel_id: number = bindings.LDKEvent_HTLCHandlingFailed_get_prev_channel_id(ptr);
1279                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1280                 this.prev_channel_id = prev_channel_id_conv;
1281                 const failed_next_destination: bigint = bindings.LDKEvent_HTLCHandlingFailed_get_failed_next_destination(ptr);
1282                 const failed_next_destination_hu_conv: HTLCDestination = HTLCDestination.constr_from_ptr(failed_next_destination);
1283                         CommonBase.add_ref_from(failed_next_destination_hu_conv, this);
1284                 this.failed_next_destination = failed_next_destination_hu_conv;
1285         }
1286 }