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