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