[TS] Update auto-generated bindings to LDK 0.0.115
[ldk-java] / ts / structs / Event.mts
1 import { TxOut } from '../structs/TxOut.mjs';
2 import { BigEndianScalar } from '../structs/BigEndianScalar.mjs';
3 import { COption_NoneZ } from '../enums/COption_NoneZ.mjs';
4 import { ChannelMonitorUpdateStatus } from '../enums/ChannelMonitorUpdateStatus.mjs';
5 import { ConfirmationTarget } from '../enums/ConfirmationTarget.mjs';
6 import { CreationError } from '../enums/CreationError.mjs';
7 import { Currency } from '../enums/Currency.mjs';
8 import { FailureCode } from '../enums/FailureCode.mjs';
9 import { HTLCClaim } from '../enums/HTLCClaim.mjs';
10 import { IOError } from '../enums/IOError.mjs';
11 import { Level } from '../enums/Level.mjs';
12 import { Network } from '../enums/Network.mjs';
13 import { PaymentFailureReason } from '../enums/PaymentFailureReason.mjs';
14 import { Recipient } from '../enums/Recipient.mjs';
15 import { RetryableSendFailure } from '../enums/RetryableSendFailure.mjs';
16 import { Secp256k1Error } from '../enums/Secp256k1Error.mjs';
17 import { SemanticError } from '../enums/SemanticError.mjs';
18 import { SiPrefix } from '../enums/SiPrefix.mjs';
19 import { UtxoLookupError } from '../enums/UtxoLookupError.mjs';
20 import { Bech32Error } from '../structs/Bech32Error.mjs';
21 import { Option_DurationZ } from '../structs/Option_DurationZ.mjs';
22 import { BlindedPath } from '../structs/BlindedPath.mjs';
23 import { Option_u64Z } from '../structs/Option_u64Z.mjs';
24 import { ShutdownScript } from '../structs/ShutdownScript.mjs';
25 import { APIError } from '../structs/APIError.mjs';
26 import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs';
27 import { Option_CVec_u8ZZ } from '../structs/Option_CVec_u8ZZ.mjs';
28 import { RecipientOnionFields } from '../structs/RecipientOnionFields.mjs';
29 import { DecodeError } from '../structs/DecodeError.mjs';
30 import { Result_RecipientOnionFieldsDecodeErrorZ } from '../structs/Result_RecipientOnionFieldsDecodeErrorZ.mjs';
31 import { Option_HTLCClaimZ } from '../structs/Option_HTLCClaimZ.mjs';
32 import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs';
33 import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs';
34 import { Result_CounterpartyCommitmentSecretsDecodeErrorZ } from '../structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.mjs';
35 import { TxCreationKeys } from '../structs/TxCreationKeys.mjs';
36 import { Result_TxCreationKeysDecodeErrorZ } from '../structs/Result_TxCreationKeysDecodeErrorZ.mjs';
37 import { ChannelPublicKeys } from '../structs/ChannelPublicKeys.mjs';
38 import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelPublicKeysDecodeErrorZ.mjs';
39 import { Option_u32Z } from '../structs/Option_u32Z.mjs';
40 import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs';
41 import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs';
42 import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs';
43 import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs';
44 import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs';
45 import { Result_ChannelTransactionParametersDecodeErrorZ } from '../structs/Result_ChannelTransactionParametersDecodeErrorZ.mjs';
46 import { HolderCommitmentTransaction } from '../structs/HolderCommitmentTransaction.mjs';
47 import { Result_HolderCommitmentTransactionDecodeErrorZ } from '../structs/Result_HolderCommitmentTransactionDecodeErrorZ.mjs';
48 import { BuiltCommitmentTransaction } from '../structs/BuiltCommitmentTransaction.mjs';
49 import { Result_BuiltCommitmentTransactionDecodeErrorZ } from '../structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mjs';
50 import { TrustedClosingTransaction } from '../structs/TrustedClosingTransaction.mjs';
51 import { Result_TrustedClosingTransactionNoneZ } from '../structs/Result_TrustedClosingTransactionNoneZ.mjs';
52 import { CommitmentTransaction } from '../structs/CommitmentTransaction.mjs';
53 import { Result_CommitmentTransactionDecodeErrorZ } from '../structs/Result_CommitmentTransactionDecodeErrorZ.mjs';
54 import { TrustedCommitmentTransaction } from '../structs/TrustedCommitmentTransaction.mjs';
55 import { Result_TrustedCommitmentTransactionNoneZ } from '../structs/Result_TrustedCommitmentTransactionNoneZ.mjs';
56 import { Result_CVec_SignatureZNoneZ } from '../structs/Result_CVec_SignatureZNoneZ.mjs';
57 import { Result_ShutdownScriptDecodeErrorZ } from '../structs/Result_ShutdownScriptDecodeErrorZ.mjs';
58 import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs';
59 import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs';
60 import { BlindedPayInfo } from '../structs/BlindedPayInfo.mjs';
61 import { Result_BlindedPayInfoDecodeErrorZ } from '../structs/Result_BlindedPayInfoDecodeErrorZ.mjs';
62 import { ChannelDetails } from '../structs/ChannelDetails.mjs';
63 import { Route } from '../structs/Route.mjs';
64 import { LightningError } from '../structs/LightningError.mjs';
65 import { Result_RouteLightningErrorZ } from '../structs/Result_RouteLightningErrorZ.mjs';
66 import { InFlightHtlcs } from '../structs/InFlightHtlcs.mjs';
67 import { Result_InFlightHtlcsDecodeErrorZ } from '../structs/Result_InFlightHtlcsDecodeErrorZ.mjs';
68 import { RouteHop } from '../structs/RouteHop.mjs';
69 import { Result_RouteHopDecodeErrorZ } from '../structs/Result_RouteHopDecodeErrorZ.mjs';
70 import { BlindedHop } from '../structs/BlindedHop.mjs';
71 import { BlindedTail } from '../structs/BlindedTail.mjs';
72 import { Result_BlindedTailDecodeErrorZ } from '../structs/Result_BlindedTailDecodeErrorZ.mjs';
73 import { Path } from '../structs/Path.mjs';
74 import { Result_RouteDecodeErrorZ } from '../structs/Result_RouteDecodeErrorZ.mjs';
75 import { RouteParameters } from '../structs/RouteParameters.mjs';
76 import { Result_RouteParametersDecodeErrorZ } from '../structs/Result_RouteParametersDecodeErrorZ.mjs';
77 import { PaymentParameters } from '../structs/PaymentParameters.mjs';
78 import { Result_PaymentParametersDecodeErrorZ } from '../structs/Result_PaymentParametersDecodeErrorZ.mjs';
79 import { TwoTuple_BlindedPayInfoBlindedPathZ } from '../structs/TwoTuple_BlindedPayInfoBlindedPathZ.mjs';
80 import { RouteHint } from '../structs/RouteHint.mjs';
81 import { RouteHintHop } from '../structs/RouteHintHop.mjs';
82 import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs';
83 import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs';
84 import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs';
85 import { TwoTuple_TxidBlockHashZ } from '../structs/TwoTuple_TxidBlockHashZ.mjs';
86 import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
87 import { OutPoint } from '../structs/OutPoint.mjs';
88 import { MonitorEvent } from '../structs/MonitorEvent.mjs';
89 import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs';
90 import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
91 import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
92 import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs';
93 import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs';
94 import { TwoTuple_Z } from '../structs/TwoTuple_Z.mjs';
95 import { TwoTuple__u168_u168Z } from '../structs/TwoTuple__u168_u168Z.mjs';
96 import { Option_C2Tuple_EightU16sEightU16sZZ } from '../structs/Option_C2Tuple_EightU16sEightU16sZZ.mjs';
97 import { NodeId } from '../structs/NodeId.mjs';
98 import { Record } from '../structs/Record.mjs';
99 import { Logger, LoggerInterface } from '../structs/Logger.mjs';
100 import { NetworkGraph } from '../structs/NetworkGraph.mjs';
101 import { ProbabilisticScorer } from '../structs/ProbabilisticScorer.mjs';
102 import { Result_ProbabilisticScorerDecodeErrorZ } from '../structs/Result_ProbabilisticScorerDecodeErrorZ.mjs';
103 import { InitFeatures } from '../structs/InitFeatures.mjs';
104 import { Result_InitFeaturesDecodeErrorZ } from '../structs/Result_InitFeaturesDecodeErrorZ.mjs';
105 import { ChannelFeatures } from '../structs/ChannelFeatures.mjs';
106 import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs';
107 import { NodeFeatures } from '../structs/NodeFeatures.mjs';
108 import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs';
109 import { InvoiceFeatures } from '../structs/InvoiceFeatures.mjs';
110 import { Result_InvoiceFeaturesDecodeErrorZ } from '../structs/Result_InvoiceFeaturesDecodeErrorZ.mjs';
111 import { BlindedHopFeatures } from '../structs/BlindedHopFeatures.mjs';
112 import { Result_BlindedHopFeaturesDecodeErrorZ } from '../structs/Result_BlindedHopFeaturesDecodeErrorZ.mjs';
113 import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs';
114 import { Result_ChannelTypeFeaturesDecodeErrorZ } from '../structs/Result_ChannelTypeFeaturesDecodeErrorZ.mjs';
115 import { PaymentPurpose } from '../structs/PaymentPurpose.mjs';
116 import { Result_PaymentPurposeDecodeErrorZ } from '../structs/Result_PaymentPurposeDecodeErrorZ.mjs';
117 import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
118 import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
119 import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
120 import { PathFailure } from '../structs/PathFailure.mjs';
121 import { Option_PathFailureZ } from '../structs/Option_PathFailureZ.mjs';
122 import { Result_COption_PathFailureZDecodeErrorZ } from '../structs/Result_COption_PathFailureZDecodeErrorZ.mjs';
123 import { UntrustedString } from '../structs/UntrustedString.mjs';
124 import { ClosureReason } from '../structs/ClosureReason.mjs';
125 import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
126 import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
127 import { HTLCDestination } from '../structs/HTLCDestination.mjs';
128 import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs';
129 import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs';
130 import { Result_PaymentFailureReasonDecodeErrorZ } from '../structs/Result_PaymentFailureReasonDecodeErrorZ.mjs';
131 import { Option_u128Z } from '../structs/Option_u128Z.mjs';
132 import { Option_PaymentFailureReasonZ } from '../structs/Option_PaymentFailureReasonZ.mjs';
133 import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs';
134 import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs';
135 import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs';
136 import { Option_EventZ } from '../structs/Option_EventZ.mjs';
137 import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs';
138 import { AcceptChannel } from '../structs/AcceptChannel.mjs';
139 import { OpenChannel } from '../structs/OpenChannel.mjs';
140 import { FundingCreated } from '../structs/FundingCreated.mjs';
141 import { FundingSigned } from '../structs/FundingSigned.mjs';
142 import { ChannelReady } from '../structs/ChannelReady.mjs';
143 import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs';
144 import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs';
145 import { RevokeAndACK } from '../structs/RevokeAndACK.mjs';
146 import { ClosingSigned } from '../structs/ClosingSigned.mjs';
147 import { Shutdown } from '../structs/Shutdown.mjs';
148 import { ChannelReestablish } from '../structs/ChannelReestablish.mjs';
149 import { ChannelAnnouncement } from '../structs/ChannelAnnouncement.mjs';
150 import { NodeAnnouncement } from '../structs/NodeAnnouncement.mjs';
151 import { ErrorMessage } from '../structs/ErrorMessage.mjs';
152 import { WarningMessage } from '../structs/WarningMessage.mjs';
153 import { ErrorAction } from '../structs/ErrorAction.mjs';
154 import { QueryChannelRange } from '../structs/QueryChannelRange.mjs';
155 import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs';
156 import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs';
157 import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs';
158 import { MessageSendEvent } from '../structs/MessageSendEvent.mjs';
159 import { Result_PublicKeyErrorZ } from '../structs/Result_PublicKeyErrorZ.mjs';
160 import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs';
161 import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs';
162 import { Result_TxOutUtxoLookupErrorZ } from '../structs/Result_TxOutUtxoLookupErrorZ.mjs';
163 import { UtxoFuture } from '../structs/UtxoFuture.mjs';
164 import { UtxoResult } from '../structs/UtxoResult.mjs';
165 import { UtxoLookup, UtxoLookupInterface } from '../structs/UtxoLookup.mjs';
166 import { Option_UtxoLookupZ } from '../structs/Option_UtxoLookupZ.mjs';
167 import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs';
168 import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs';
169 import { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ } from '../structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.mjs';
170 import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs';
171 import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs';
172 import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs';
173 import { ChannelInfo } from '../structs/ChannelInfo.mjs';
174 import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
175 import { RoutingFees } from '../structs/RoutingFees.mjs';
176 import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
177 import { Hostname } from '../structs/Hostname.mjs';
178 import { NetAddress } from '../structs/NetAddress.mjs';
179 import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
180 import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
181 import { NodeAlias } from '../structs/NodeAlias.mjs';
182 import { Result_NodeAliasDecodeErrorZ } from '../structs/Result_NodeAliasDecodeErrorZ.mjs';
183 import { NodeInfo } from '../structs/NodeInfo.mjs';
184 import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs';
185 import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs';
186 import { Option_CVec_NetAddressZZ } from '../structs/Option_CVec_NetAddressZZ.mjs';
187 import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs';
188 import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs';
189 import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs';
190 import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs';
191 import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs';
192 import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs';
193 import { Result_PublicKeyNoneZ } from '../structs/Result_PublicKeyNoneZ.mjs';
194 import { Option_ScalarZ } from '../structs/Option_ScalarZ.mjs';
195 import { Result_SharedSecretNoneZ } from '../structs/Result_SharedSecretNoneZ.mjs';
196 import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs';
197 import { ClosingTransaction } from '../structs/ClosingTransaction.mjs';
198 import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs';
199 import { ChannelSigner, ChannelSignerInterface } from '../structs/ChannelSigner.mjs';
200 import { EcdsaChannelSigner, EcdsaChannelSignerInterface } from '../structs/EcdsaChannelSigner.mjs';
201 import { WriteableEcdsaChannelSigner, WriteableEcdsaChannelSignerInterface } from '../structs/WriteableEcdsaChannelSigner.mjs';
202 import { Result_WriteableEcdsaChannelSignerDecodeErrorZ } from '../structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mjs';
203 import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs';
204 import { InMemorySigner } from '../structs/InMemorySigner.mjs';
205 import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs';
206 import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs';
207 import { Option_u16Z } from '../structs/Option_u16Z.mjs';
208 import { Result__u832APIErrorZ } from '../structs/Result__u832APIErrorZ.mjs';
209 import { RecentPaymentDetails } from '../structs/RecentPaymentDetails.mjs';
210 import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs';
211 import { Result_NonePaymentSendFailureZ } from '../structs/Result_NonePaymentSendFailureZ.mjs';
212 import { Result_NoneRetryableSendFailureZ } from '../structs/Result_NoneRetryableSendFailureZ.mjs';
213 import { Result_PaymentHashPaymentSendFailureZ } from '../structs/Result_PaymentHashPaymentSendFailureZ.mjs';
214 import { Result_PaymentHashRetryableSendFailureZ } from '../structs/Result_PaymentHashRetryableSendFailureZ.mjs';
215 import { TwoTuple_PaymentHashPaymentIdZ } from '../structs/TwoTuple_PaymentHashPaymentIdZ.mjs';
216 import { Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ } from '../structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mjs';
217 import { TwoTuple_PaymentHashPaymentSecretZ } from '../structs/TwoTuple_PaymentHashPaymentSecretZ.mjs';
218 import { Result_C2Tuple_PaymentHashPaymentSecretZNoneZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mjs';
219 import { Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mjs';
220 import { Result_PaymentSecretNoneZ } from '../structs/Result_PaymentSecretNoneZ.mjs';
221 import { Result_PaymentSecretAPIErrorZ } from '../structs/Result_PaymentSecretAPIErrorZ.mjs';
222 import { Result_PaymentPreimageAPIErrorZ } from '../structs/Result_PaymentPreimageAPIErrorZ.mjs';
223 import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs';
224 import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs';
225 import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs';
226 import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_ChannelCounterpartyDecodeErrorZ.mjs';
227 import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs';
228 import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs';
229 import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs';
230 import { ChannelMonitor } from '../structs/ChannelMonitor.mjs';
231 import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs';
232 import { Watch, WatchInterface } from '../structs/Watch.mjs';
233 import { BroadcasterInterface, BroadcasterInterfaceInterface } from '../structs/BroadcasterInterface.mjs';
234 import { EntropySource, EntropySourceInterface } from '../structs/EntropySource.mjs';
235 import { UnsignedChannelUpdate } from '../structs/UnsignedChannelUpdate.mjs';
236 import { UnsignedNodeAnnouncement } from '../structs/UnsignedNodeAnnouncement.mjs';
237 import { UnsignedGossipMessage } from '../structs/UnsignedGossipMessage.mjs';
238 import { NodeSigner, NodeSignerInterface } from '../structs/NodeSigner.mjs';
239 import { SignerProvider, SignerProviderInterface } from '../structs/SignerProvider.mjs';
240 import { FeeEstimator, FeeEstimatorInterface } from '../structs/FeeEstimator.mjs';
241 import { Router, RouterInterface } from '../structs/Router.mjs';
242 import { ChannelManager } from '../structs/ChannelManager.mjs';
243 import { TwoTuple_BlockHashChannelManagerZ } from '../structs/TwoTuple_BlockHashChannelManagerZ.mjs';
244 import { Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mjs';
245 import { ChannelConfig } from '../structs/ChannelConfig.mjs';
246 import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs';
247 import { Option_APIErrorZ } from '../structs/Option_APIErrorZ.mjs';
248 import { Result_COption_APIErrorZDecodeErrorZ } from '../structs/Result_COption_APIErrorZDecodeErrorZ.mjs';
249 import { Result_UntrustedStringDecodeErrorZ } from '../structs/Result_UntrustedStringDecodeErrorZ.mjs';
250 import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs';
251 import { Type, TypeInterface } from '../structs/Type.mjs';
252 import { Option_TypeZ } from '../structs/Option_TypeZ.mjs';
253 import { Result_COption_TypeZDecodeErrorZ } from '../structs/Result_COption_TypeZDecodeErrorZ.mjs';
254 import { PaymentError } from '../structs/PaymentError.mjs';
255 import { Result_PaymentIdPaymentErrorZ } from '../structs/Result_PaymentIdPaymentErrorZ.mjs';
256 import { Result_NonePaymentErrorZ } from '../structs/Result_NonePaymentErrorZ.mjs';
257 import { Result_StringErrorZ } from '../structs/Result_StringErrorZ.mjs';
258 import { Result_ChannelMonitorUpdateDecodeErrorZ } from '../structs/Result_ChannelMonitorUpdateDecodeErrorZ.mjs';
259 import { Option_MonitorEventZ } from '../structs/Option_MonitorEventZ.mjs';
260 import { Result_COption_MonitorEventZDecodeErrorZ } from '../structs/Result_COption_MonitorEventZDecodeErrorZ.mjs';
261 import { Result_HTLCUpdateDecodeErrorZ } from '../structs/Result_HTLCUpdateDecodeErrorZ.mjs';
262 import { TwoTuple_OutPointScriptZ } from '../structs/TwoTuple_OutPointScriptZ.mjs';
263 import { TwoTuple_u32ScriptZ } from '../structs/TwoTuple_u32ScriptZ.mjs';
264 import { TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mjs';
265 import { TwoTuple_u32TxOutZ } from '../structs/TwoTuple_u32TxOutZ.mjs';
266 import { TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mjs';
267 import { Balance } from '../structs/Balance.mjs';
268 import { TwoTuple_BlockHashChannelMonitorZ } from '../structs/TwoTuple_BlockHashChannelMonitorZ.mjs';
269 import { Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mjs';
270 import { TwoTuple_PublicKeyTypeZ } from '../structs/TwoTuple_PublicKeyTypeZ.mjs';
271 import { CustomOnionMessageContents, CustomOnionMessageContentsInterface } from '../structs/CustomOnionMessageContents.mjs';
272 import { Option_CustomOnionMessageContentsZ } from '../structs/Option_CustomOnionMessageContentsZ.mjs';
273 import { Result_COption_CustomOnionMessageContentsZDecodeErrorZ } from '../structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.mjs';
274 import { Option_NetAddressZ } from '../structs/Option_NetAddressZ.mjs';
275 import { TwoTuple_PublicKeyCOption_NetAddressZZ } from '../structs/TwoTuple_PublicKeyCOption_NetAddressZZ.mjs';
276 import { PeerHandleError } from '../structs/PeerHandleError.mjs';
277 import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs';
278 import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs';
279 import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs';
280 import { SendError } from '../structs/SendError.mjs';
281 import { Result_NoneSendErrorZ } from '../structs/Result_NoneSendErrorZ.mjs';
282 import { Result_BlindedPathNoneZ } from '../structs/Result_BlindedPathNoneZ.mjs';
283 import { Result_BlindedPathDecodeErrorZ } from '../structs/Result_BlindedPathDecodeErrorZ.mjs';
284 import { Result_BlindedHopDecodeErrorZ } from '../structs/Result_BlindedHopDecodeErrorZ.mjs';
285 import { GraphSyncError } from '../structs/GraphSyncError.mjs';
286 import { Result_u32GraphSyncErrorZ } from '../structs/Result_u32GraphSyncErrorZ.mjs';
287 import { Result_NoneErrorZ } from '../structs/Result_NoneErrorZ.mjs';
288 import { Result_NetAddressDecodeErrorZ } from '../structs/Result_NetAddressDecodeErrorZ.mjs';
289 import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs';
290 import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs';
291 import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs';
292 import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs';
293 import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs';
294 import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs';
295 import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs';
296 import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs';
297 import { ClosingSignedFeeRange } from '../structs/ClosingSignedFeeRange.mjs';
298 import { Result_ClosingSignedFeeRangeDecodeErrorZ } from '../structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mjs';
299 import { CommitmentSigned } from '../structs/CommitmentSigned.mjs';
300 import { Result_CommitmentSignedDecodeErrorZ } from '../structs/Result_CommitmentSignedDecodeErrorZ.mjs';
301 import { Result_FundingCreatedDecodeErrorZ } from '../structs/Result_FundingCreatedDecodeErrorZ.mjs';
302 import { Result_FundingSignedDecodeErrorZ } from '../structs/Result_FundingSignedDecodeErrorZ.mjs';
303 import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyDecodeErrorZ.mjs';
304 import { Init } from '../structs/Init.mjs';
305 import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs';
306 import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs';
307 import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs';
308 import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
309 import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs';
310 import { Result_UpdateFailMalformedHTLCDecodeErrorZ } from '../structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mjs';
311 import { UpdateFee } from '../structs/UpdateFee.mjs';
312 import { Result_UpdateFeeDecodeErrorZ } from '../structs/Result_UpdateFeeDecodeErrorZ.mjs';
313 import { Result_UpdateFulfillHTLCDecodeErrorZ } from '../structs/Result_UpdateFulfillHTLCDecodeErrorZ.mjs';
314 import { Result_UpdateAddHTLCDecodeErrorZ } from '../structs/Result_UpdateAddHTLCDecodeErrorZ.mjs';
315 import { OnionMessage } from '../structs/OnionMessage.mjs';
316 import { Result_OnionMessageDecodeErrorZ } from '../structs/Result_OnionMessageDecodeErrorZ.mjs';
317 import { Ping } from '../structs/Ping.mjs';
318 import { Result_PingDecodeErrorZ } from '../structs/Result_PingDecodeErrorZ.mjs';
319 import { Pong } from '../structs/Pong.mjs';
320 import { Result_PongDecodeErrorZ } from '../structs/Result_PongDecodeErrorZ.mjs';
321 import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs';
322 import { Result_ChannelAnnouncementDecodeErrorZ } from '../structs/Result_ChannelAnnouncementDecodeErrorZ.mjs';
323 import { Result_UnsignedChannelUpdateDecodeErrorZ } from '../structs/Result_UnsignedChannelUpdateDecodeErrorZ.mjs';
324 import { Result_ChannelUpdateDecodeErrorZ } from '../structs/Result_ChannelUpdateDecodeErrorZ.mjs';
325 import { Result_ErrorMessageDecodeErrorZ } from '../structs/Result_ErrorMessageDecodeErrorZ.mjs';
326 import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs';
327 import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
328 import { Result_NodeAnnouncementDecodeErrorZ } from '../structs/Result_NodeAnnouncementDecodeErrorZ.mjs';
329 import { Result_QueryShortChannelIdsDecodeErrorZ } from '../structs/Result_QueryShortChannelIdsDecodeErrorZ.mjs';
330 import { ReplyShortChannelIdsEnd } from '../structs/ReplyShortChannelIdsEnd.mjs';
331 import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mjs';
332 import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs';
333 import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs';
334 import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs';
335 import { WatchedOutput } from '../structs/WatchedOutput.mjs';
336 import { Filter, FilterInterface } from '../structs/Filter.mjs';
337 import { Option_FilterZ } from '../structs/Option_FilterZ.mjs';
338 import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs';
339 import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs';
340 import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs';
341 import { TwoTuple_OutPointCVec_MonitorUpdateIdZZ } from '../structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.mjs';
342 import { Invoice } from '../structs/Invoice.mjs';
343 import { SignOrCreationError } from '../structs/SignOrCreationError.mjs';
344 import { Result_InvoiceSignOrCreationErrorZ } from '../structs/Result_InvoiceSignOrCreationErrorZ.mjs';
345 import { ParseError } from '../structs/ParseError.mjs';
346 import { Result_SiPrefixParseErrorZ } from '../structs/Result_SiPrefixParseErrorZ.mjs';
347 import { ParseOrSemanticError } from '../structs/ParseOrSemanticError.mjs';
348 import { Result_InvoiceParseOrSemanticErrorZ } from '../structs/Result_InvoiceParseOrSemanticErrorZ.mjs';
349 import { SignedRawInvoice } from '../structs/SignedRawInvoice.mjs';
350 import { Result_SignedRawInvoiceParseErrorZ } from '../structs/Result_SignedRawInvoiceParseErrorZ.mjs';
351 import { RawInvoice } from '../structs/RawInvoice.mjs';
352 import { InvoiceSignature } from '../structs/InvoiceSignature.mjs';
353 import { ThreeTuple_RawInvoice_u832InvoiceSignatureZ } from '../structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.mjs';
354 import { PayeePubKey } from '../structs/PayeePubKey.mjs';
355 import { Result_PayeePubKeyErrorZ } from '../structs/Result_PayeePubKeyErrorZ.mjs';
356 import { PrivateRoute } from '../structs/PrivateRoute.mjs';
357 import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs';
358 import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs';
359 import { Result_NoneSemanticErrorZ } from '../structs/Result_NoneSemanticErrorZ.mjs';
360 import { Result_InvoiceSemanticErrorZ } from '../structs/Result_InvoiceSemanticErrorZ.mjs';
361 import { Description } from '../structs/Description.mjs';
362 import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs';
363 import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs';
364 import { BigSize } from '../structs/BigSize.mjs';
365 import { ChannelUsage } from '../structs/ChannelUsage.mjs';
366 import { Score, ScoreInterface } from '../structs/Score.mjs';
367 import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs';
368 import { WriteableScore, WriteableScoreInterface } from '../structs/WriteableScore.mjs';
369 import { Persister, PersisterInterface } from '../structs/Persister.mjs';
370 import { PrintableString } from '../structs/PrintableString.mjs';
371 import { FutureCallback, FutureCallbackInterface } from '../structs/FutureCallback.mjs';
372 import { Future } from '../structs/Future.mjs';
373 import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs';
374 import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs';
375 import { UserConfig } from '../structs/UserConfig.mjs';
376 import { BestBlock } from '../structs/BestBlock.mjs';
377 import { Listen, ListenInterface } from '../structs/Listen.mjs';
378 import { Confirm, ConfirmInterface } from '../structs/Confirm.mjs';
379 import { Persist, PersistInterface } from '../structs/Persist.mjs';
380 import { ChainMonitor } from '../structs/ChainMonitor.mjs';
381 import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs';
382 import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs';
383 import { KeysManager } from '../structs/KeysManager.mjs';
384 import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs';
385 import { ChainParameters } from '../structs/ChainParameters.mjs';
386 import { Retry } from '../structs/Retry.mjs';
387 import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs';
388 import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs';
389 import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs';
390 import { ExpandedKey } from '../structs/ExpandedKey.mjs';
391 import { DataLossProtect } from '../structs/DataLossProtect.mjs';
392 import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs';
393 import { OnionMessageProvider, OnionMessageProviderInterface } from '../structs/OnionMessageProvider.mjs';
394 import { OnionMessageHandler, OnionMessageHandlerInterface } from '../structs/OnionMessageHandler.mjs';
395 import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs';
396 import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs';
397 import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs';
398 import { CustomOnionMessageHandler, CustomOnionMessageHandlerInterface } from '../structs/CustomOnionMessageHandler.mjs';
399 import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs';
400 import { MessageHandler } from '../structs/MessageHandler.mjs';
401 import { SocketDescriptor, SocketDescriptorInterface } from '../structs/SocketDescriptor.mjs';
402 import { PeerManager } from '../structs/PeerManager.mjs';
403 import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs';
404 import { OfferFeatures } from '../structs/OfferFeatures.mjs';
405 import { InvoiceRequestFeatures } from '../structs/InvoiceRequestFeatures.mjs';
406 import { Bolt12InvoiceFeatures } from '../structs/Bolt12InvoiceFeatures.mjs';
407 import { UnsignedInvoice } from '../structs/UnsignedInvoice.mjs';
408 import { UnsignedInvoiceRequest } from '../structs/UnsignedInvoiceRequest.mjs';
409 import { InvoiceRequest } from '../structs/InvoiceRequest.mjs';
410 import { Offer } from '../structs/Offer.mjs';
411 import { Amount } from '../structs/Amount.mjs';
412 import { Quantity } from '../structs/Quantity.mjs';
413 import { Refund } from '../structs/Refund.mjs';
414 import { P2PGossipSync } from '../structs/P2PGossipSync.mjs';
415 import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs';
416 import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs';
417 import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs';
418 import { DefaultRouter } from '../structs/DefaultRouter.mjs';
419 import { ScorerAccountingForInFlightHtlcs } from '../structs/ScorerAccountingForInFlightHtlcs.mjs';
420 import { Hints } from '../structs/Hints.mjs';
421 import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs';
422 import { MultiThreadedScoreLock } from '../structs/MultiThreadedScoreLock.mjs';
423 import { ProbabilisticScoringParameters } from '../structs/ProbabilisticScoringParameters.mjs';
424 import { OnionMessenger } from '../structs/OnionMessenger.mjs';
425 import { Destination } from '../structs/Destination.mjs';
426 import { OnionMessageContents } from '../structs/OnionMessageContents.mjs';
427 import { RapidGossipSync } from '../structs/RapidGossipSync.mjs';
428 import { GossipSync } from '../structs/GossipSync.mjs';
429 import { RawDataPart } from '../structs/RawDataPart.mjs';
430 import { Sha256 } from '../structs/Sha256.mjs';
431 import { ExpiryTime } from '../structs/ExpiryTime.mjs';
432 import { MinFinalCltvExpiryDelta } from '../structs/MinFinalCltvExpiryDelta.mjs';
433 import { Fallback } from '../structs/Fallback.mjs';
434
435 import { CommonBase, UInt5, WitnessVersion, UnqualifiedError } from './CommonBase.mjs';
436 import * as bindings from '../bindings.mjs'
437
438 /**
439  * An Event which you should probably take some action in response to.
440  * 
441  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
442  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
443  * written as it makes no sense to respond to it after reconnecting to peers).
444  */
445 export class Event extends CommonBase {
446         protected constructor(_dummy: null, ptr: bigint) { super(ptr, bindings.Event_free); }
447         /* @internal */
448         public static constr_from_ptr(ptr: bigint): Event {
449                 const raw_ty: number = bindings.LDKEvent_ty_from_ptr(ptr);
450                 switch (raw_ty) {
451                         case 0: return new Event_FundingGenerationReady(ptr);
452                         case 1: return new Event_PaymentClaimable(ptr);
453                         case 2: return new Event_PaymentClaimed(ptr);
454                         case 3: return new Event_PaymentSent(ptr);
455                         case 4: return new Event_PaymentFailed(ptr);
456                         case 5: return new Event_PaymentPathSuccessful(ptr);
457                         case 6: return new Event_PaymentPathFailed(ptr);
458                         case 7: return new Event_ProbeSuccessful(ptr);
459                         case 8: return new Event_ProbeFailed(ptr);
460                         case 9: return new Event_PendingHTLCsForwardable(ptr);
461                         case 10: return new Event_HTLCIntercepted(ptr);
462                         case 11: return new Event_SpendableOutputs(ptr);
463                         case 12: return new Event_PaymentForwarded(ptr);
464                         case 13: return new Event_ChannelPending(ptr);
465                         case 14: return new Event_ChannelReady(ptr);
466                         case 15: return new Event_ChannelClosed(ptr);
467                         case 16: return new Event_DiscardFunding(ptr);
468                         case 17: return new Event_OpenChannelRequest(ptr);
469                         case 18: return new Event_HTLCHandlingFailed(ptr);
470                         default:
471                                 throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
472                 }
473         }
474
475         public clone_ptr(): bigint {
476                 const ret: bigint = bindings.Event_clone_ptr(this.ptr);
477                 return ret;
478         }
479
480         /**
481          * Creates a copy of the Event
482          */
483         public clone(): Event {
484                 const ret: bigint = bindings.Event_clone(this.ptr);
485                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
486                 CommonBase.add_ref_from(ret_hu_conv, this);
487                 return ret_hu_conv;
488         }
489
490         /**
491          * Utility method to constructs a new FundingGenerationReady-variant Event
492          */
493         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 {
494                 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), bindings.encodeUint128(user_channel_id));
495                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
496                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
497                 return ret_hu_conv;
498         }
499
500         /**
501          * Utility method to constructs a new PaymentClaimable-variant Event
502          */
503         public static constructor_payment_claimable(receiver_node_id: Uint8Array, payment_hash: Uint8Array, onion_fields: RecipientOnionFields, amount_msat: bigint, purpose: PaymentPurpose, via_channel_id: Uint8Array, via_user_channel_id: Option_u128Z, claim_deadline: Option_u32Z): Event {
504                 const ret: bigint = bindings.Event_payment_claimable(bindings.encodeUint8Array(bindings.check_arr_len(receiver_node_id, 33)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), onion_fields == null ? 0n : CommonBase.get_ptr_of(onion_fields), amount_msat, CommonBase.get_ptr_of(purpose), bindings.encodeUint8Array(bindings.check_arr_len(via_channel_id, 32)), CommonBase.get_ptr_of(via_user_channel_id), CommonBase.get_ptr_of(claim_deadline));
505                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
506                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
507                 CommonBase.add_ref_from(ret_hu_conv, onion_fields);
508                 CommonBase.add_ref_from(ret_hu_conv, purpose);
509                 CommonBase.add_ref_from(ret_hu_conv, via_user_channel_id);
510                 CommonBase.add_ref_from(ret_hu_conv, claim_deadline);
511                 return ret_hu_conv;
512         }
513
514         /**
515          * Utility method to constructs a new PaymentClaimed-variant Event
516          */
517         public static constructor_payment_claimed(receiver_node_id: Uint8Array, payment_hash: Uint8Array, amount_msat: bigint, purpose: PaymentPurpose): Event {
518                 const ret: bigint = bindings.Event_payment_claimed(bindings.encodeUint8Array(bindings.check_arr_len(receiver_node_id, 33)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), amount_msat, CommonBase.get_ptr_of(purpose));
519                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
520                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
521                 CommonBase.add_ref_from(ret_hu_conv, purpose);
522                 return ret_hu_conv;
523         }
524
525         /**
526          * Utility method to constructs a new PaymentSent-variant Event
527          */
528         public static constructor_payment_sent(payment_id: Uint8Array, payment_preimage: Uint8Array, payment_hash: Uint8Array, fee_paid_msat: Option_u64Z): Event {
529                 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));
530                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
531                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
532                 CommonBase.add_ref_from(ret_hu_conv, fee_paid_msat);
533                 return ret_hu_conv;
534         }
535
536         /**
537          * Utility method to constructs a new PaymentFailed-variant Event
538          */
539         public static constructor_payment_failed(payment_id: Uint8Array, payment_hash: Uint8Array, reason: Option_PaymentFailureReasonZ): Event {
540                 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)), CommonBase.get_ptr_of(reason));
541                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
542                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
543                 CommonBase.add_ref_from(ret_hu_conv, reason);
544                 return ret_hu_conv;
545         }
546
547         /**
548          * Utility method to constructs a new PaymentPathSuccessful-variant Event
549          */
550         public static constructor_payment_path_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: Path): Event {
551                 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)), path == null ? 0n : CommonBase.get_ptr_of(path));
552                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
553                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
554                 CommonBase.add_ref_from(ret_hu_conv, path);
555                 return ret_hu_conv;
556         }
557
558         /**
559          * Utility method to constructs a new PaymentPathFailed-variant Event
560          */
561         public static constructor_payment_path_failed(payment_id: Uint8Array, payment_hash: Uint8Array, payment_failed_permanently: boolean, failure: PathFailure, path: Path, short_channel_id: Option_u64Z): Event {
562                 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(failure), path == null ? 0n : CommonBase.get_ptr_of(path), CommonBase.get_ptr_of(short_channel_id));
563                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
564                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
565                 CommonBase.add_ref_from(ret_hu_conv, failure);
566                 CommonBase.add_ref_from(ret_hu_conv, path);
567                 CommonBase.add_ref_from(ret_hu_conv, short_channel_id);
568                 return ret_hu_conv;
569         }
570
571         /**
572          * Utility method to constructs a new ProbeSuccessful-variant Event
573          */
574         public static constructor_probe_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: Path): Event {
575                 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)), path == null ? 0n : CommonBase.get_ptr_of(path));
576                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
577                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
578                 CommonBase.add_ref_from(ret_hu_conv, path);
579                 return ret_hu_conv;
580         }
581
582         /**
583          * Utility method to constructs a new ProbeFailed-variant Event
584          */
585         public static constructor_probe_failed(payment_id: Uint8Array, payment_hash: Uint8Array, path: Path, short_channel_id: Option_u64Z): Event {
586                 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)), path == null ? 0n : CommonBase.get_ptr_of(path), CommonBase.get_ptr_of(short_channel_id));
587                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
588                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
589                 CommonBase.add_ref_from(ret_hu_conv, path);
590                 CommonBase.add_ref_from(ret_hu_conv, short_channel_id);
591                 return ret_hu_conv;
592         }
593
594         /**
595          * Utility method to constructs a new PendingHTLCsForwardable-variant Event
596          */
597         public static constructor_pending_htlcs_forwardable(time_forwardable: bigint): Event {
598                 const ret: bigint = bindings.Event_pending_htlcs_forwardable(time_forwardable);
599                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
600                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
601                 return ret_hu_conv;
602         }
603
604         /**
605          * Utility method to constructs a new HTLCIntercepted-variant Event
606          */
607         public static constructor_htlcintercepted(intercept_id: Uint8Array, requested_next_hop_scid: bigint, payment_hash: Uint8Array, inbound_amount_msat: bigint, expected_outbound_amount_msat: bigint): Event {
608                 const ret: bigint = bindings.Event_htlcintercepted(bindings.encodeUint8Array(bindings.check_arr_len(intercept_id, 32)), requested_next_hop_scid, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), inbound_amount_msat, expected_outbound_amount_msat);
609                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
610                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
611                 return ret_hu_conv;
612         }
613
614         /**
615          * Utility method to constructs a new SpendableOutputs-variant Event
616          */
617         public static constructor_spendable_outputs(outputs: SpendableOutputDescriptor[]): Event {
618                 const ret: bigint = bindings.Event_spendable_outputs(bindings.encodeUint64Array(outputs != null ? outputs.map(outputs_conv_27 => CommonBase.get_ptr_of(outputs_conv_27)) : null));
619                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
620                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
621                 outputs.forEach((outputs_conv_27: SpendableOutputDescriptor) => { CommonBase.add_ref_from(ret_hu_conv, outputs_conv_27); });
622                 return ret_hu_conv;
623         }
624
625         /**
626          * Utility method to constructs a new PaymentForwarded-variant Event
627          */
628         public static constructor_payment_forwarded(prev_channel_id: Uint8Array, next_channel_id: Uint8Array, fee_earned_msat: Option_u64Z, claim_from_onchain_tx: boolean, outbound_amount_forwarded_msat: Option_u64Z): Event {
629                 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, CommonBase.get_ptr_of(outbound_amount_forwarded_msat));
630                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
631                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
632                 CommonBase.add_ref_from(ret_hu_conv, fee_earned_msat);
633                 CommonBase.add_ref_from(ret_hu_conv, outbound_amount_forwarded_msat);
634                 return ret_hu_conv;
635         }
636
637         /**
638          * Utility method to constructs a new ChannelPending-variant Event
639          */
640         public static constructor_channel_pending(channel_id: Uint8Array, user_channel_id: bigint, former_temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_txo: OutPoint): Event {
641                 const ret: bigint = bindings.Event_channel_pending(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint128(user_channel_id), bindings.encodeUint8Array(bindings.check_arr_len(former_temporary_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), funding_txo == null ? 0n : CommonBase.get_ptr_of(funding_txo));
642                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
643                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
644                 CommonBase.add_ref_from(ret_hu_conv, funding_txo);
645                 return ret_hu_conv;
646         }
647
648         /**
649          * Utility method to constructs a new ChannelReady-variant Event
650          */
651         public static constructor_channel_ready(channel_id: Uint8Array, user_channel_id: bigint, counterparty_node_id: Uint8Array, channel_type: ChannelTypeFeatures): Event {
652                 const ret: bigint = bindings.Event_channel_ready(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint128(user_channel_id), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), channel_type == null ? 0n : CommonBase.get_ptr_of(channel_type));
653                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
654                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
655                 CommonBase.add_ref_from(ret_hu_conv, channel_type);
656                 return ret_hu_conv;
657         }
658
659         /**
660          * Utility method to constructs a new ChannelClosed-variant Event
661          */
662         public static constructor_channel_closed(channel_id: Uint8Array, user_channel_id: bigint, reason: ClosureReason): Event {
663                 const ret: bigint = bindings.Event_channel_closed(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint128(user_channel_id), CommonBase.get_ptr_of(reason));
664                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
665                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
666                 CommonBase.add_ref_from(ret_hu_conv, reason);
667                 return ret_hu_conv;
668         }
669
670         /**
671          * Utility method to constructs a new DiscardFunding-variant Event
672          */
673         public static constructor_discard_funding(channel_id: Uint8Array, transaction: Uint8Array): Event {
674                 const ret: bigint = bindings.Event_discard_funding(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(transaction));
675                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
676                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
677                 return ret_hu_conv;
678         }
679
680         /**
681          * Utility method to constructs a new OpenChannelRequest-variant Event
682          */
683         public static constructor_open_channel_request(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_satoshis: bigint, push_msat: bigint, channel_type: ChannelTypeFeatures): Event {
684                 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));
685                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
686                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
687                 CommonBase.add_ref_from(ret_hu_conv, channel_type);
688                 return ret_hu_conv;
689         }
690
691         /**
692          * Utility method to constructs a new HTLCHandlingFailed-variant Event
693          */
694         public static constructor_htlchandling_failed(prev_channel_id: Uint8Array, failed_next_destination: HTLCDestination): Event {
695                 const ret: bigint = bindings.Event_htlchandling_failed(bindings.encodeUint8Array(bindings.check_arr_len(prev_channel_id, 32)), CommonBase.get_ptr_of(failed_next_destination));
696                 const ret_hu_conv: Event = Event.constr_from_ptr(ret);
697                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
698                 CommonBase.add_ref_from(ret_hu_conv, failed_next_destination);
699                 return ret_hu_conv;
700         }
701
702         /**
703          * Checks if two Events contain equal inner contents.
704          * This ignores pointers and is_owned flags and looks at the values in fields.
705          */
706         public eq(b: Event): boolean {
707                 const ret: boolean = bindings.Event_eq(this.ptr, b == null ? 0n : CommonBase.get_ptr_of(b));
708                 return ret;
709         }
710
711         /**
712          * Serialize the Event object into a byte array which can be read by Event_read
713          */
714         public write(): Uint8Array {
715                 const ret: number = bindings.Event_write(this.ptr);
716                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
717                 return ret_conv;
718         }
719
720 }
721 /** A Event of type FundingGenerationReady */
722 export class Event_FundingGenerationReady extends Event {
723         /**
724          * The random channel_id we picked which you'll need to pass into
725          * [`ChannelManager::funding_transaction_generated`].
726          * 
727          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
728          */
729         public temporary_channel_id: Uint8Array;
730         /**
731          * The counterparty's node_id, which you'll need to pass back into
732          * [`ChannelManager::funding_transaction_generated`].
733          * 
734          * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
735          */
736         public counterparty_node_id: Uint8Array;
737         /**
738          * The value, in satoshis, that the output should have.
739          */
740         public channel_value_satoshis: bigint;
741         /**
742          * The script which should be used in the transaction output.
743          */
744         public output_script: Uint8Array;
745         /**
746          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a
747          * random value for an inbound channel. This may be zero for objects serialized with LDK
748          * versions prior to 0.0.113.
749          * 
750          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
751          */
752         public user_channel_id: bigint;
753         /* @internal */
754         public constructor(ptr: bigint) {
755                 super(null, ptr);
756                 const temporary_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr);
757                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
758                 this.temporary_channel_id = temporary_channel_id_conv;
759                 const counterparty_node_id: number = bindings.LDKEvent_FundingGenerationReady_get_counterparty_node_id(ptr);
760                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
761                 this.counterparty_node_id = counterparty_node_id_conv;
762                 this.channel_value_satoshis = bindings.LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr);
763                 const output_script: number = bindings.LDKEvent_FundingGenerationReady_get_output_script(ptr);
764                 const output_script_conv: Uint8Array = bindings.decodeUint8Array(output_script);
765                 this.output_script = output_script_conv;
766                 const user_channel_id: number = bindings.LDKEvent_FundingGenerationReady_get_user_channel_id(ptr);
767                 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
768                 this.user_channel_id = user_channel_id_conv;
769         }
770 }
771 /** A Event of type PaymentClaimable */
772 export class Event_PaymentClaimable extends Event {
773         /**
774          * The node that will receive the payment after it has been claimed.
775          * This is useful to identify payments received via [phantom nodes].
776          * This field will always be filled in when the event was generated by LDK versions
777          * 0.0.113 and above.
778          * 
779          * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
780          * 
781          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
782          */
783         public receiver_node_id: Uint8Array;
784         /**
785          * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
786          * not stop you from registering duplicate payment hashes for inbound payments.
787          */
788         public payment_hash: Uint8Array;
789         /**
790          * The fields in the onion which were received with each HTLC. Only fields which were
791          * identical in each HTLC involved in the payment will be included here.
792          * 
793          * Payments received on LDK versions prior to 0.0.115 will have this field unset.
794          * 
795          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
796          */
797         public onion_fields: RecipientOnionFields;
798         /**
799          * The value, in thousandths of a satoshi, that this payment is for.
800          */
801         public amount_msat: bigint;
802         /**
803          * Information for claiming this received payment, based on whether the purpose of the
804          * payment is to pay an invoice or to send a spontaneous payment.
805          */
806         public purpose: PaymentPurpose;
807         /**
808          * The `channel_id` indicating over which channel we received the payment.
809          * 
810          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
811          */
812         public via_channel_id: Uint8Array;
813         /**
814          * The `user_channel_id` indicating over which channel we received the payment.
815          */
816         public via_user_channel_id: Option_u128Z;
817         /**
818          * The block height at which this payment will be failed back and will no longer be
819          * eligible for claiming.
820          * 
821          * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
822          * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
823          * 
824          * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
825          */
826         public claim_deadline: Option_u32Z;
827         /* @internal */
828         public constructor(ptr: bigint) {
829                 super(null, ptr);
830                 const receiver_node_id: number = bindings.LDKEvent_PaymentClaimable_get_receiver_node_id(ptr);
831                 const receiver_node_id_conv: Uint8Array = bindings.decodeUint8Array(receiver_node_id);
832                 this.receiver_node_id = receiver_node_id_conv;
833                 const payment_hash: number = bindings.LDKEvent_PaymentClaimable_get_payment_hash(ptr);
834                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
835                 this.payment_hash = payment_hash_conv;
836                 const onion_fields: bigint = bindings.LDKEvent_PaymentClaimable_get_onion_fields(ptr);
837                 const onion_fields_hu_conv: RecipientOnionFields = new RecipientOnionFields(null, onion_fields);
838                         CommonBase.add_ref_from(onion_fields_hu_conv, this);
839                 this.onion_fields = onion_fields_hu_conv;
840                 this.amount_msat = bindings.LDKEvent_PaymentClaimable_get_amount_msat(ptr);
841                 const purpose: bigint = bindings.LDKEvent_PaymentClaimable_get_purpose(ptr);
842                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
843                         CommonBase.add_ref_from(purpose_hu_conv, this);
844                 this.purpose = purpose_hu_conv;
845                 const via_channel_id: number = bindings.LDKEvent_PaymentClaimable_get_via_channel_id(ptr);
846                 const via_channel_id_conv: Uint8Array = bindings.decodeUint8Array(via_channel_id);
847                 this.via_channel_id = via_channel_id_conv;
848                 const via_user_channel_id: bigint = bindings.LDKEvent_PaymentClaimable_get_via_user_channel_id(ptr);
849                 const via_user_channel_id_hu_conv: Option_u128Z = Option_u128Z.constr_from_ptr(via_user_channel_id);
850                         CommonBase.add_ref_from(via_user_channel_id_hu_conv, this);
851                 this.via_user_channel_id = via_user_channel_id_hu_conv;
852                 const claim_deadline: bigint = bindings.LDKEvent_PaymentClaimable_get_claim_deadline(ptr);
853                 const claim_deadline_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(claim_deadline);
854                         CommonBase.add_ref_from(claim_deadline_hu_conv, this);
855                 this.claim_deadline = claim_deadline_hu_conv;
856         }
857 }
858 /** A Event of type PaymentClaimed */
859 export class Event_PaymentClaimed extends Event {
860         /**
861          * The node that received the payment.
862          * This is useful to identify payments which were received via [phantom nodes].
863          * This field will always be filled in when the event was generated by LDK versions
864          * 0.0.113 and above.
865          * 
866          * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
867          * 
868          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
869          */
870         public receiver_node_id: Uint8Array;
871         /**
872          * The payment hash of the claimed payment. Note that LDK will not stop you from
873          * registering duplicate payment hashes for inbound payments.
874          */
875         public payment_hash: Uint8Array;
876         /**
877          * The value, in thousandths of a satoshi, that this payment is for.
878          */
879         public amount_msat: bigint;
880         /**
881          * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
882          * spontaneous payment.
883          */
884         public purpose: PaymentPurpose;
885         /* @internal */
886         public constructor(ptr: bigint) {
887                 super(null, ptr);
888                 const receiver_node_id: number = bindings.LDKEvent_PaymentClaimed_get_receiver_node_id(ptr);
889                 const receiver_node_id_conv: Uint8Array = bindings.decodeUint8Array(receiver_node_id);
890                 this.receiver_node_id = receiver_node_id_conv;
891                 const payment_hash: number = bindings.LDKEvent_PaymentClaimed_get_payment_hash(ptr);
892                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
893                 this.payment_hash = payment_hash_conv;
894                 this.amount_msat = bindings.LDKEvent_PaymentClaimed_get_amount_msat(ptr);
895                 const purpose: bigint = bindings.LDKEvent_PaymentClaimed_get_purpose(ptr);
896                 const purpose_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(purpose);
897                         CommonBase.add_ref_from(purpose_hu_conv, this);
898                 this.purpose = purpose_hu_conv;
899         }
900 }
901 /** A Event of type PaymentSent */
902 export class Event_PaymentSent extends Event {
903         /**
904          * The `payment_id` passed to [`ChannelManager::send_payment`].
905          * 
906          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
907          * 
908          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
909          */
910         public payment_id: Uint8Array;
911         /**
912          * The preimage to the hash given to ChannelManager::send_payment.
913          * Note that this serves as a payment receipt, if you wish to have such a thing, you must
914          * store it somehow!
915          */
916         public payment_preimage: Uint8Array;
917         /**
918          * The hash that was given to [`ChannelManager::send_payment`].
919          * 
920          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
921          */
922         public payment_hash: Uint8Array;
923         /**
924          * The total fee which was spent at intermediate hops in this payment, across all paths.
925          * 
926          * Note that, like [`Route::get_total_fees`] this does *not* include any potential
927          * overpayment to the recipient node.
928          * 
929          * If the recipient or an intermediate node misbehaves and gives us free money, this may
930          * overstate the amount paid, though this is unlikely.
931          * 
932          * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
933          */
934         public fee_paid_msat: Option_u64Z;
935         /* @internal */
936         public constructor(ptr: bigint) {
937                 super(null, ptr);
938                 const payment_id: number = bindings.LDKEvent_PaymentSent_get_payment_id(ptr);
939                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
940                 this.payment_id = payment_id_conv;
941                 const payment_preimage: number = bindings.LDKEvent_PaymentSent_get_payment_preimage(ptr);
942                 const payment_preimage_conv: Uint8Array = bindings.decodeUint8Array(payment_preimage);
943                 this.payment_preimage = payment_preimage_conv;
944                 const payment_hash: number = bindings.LDKEvent_PaymentSent_get_payment_hash(ptr);
945                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
946                 this.payment_hash = payment_hash_conv;
947                 const fee_paid_msat: bigint = bindings.LDKEvent_PaymentSent_get_fee_paid_msat(ptr);
948                 const fee_paid_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_paid_msat);
949                         CommonBase.add_ref_from(fee_paid_msat_hu_conv, this);
950                 this.fee_paid_msat = fee_paid_msat_hu_conv;
951         }
952 }
953 /** A Event of type PaymentFailed */
954 export class Event_PaymentFailed extends Event {
955         /**
956          * The `payment_id` passed to [`ChannelManager::send_payment`].
957          * 
958          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
959          */
960         public payment_id: Uint8Array;
961         /**
962          * The hash that was given to [`ChannelManager::send_payment`].
963          * 
964          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
965          */
966         public payment_hash: Uint8Array;
967         /**
968          * The reason the payment failed. This is only `None` for events generated or serialized
969          * by versions prior to 0.0.115.
970          */
971         public reason: Option_PaymentFailureReasonZ;
972         /* @internal */
973         public constructor(ptr: bigint) {
974                 super(null, ptr);
975                 const payment_id: number = bindings.LDKEvent_PaymentFailed_get_payment_id(ptr);
976                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
977                 this.payment_id = payment_id_conv;
978                 const payment_hash: number = bindings.LDKEvent_PaymentFailed_get_payment_hash(ptr);
979                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
980                 this.payment_hash = payment_hash_conv;
981                 const reason: bigint = bindings.LDKEvent_PaymentFailed_get_reason(ptr);
982                 const reason_hu_conv: Option_PaymentFailureReasonZ = Option_PaymentFailureReasonZ.constr_from_ptr(reason);
983                         CommonBase.add_ref_from(reason_hu_conv, this);
984                 this.reason = reason_hu_conv;
985         }
986 }
987 /** A Event of type PaymentPathSuccessful */
988 export class Event_PaymentPathSuccessful extends Event {
989         /**
990          * The `payment_id` passed to [`ChannelManager::send_payment`].
991          * 
992          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
993          */
994         public payment_id: Uint8Array;
995         /**
996          * The hash that was given to [`ChannelManager::send_payment`].
997          * 
998          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
999          * 
1000          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1001          */
1002         public payment_hash: Uint8Array;
1003         /**
1004          * The payment path that was successful.
1005          * 
1006          * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
1007          */
1008         public path: Path;
1009         /* @internal */
1010         public constructor(ptr: bigint) {
1011                 super(null, ptr);
1012                 const payment_id: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_id(ptr);
1013                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1014                 this.payment_id = payment_id_conv;
1015                 const payment_hash: number = bindings.LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr);
1016                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1017                 this.payment_hash = payment_hash_conv;
1018                 const path: bigint = bindings.LDKEvent_PaymentPathSuccessful_get_path(ptr);
1019                 const path_hu_conv: Path = new Path(null, path);
1020                         CommonBase.add_ref_from(path_hu_conv, this);
1021                 this.path = path_hu_conv;
1022         }
1023 }
1024 /** A Event of type PaymentPathFailed */
1025 export class Event_PaymentPathFailed extends Event {
1026         /**
1027          * The `payment_id` passed to [`ChannelManager::send_payment`].
1028          * 
1029          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1030          * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
1031          * 
1032          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1033          */
1034         public payment_id: Uint8Array;
1035         /**
1036          * The hash that was given to [`ChannelManager::send_payment`].
1037          * 
1038          * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
1039          */
1040         public payment_hash: Uint8Array;
1041         /**
1042          * Indicates the payment was rejected for some reason by the recipient. This implies that
1043          * the payment has failed, not just the route in question. If this is not set, the payment may
1044          * be retried via a different route.
1045          */
1046         public payment_failed_permanently: boolean;
1047         /**
1048          * Extra error details based on the failure type. May contain an update that needs to be
1049          * applied to the [`NetworkGraph`].
1050          * 
1051          * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
1052          */
1053         public failure: PathFailure;
1054         /**
1055          * The payment path that failed.
1056          */
1057         public path: Path;
1058         /**
1059          * The channel responsible for the failed payment path.
1060          * 
1061          * Note that for route hints or for the first hop in a path this may be an SCID alias and
1062          * may not refer to a channel in the public network graph. These aliases may also collide
1063          * with channels in the public network graph.
1064          * 
1065          * If this is `Some`, then the corresponding channel should be avoided when the payment is
1066          * retried. May be `None` for older [`Event`] serializations.
1067          */
1068         public short_channel_id: Option_u64Z;
1069         /* @internal */
1070         public constructor(ptr: bigint) {
1071                 super(null, ptr);
1072                 const payment_id: number = bindings.LDKEvent_PaymentPathFailed_get_payment_id(ptr);
1073                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1074                 this.payment_id = payment_id_conv;
1075                 const payment_hash: number = bindings.LDKEvent_PaymentPathFailed_get_payment_hash(ptr);
1076                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1077                 this.payment_hash = payment_hash_conv;
1078                 this.payment_failed_permanently = bindings.LDKEvent_PaymentPathFailed_get_payment_failed_permanently(ptr);
1079                 const failure: bigint = bindings.LDKEvent_PaymentPathFailed_get_failure(ptr);
1080                 const failure_hu_conv: PathFailure = PathFailure.constr_from_ptr(failure);
1081                         CommonBase.add_ref_from(failure_hu_conv, this);
1082                 this.failure = failure_hu_conv;
1083                 const path: bigint = bindings.LDKEvent_PaymentPathFailed_get_path(ptr);
1084                 const path_hu_conv: Path = new Path(null, path);
1085                         CommonBase.add_ref_from(path_hu_conv, this);
1086                 this.path = path_hu_conv;
1087                 const short_channel_id: bigint = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr);
1088                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1089                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1090                 this.short_channel_id = short_channel_id_hu_conv;
1091         }
1092 }
1093 /** A Event of type ProbeSuccessful */
1094 export class Event_ProbeSuccessful extends Event {
1095         /**
1096          * The id returned by [`ChannelManager::send_probe`].
1097          * 
1098          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1099          */
1100         public payment_id: Uint8Array;
1101         /**
1102          * The hash generated by [`ChannelManager::send_probe`].
1103          * 
1104          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1105          */
1106         public payment_hash: Uint8Array;
1107         /**
1108          * The payment path that was successful.
1109          */
1110         public path: Path;
1111         /* @internal */
1112         public constructor(ptr: bigint) {
1113                 super(null, ptr);
1114                 const payment_id: number = bindings.LDKEvent_ProbeSuccessful_get_payment_id(ptr);
1115                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1116                 this.payment_id = payment_id_conv;
1117                 const payment_hash: number = bindings.LDKEvent_ProbeSuccessful_get_payment_hash(ptr);
1118                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1119                 this.payment_hash = payment_hash_conv;
1120                 const path: bigint = bindings.LDKEvent_ProbeSuccessful_get_path(ptr);
1121                 const path_hu_conv: Path = new Path(null, path);
1122                         CommonBase.add_ref_from(path_hu_conv, this);
1123                 this.path = path_hu_conv;
1124         }
1125 }
1126 /** A Event of type ProbeFailed */
1127 export class Event_ProbeFailed extends Event {
1128         /**
1129          * The id returned by [`ChannelManager::send_probe`].
1130          * 
1131          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1132          */
1133         public payment_id: Uint8Array;
1134         /**
1135          * The hash generated by [`ChannelManager::send_probe`].
1136          * 
1137          * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
1138          */
1139         public payment_hash: Uint8Array;
1140         /**
1141          * The payment path that failed.
1142          */
1143         public path: Path;
1144         /**
1145          * The channel responsible for the failed probe.
1146          * 
1147          * Note that for route hints or for the first hop in a path this may be an SCID alias and
1148          * may not refer to a channel in the public network graph. These aliases may also collide
1149          * with channels in the public network graph.
1150          */
1151         public short_channel_id: Option_u64Z;
1152         /* @internal */
1153         public constructor(ptr: bigint) {
1154                 super(null, ptr);
1155                 const payment_id: number = bindings.LDKEvent_ProbeFailed_get_payment_id(ptr);
1156                 const payment_id_conv: Uint8Array = bindings.decodeUint8Array(payment_id);
1157                 this.payment_id = payment_id_conv;
1158                 const payment_hash: number = bindings.LDKEvent_ProbeFailed_get_payment_hash(ptr);
1159                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1160                 this.payment_hash = payment_hash_conv;
1161                 const path: bigint = bindings.LDKEvent_ProbeFailed_get_path(ptr);
1162                 const path_hu_conv: Path = new Path(null, path);
1163                         CommonBase.add_ref_from(path_hu_conv, this);
1164                 this.path = path_hu_conv;
1165                 const short_channel_id: bigint = bindings.LDKEvent_ProbeFailed_get_short_channel_id(ptr);
1166                 const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id);
1167                         CommonBase.add_ref_from(short_channel_id_hu_conv, this);
1168                 this.short_channel_id = short_channel_id_hu_conv;
1169         }
1170 }
1171 /** A Event of type PendingHTLCsForwardable */
1172 export class Event_PendingHTLCsForwardable extends Event {
1173         /**
1174          * The minimum amount of time that should be waited prior to calling
1175          * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1176          * you should wait a random amount of time in roughly the range (now + time_forwardable,
1177          * now + 5*time_forwardable).
1178          */
1179         public time_forwardable: bigint;
1180         /* @internal */
1181         public constructor(ptr: bigint) {
1182                 super(null, ptr);
1183                 this.time_forwardable = bindings.LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr);
1184         }
1185 }
1186 /** A Event of type HTLCIntercepted */
1187 export class Event_HTLCIntercepted extends Event {
1188         /**
1189          * An id to help LDK identify which HTLC is being forwarded or failed.
1190          */
1191         public intercept_id: Uint8Array;
1192         /**
1193          * The fake scid that was programmed as the next hop's scid, generated using
1194          * [`ChannelManager::get_intercept_scid`].
1195          * 
1196          * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
1197          */
1198         public requested_next_hop_scid: bigint;
1199         /**
1200          * The payment hash used for this HTLC.
1201          */
1202         public payment_hash: Uint8Array;
1203         /**
1204          * How many msats were received on the inbound edge of this HTLC.
1205          */
1206         public inbound_amount_msat: bigint;
1207         /**
1208          * How many msats the payer intended to route to the next node. Depending on the reason you are
1209          * intercepting this payment, you might take a fee by forwarding less than this amount.
1210          * 
1211          * Note that LDK will NOT check that expected fees were factored into this value. You MUST
1212          * check that whatever fee you want has been included here or subtract it as required. Further,
1213          * LDK will not stop you from forwarding more than you received.
1214          */
1215         public expected_outbound_amount_msat: bigint;
1216         /* @internal */
1217         public constructor(ptr: bigint) {
1218                 super(null, ptr);
1219                 const intercept_id: number = bindings.LDKEvent_HTLCIntercepted_get_intercept_id(ptr);
1220                 const intercept_id_conv: Uint8Array = bindings.decodeUint8Array(intercept_id);
1221                 this.intercept_id = intercept_id_conv;
1222                 this.requested_next_hop_scid = bindings.LDKEvent_HTLCIntercepted_get_requested_next_hop_scid(ptr);
1223                 const payment_hash: number = bindings.LDKEvent_HTLCIntercepted_get_payment_hash(ptr);
1224                 const payment_hash_conv: Uint8Array = bindings.decodeUint8Array(payment_hash);
1225                 this.payment_hash = payment_hash_conv;
1226                 this.inbound_amount_msat = bindings.LDKEvent_HTLCIntercepted_get_inbound_amount_msat(ptr);
1227                 this.expected_outbound_amount_msat = bindings.LDKEvent_HTLCIntercepted_get_expected_outbound_amount_msat(ptr);
1228         }
1229 }
1230 /** A Event of type SpendableOutputs */
1231 export class Event_SpendableOutputs extends Event {
1232         /**
1233          * The outputs which you should store as spendable by you.
1234          */
1235         public outputs: SpendableOutputDescriptor[];
1236         /* @internal */
1237         public constructor(ptr: bigint) {
1238                 super(null, ptr);
1239                 const outputs: number = bindings.LDKEvent_SpendableOutputs_get_outputs(ptr);
1240                 const outputs_conv_27_len: number = bindings.getArrayLength(outputs);
1241                         const outputs_conv_27_arr: SpendableOutputDescriptor[] = new Array(outputs_conv_27_len).fill(null);
1242                         for (var b = 0; b < outputs_conv_27_len; b++) {
1243                                 const outputs_conv_27: bigint = bindings.getU64ArrayElem(outputs, b);
1244                                 const outputs_conv_27_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
1245                                 CommonBase.add_ref_from(outputs_conv_27_hu_conv, this);
1246                                 outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
1247                         }
1248                         bindings.freeWasmMemory(outputs)
1249                 this.outputs = outputs_conv_27_arr;
1250         }
1251 }
1252 /** A Event of type PaymentForwarded */
1253 export class Event_PaymentForwarded extends Event {
1254         /**
1255          * The incoming channel between the previous node and us. This is only `None` for events
1256          * generated or serialized by versions prior to 0.0.107.
1257          * 
1258          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1259          */
1260         public prev_channel_id: Uint8Array;
1261         /**
1262          * The outgoing channel between the next node and us. This is only `None` for events
1263          * generated or serialized by versions prior to 0.0.107.
1264          * 
1265          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1266          */
1267         public next_channel_id: Uint8Array;
1268         /**
1269          * The fee, in milli-satoshis, which was earned as a result of the payment.
1270          * 
1271          * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
1272          * was pending, the amount the next hop claimed will have been rounded down to the nearest
1273          * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
1274          * claimed the full value in millisatoshis from the source. In this case,
1275          * `claim_from_onchain_tx` will be set.
1276          * 
1277          * If the channel which sent us the payment has been force-closed, we will claim the funds
1278          * via an on-chain transaction. In that case we do not yet know the on-chain transaction
1279          * fees which we will spend and will instead set this to `None`. It is possible duplicate
1280          * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
1281          * `None`.
1282          */
1283         public fee_earned_msat: Option_u64Z;
1284         /**
1285          * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
1286          * transaction.
1287          */
1288         public claim_from_onchain_tx: boolean;
1289         /**
1290          * The final amount forwarded, in milli-satoshis, after the fee is deducted.
1291          * 
1292          * The caveat described above the `fee_earned_msat` field applies here as well.
1293          */
1294         public outbound_amount_forwarded_msat: Option_u64Z;
1295         /* @internal */
1296         public constructor(ptr: bigint) {
1297                 super(null, ptr);
1298                 const prev_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr);
1299                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1300                 this.prev_channel_id = prev_channel_id_conv;
1301                 const next_channel_id: number = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr);
1302                 const next_channel_id_conv: Uint8Array = bindings.decodeUint8Array(next_channel_id);
1303                 this.next_channel_id = next_channel_id_conv;
1304                 const fee_earned_msat: bigint = bindings.LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr);
1305                 const fee_earned_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(fee_earned_msat);
1306                         CommonBase.add_ref_from(fee_earned_msat_hu_conv, this);
1307                 this.fee_earned_msat = fee_earned_msat_hu_conv;
1308                 this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr);
1309                 const outbound_amount_forwarded_msat: bigint = bindings.LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(ptr);
1310                 const outbound_amount_forwarded_msat_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(outbound_amount_forwarded_msat);
1311                         CommonBase.add_ref_from(outbound_amount_forwarded_msat_hu_conv, this);
1312                 this.outbound_amount_forwarded_msat = outbound_amount_forwarded_msat_hu_conv;
1313         }
1314 }
1315 /** A Event of type ChannelPending */
1316 export class Event_ChannelPending extends Event {
1317         /**
1318          * The `channel_id` of the channel that is pending confirmation.
1319          */
1320         public channel_id: Uint8Array;
1321         /**
1322          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1323          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1324          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1325          * `user_channel_id` will be randomized for an inbound channel.
1326          * 
1327          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1328          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1329          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1330          */
1331         public user_channel_id: bigint;
1332         /**
1333          * The `temporary_channel_id` this channel used to be known by during channel establishment.
1334          * 
1335          * Will be `None` for channels created prior to LDK version 0.0.115.
1336          * 
1337          * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
1338          */
1339         public former_temporary_channel_id: Uint8Array;
1340         /**
1341          * The `node_id` of the channel counterparty.
1342          */
1343         public counterparty_node_id: Uint8Array;
1344         /**
1345          * The outpoint of the channel's funding transaction.
1346          */
1347         public funding_txo: OutPoint;
1348         /* @internal */
1349         public constructor(ptr: bigint) {
1350                 super(null, ptr);
1351                 const channel_id: number = bindings.LDKEvent_ChannelPending_get_channel_id(ptr);
1352                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1353                 this.channel_id = channel_id_conv;
1354                 const user_channel_id: number = bindings.LDKEvent_ChannelPending_get_user_channel_id(ptr);
1355                 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1356                 this.user_channel_id = user_channel_id_conv;
1357                 const former_temporary_channel_id: number = bindings.LDKEvent_ChannelPending_get_former_temporary_channel_id(ptr);
1358                 const former_temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(former_temporary_channel_id);
1359                 this.former_temporary_channel_id = former_temporary_channel_id_conv;
1360                 const counterparty_node_id: number = bindings.LDKEvent_ChannelPending_get_counterparty_node_id(ptr);
1361                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1362                 this.counterparty_node_id = counterparty_node_id_conv;
1363                 const funding_txo: bigint = bindings.LDKEvent_ChannelPending_get_funding_txo(ptr);
1364                 const funding_txo_hu_conv: OutPoint = new OutPoint(null, funding_txo);
1365                         CommonBase.add_ref_from(funding_txo_hu_conv, this);
1366                 this.funding_txo = funding_txo_hu_conv;
1367         }
1368 }
1369 /** A Event of type ChannelReady */
1370 export class Event_ChannelReady extends Event {
1371         /**
1372          * The `channel_id` of the channel that is ready.
1373          */
1374         public channel_id: Uint8Array;
1375         /**
1376          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1377          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1378          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1379          * `user_channel_id` will be randomized for an inbound channel.
1380          * 
1381          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1382          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1383          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1384          */
1385         public user_channel_id: bigint;
1386         /**
1387          * The `node_id` of the channel counterparty.
1388          */
1389         public counterparty_node_id: Uint8Array;
1390         /**
1391          * The features that this channel will operate with.
1392          */
1393         public channel_type: ChannelTypeFeatures;
1394         /* @internal */
1395         public constructor(ptr: bigint) {
1396                 super(null, ptr);
1397                 const channel_id: number = bindings.LDKEvent_ChannelReady_get_channel_id(ptr);
1398                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1399                 this.channel_id = channel_id_conv;
1400                 const user_channel_id: number = bindings.LDKEvent_ChannelReady_get_user_channel_id(ptr);
1401                 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1402                 this.user_channel_id = user_channel_id_conv;
1403                 const counterparty_node_id: number = bindings.LDKEvent_ChannelReady_get_counterparty_node_id(ptr);
1404                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1405                 this.counterparty_node_id = counterparty_node_id_conv;
1406                 const channel_type: bigint = bindings.LDKEvent_ChannelReady_get_channel_type(ptr);
1407                 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1408                         CommonBase.add_ref_from(channel_type_hu_conv, this);
1409                 this.channel_type = channel_type_hu_conv;
1410         }
1411 }
1412 /** A Event of type ChannelClosed */
1413 export class Event_ChannelClosed extends Event {
1414         /**
1415          * The `channel_id` of the channel which has been closed. Note that on-chain transactions
1416          * resolving the channel are likely still awaiting confirmation.
1417          */
1418         public channel_id: Uint8Array;
1419         /**
1420          * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1421          * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1422          * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1423          * `user_channel_id` will be randomized for inbound channels.
1424          * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
1425          * zero for objects serialized with LDK versions prior to 0.0.102.
1426          * 
1427          * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1428          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1429          * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1430          */
1431         public user_channel_id: bigint;
1432         /**
1433          * The reason the channel was closed.
1434          */
1435         public reason: ClosureReason;
1436         /* @internal */
1437         public constructor(ptr: bigint) {
1438                 super(null, ptr);
1439                 const channel_id: number = bindings.LDKEvent_ChannelClosed_get_channel_id(ptr);
1440                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1441                 this.channel_id = channel_id_conv;
1442                 const user_channel_id: number = bindings.LDKEvent_ChannelClosed_get_user_channel_id(ptr);
1443                 const user_channel_id_conv: bigint = bindings.decodeUint128(user_channel_id);
1444                 this.user_channel_id = user_channel_id_conv;
1445                 const reason: bigint = bindings.LDKEvent_ChannelClosed_get_reason(ptr);
1446                 const reason_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(reason);
1447                         CommonBase.add_ref_from(reason_hu_conv, this);
1448                 this.reason = reason_hu_conv;
1449         }
1450 }
1451 /** A Event of type DiscardFunding */
1452 export class Event_DiscardFunding extends Event {
1453         /**
1454          * The channel_id of the channel which has been closed.
1455          */
1456         public channel_id: Uint8Array;
1457         /**
1458          * The full transaction received from the user
1459          */
1460         public transaction: Uint8Array;
1461         /* @internal */
1462         public constructor(ptr: bigint) {
1463                 super(null, ptr);
1464                 const channel_id: number = bindings.LDKEvent_DiscardFunding_get_channel_id(ptr);
1465                 const channel_id_conv: Uint8Array = bindings.decodeUint8Array(channel_id);
1466                 this.channel_id = channel_id_conv;
1467                 const transaction: number = bindings.LDKEvent_DiscardFunding_get_transaction(ptr);
1468                 const transaction_conv: Uint8Array = bindings.decodeUint8Array(transaction);
1469                 this.transaction = transaction_conv;
1470         }
1471 }
1472 /** A Event of type OpenChannelRequest */
1473 export class Event_OpenChannelRequest extends Event {
1474         /**
1475          * The temporary channel ID of the channel requested to be opened.
1476          * 
1477          * When responding to the request, the `temporary_channel_id` should be passed
1478          * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
1479          * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
1480          * 
1481          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1482          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1483          */
1484         public temporary_channel_id: Uint8Array;
1485         /**
1486          * The node_id of the counterparty requesting to open the channel.
1487          * 
1488          * When responding to the request, the `counterparty_node_id` should be passed
1489          * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
1490          * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
1491          * request.
1492          * 
1493          * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1494          * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1495          */
1496         public counterparty_node_id: Uint8Array;
1497         /**
1498          * The channel value of the requested channel.
1499          */
1500         public funding_satoshis: bigint;
1501         /**
1502          * Our starting balance in the channel if the request is accepted, in milli-satoshi.
1503          */
1504         public push_msat: bigint;
1505         /**
1506          * The features that this channel will operate with. If you reject the channel, a
1507          * well-behaved counterparty may automatically re-attempt the channel with a new set of
1508          * feature flags.
1509          * 
1510          * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
1511          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1512          * 0.0.106.
1513          * 
1514          * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
1515          * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
1516          * 0.0.107. Channels setting this type also need to get manually accepted via
1517          * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
1518          * or will be rejected otherwise.
1519          * 
1520          * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1521          */
1522         public channel_type: ChannelTypeFeatures;
1523         /* @internal */
1524         public constructor(ptr: bigint) {
1525                 super(null, ptr);
1526                 const temporary_channel_id: number = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr);
1527                 const temporary_channel_id_conv: Uint8Array = bindings.decodeUint8Array(temporary_channel_id);
1528                 this.temporary_channel_id = temporary_channel_id_conv;
1529                 const counterparty_node_id: number = bindings.LDKEvent_OpenChannelRequest_get_counterparty_node_id(ptr);
1530                 const counterparty_node_id_conv: Uint8Array = bindings.decodeUint8Array(counterparty_node_id);
1531                 this.counterparty_node_id = counterparty_node_id_conv;
1532                 this.funding_satoshis = bindings.LDKEvent_OpenChannelRequest_get_funding_satoshis(ptr);
1533                 this.push_msat = bindings.LDKEvent_OpenChannelRequest_get_push_msat(ptr);
1534                 const channel_type: bigint = bindings.LDKEvent_OpenChannelRequest_get_channel_type(ptr);
1535                 const channel_type_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, channel_type);
1536                         CommonBase.add_ref_from(channel_type_hu_conv, this);
1537                 this.channel_type = channel_type_hu_conv;
1538         }
1539 }
1540 /** A Event of type HTLCHandlingFailed */
1541 export class Event_HTLCHandlingFailed extends Event {
1542         /**
1543          * The channel over which the HTLC was received.
1544          */
1545         public prev_channel_id: Uint8Array;
1546         /**
1547          * Destination of the HTLC that failed to be processed.
1548          */
1549         public failed_next_destination: HTLCDestination;
1550         /* @internal */
1551         public constructor(ptr: bigint) {
1552                 super(null, ptr);
1553                 const prev_channel_id: number = bindings.LDKEvent_HTLCHandlingFailed_get_prev_channel_id(ptr);
1554                 const prev_channel_id_conv: Uint8Array = bindings.decodeUint8Array(prev_channel_id);
1555                 this.prev_channel_id = prev_channel_id_conv;
1556                 const failed_next_destination: bigint = bindings.LDKEvent_HTLCHandlingFailed_get_failed_next_destination(ptr);
1557                 const failed_next_destination_hu_conv: HTLCDestination = HTLCDestination.constr_from_ptr(failed_next_destination);
1558                         CommonBase.add_ref_from(failed_next_destination_hu_conv, this);
1559                 this.failed_next_destination = failed_next_destination_hu_conv;
1560         }
1561 }