[TS] Update auto-generated bindings to LDK 0.0.118
[ldk-java] / ts / structs / ChannelManager.mts
1 import { TxOut } from '../structs/TxOut.mjs';
2 import { TxIn } from '../structs/TxIn.mjs';
3 import { BigEndianScalar } from '../structs/BigEndianScalar.mjs';
4 import { Bolt11SemanticError } from '../enums/Bolt11SemanticError.mjs';
5 import { Bolt12SemanticError } from '../enums/Bolt12SemanticError.mjs';
6 import { COption_NoneZ } from '../enums/COption_NoneZ.mjs';
7 import { ChannelMonitorUpdateStatus } from '../enums/ChannelMonitorUpdateStatus.mjs';
8 import { ChannelShutdownState } from '../enums/ChannelShutdownState.mjs';
9 import { ConfirmationTarget } from '../enums/ConfirmationTarget.mjs';
10 import { CreationError } from '../enums/CreationError.mjs';
11 import { Currency } from '../enums/Currency.mjs';
12 import { HTLCClaim } from '../enums/HTLCClaim.mjs';
13 import { IOError } from '../enums/IOError.mjs';
14 import { Level } from '../enums/Level.mjs';
15 import { Network } from '../enums/Network.mjs';
16 import { PaymentFailureReason } from '../enums/PaymentFailureReason.mjs';
17 import { Recipient } from '../enums/Recipient.mjs';
18 import { RetryableSendFailure } from '../enums/RetryableSendFailure.mjs';
19 import { Secp256k1Error } from '../enums/Secp256k1Error.mjs';
20 import { SiPrefix } from '../enums/SiPrefix.mjs';
21 import { SocketAddressParseError } from '../enums/SocketAddressParseError.mjs';
22 import { UtxoLookupError } from '../enums/UtxoLookupError.mjs';
23 import { Bech32Error } from '../structs/Bech32Error.mjs';
24 import { Option_u64Z } from '../structs/Option_u64Z.mjs';
25 import { BlindedPath } from '../structs/BlindedPath.mjs';
26 import { Refund } from '../structs/Refund.mjs';
27 import { Bolt12ParseError } from '../structs/Bolt12ParseError.mjs';
28 import { Result_RefundBolt12ParseErrorZ } from '../structs/Result_RefundBolt12ParseErrorZ.mjs';
29 import { Retry } from '../structs/Retry.mjs';
30 import { DecodeError } from '../structs/DecodeError.mjs';
31 import { Result_RetryDecodeErrorZ } from '../structs/Result_RetryDecodeErrorZ.mjs';
32 import { ShutdownScript } from '../structs/ShutdownScript.mjs';
33 import { APIError } from '../structs/APIError.mjs';
34 import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs';
35 import { Option_ThirtyTwoBytesZ } from '../structs/Option_ThirtyTwoBytesZ.mjs';
36 import { Option_CVec_u8ZZ } from '../structs/Option_CVec_u8ZZ.mjs';
37 import { RecipientOnionFields } from '../structs/RecipientOnionFields.mjs';
38 import { Result_RecipientOnionFieldsDecodeErrorZ } from '../structs/Result_RecipientOnionFieldsDecodeErrorZ.mjs';
39 import { TwoTuple_u64CVec_u8ZZ } from '../structs/TwoTuple_u64CVec_u8ZZ.mjs';
40 import { Result_RecipientOnionFieldsNoneZ } from '../structs/Result_RecipientOnionFieldsNoneZ.mjs';
41 import { Option_CVec_ThirtyTwoBytesZZ } from '../structs/Option_CVec_ThirtyTwoBytesZZ.mjs';
42 import { Result_ThirtyTwoBytesNoneZ } from '../structs/Result_ThirtyTwoBytesNoneZ.mjs';
43 import { BlindedPayInfo } from '../structs/BlindedPayInfo.mjs';
44 import { Result_BlindedPayInfoDecodeErrorZ } from '../structs/Result_BlindedPayInfoDecodeErrorZ.mjs';
45 import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs';
46 import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs';
47 import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs';
48 import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs';
49 import { OutPoint } from '../structs/OutPoint.mjs';
50 import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs';
51 import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs';
52 import { Option_u32Z } from '../structs/Option_u32Z.mjs';
53 import { TwoTuple_CVec_u8ZusizeZ } from '../structs/TwoTuple_CVec_u8ZusizeZ.mjs';
54 import { Result_C2Tuple_CVec_u8ZusizeZNoneZ } from '../structs/Result_C2Tuple_CVec_u8ZusizeZNoneZ.mjs';
55 import { ChannelDerivationParameters } from '../structs/ChannelDerivationParameters.mjs';
56 import { Result_ChannelDerivationParametersDecodeErrorZ } from '../structs/Result_ChannelDerivationParametersDecodeErrorZ.mjs';
57 import { HTLCDescriptor } from '../structs/HTLCDescriptor.mjs';
58 import { Result_HTLCDescriptorDecodeErrorZ } from '../structs/Result_HTLCDescriptorDecodeErrorZ.mjs';
59 import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs';
60 import { TwoTuple_ECDSASignatureCVec_ECDSASignatureZZ } from '../structs/TwoTuple_ECDSASignatureCVec_ECDSASignatureZZ.mjs';
61 import { Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ } from '../structs/Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.mjs';
62 import { Result_ECDSASignatureNoneZ } from '../structs/Result_ECDSASignatureNoneZ.mjs';
63 import { Result_PublicKeyNoneZ } from '../structs/Result_PublicKeyNoneZ.mjs';
64 import { Option_BigEndianScalarZ } from '../structs/Option_BigEndianScalarZ.mjs';
65 import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs';
66 import { Result_SchnorrSignatureNoneZ } from '../structs/Result_SchnorrSignatureNoneZ.mjs';
67 import { CommitmentTransaction } from '../structs/CommitmentTransaction.mjs';
68 import { HolderCommitmentTransaction } from '../structs/HolderCommitmentTransaction.mjs';
69 import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs';
70 import { ClosingTransaction } from '../structs/ClosingTransaction.mjs';
71 import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs';
72 import { ChannelPublicKeys } from '../structs/ChannelPublicKeys.mjs';
73 import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs';
74 import { ChannelSigner, ChannelSignerInterface } from '../structs/ChannelSigner.mjs';
75 import { EcdsaChannelSigner, EcdsaChannelSignerInterface } from '../structs/EcdsaChannelSigner.mjs';
76 import { WriteableEcdsaChannelSigner, WriteableEcdsaChannelSignerInterface } from '../structs/WriteableEcdsaChannelSigner.mjs';
77 import { Result_WriteableEcdsaChannelSignerDecodeErrorZ } from '../structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mjs';
78 import { Result_CVec_u8ZNoneZ } from '../structs/Result_CVec_u8ZNoneZ.mjs';
79 import { Result_ShutdownScriptNoneZ } from '../structs/Result_ShutdownScriptNoneZ.mjs';
80 import { Option_u16Z } from '../structs/Option_u16Z.mjs';
81 import { Option_boolZ } from '../structs/Option_boolZ.mjs';
82 import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs';
83 import { InMemorySigner } from '../structs/InMemorySigner.mjs';
84 import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs';
85 import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs';
86 import { ChannelDetails } from '../structs/ChannelDetails.mjs';
87 import { Route } from '../structs/Route.mjs';
88 import { LightningError } from '../structs/LightningError.mjs';
89 import { Result_RouteLightningErrorZ } from '../structs/Result_RouteLightningErrorZ.mjs';
90 import { InFlightHtlcs } from '../structs/InFlightHtlcs.mjs';
91 import { Result_InFlightHtlcsDecodeErrorZ } from '../structs/Result_InFlightHtlcsDecodeErrorZ.mjs';
92 import { RouteHop } from '../structs/RouteHop.mjs';
93 import { Result_RouteHopDecodeErrorZ } from '../structs/Result_RouteHopDecodeErrorZ.mjs';
94 import { BlindedHop } from '../structs/BlindedHop.mjs';
95 import { BlindedTail } from '../structs/BlindedTail.mjs';
96 import { Result_BlindedTailDecodeErrorZ } from '../structs/Result_BlindedTailDecodeErrorZ.mjs';
97 import { Path } from '../structs/Path.mjs';
98 import { Result_RouteDecodeErrorZ } from '../structs/Result_RouteDecodeErrorZ.mjs';
99 import { RouteParameters } from '../structs/RouteParameters.mjs';
100 import { Result_RouteParametersDecodeErrorZ } from '../structs/Result_RouteParametersDecodeErrorZ.mjs';
101 import { PaymentParameters } from '../structs/PaymentParameters.mjs';
102 import { Result_PaymentParametersDecodeErrorZ } from '../structs/Result_PaymentParametersDecodeErrorZ.mjs';
103 import { TwoTuple_BlindedPayInfoBlindedPathZ } from '../structs/TwoTuple_BlindedPayInfoBlindedPathZ.mjs';
104 import { RouteHint } from '../structs/RouteHint.mjs';
105 import { RouteHintHop } from '../structs/RouteHintHop.mjs';
106 import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs';
107 import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs';
108 import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
109 import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
110 import { NodeId } from '../structs/NodeId.mjs';
111 import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs';
112 import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs';
113 import { TwoTuple_Z } from '../structs/TwoTuple_Z.mjs';
114 import { TwoTuple__u1632_u1632Z } from '../structs/TwoTuple__u1632_u1632Z.mjs';
115 import { Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ } from '../structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.mjs';
116 import { Option_f64Z } from '../structs/Option_f64Z.mjs';
117 import { Record } from '../structs/Record.mjs';
118 import { Logger, LoggerInterface } from '../structs/Logger.mjs';
119 import { NetworkGraph } from '../structs/NetworkGraph.mjs';
120 import { ProbabilisticScorer } from '../structs/ProbabilisticScorer.mjs';
121 import { Result_ProbabilisticScorerDecodeErrorZ } from '../structs/Result_ProbabilisticScorerDecodeErrorZ.mjs';
122 import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs';
123 import { TwoTuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ } from '../structs/TwoTuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ.mjs';
124 import { Result_ChannelMonitorUpdateStatusNoneZ } from '../structs/Result_ChannelMonitorUpdateStatusNoneZ.mjs';
125 import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
126 import { MonitorEvent } from '../structs/MonitorEvent.mjs';
127 import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs';
128 import { InitFeatures } from '../structs/InitFeatures.mjs';
129 import { Result_InitFeaturesDecodeErrorZ } from '../structs/Result_InitFeaturesDecodeErrorZ.mjs';
130 import { ChannelFeatures } from '../structs/ChannelFeatures.mjs';
131 import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs';
132 import { NodeFeatures } from '../structs/NodeFeatures.mjs';
133 import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs';
134 import { Bolt11InvoiceFeatures } from '../structs/Bolt11InvoiceFeatures.mjs';
135 import { Result_Bolt11InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.mjs';
136 import { Bolt12InvoiceFeatures } from '../structs/Bolt12InvoiceFeatures.mjs';
137 import { Result_Bolt12InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.mjs';
138 import { BlindedHopFeatures } from '../structs/BlindedHopFeatures.mjs';
139 import { Result_BlindedHopFeaturesDecodeErrorZ } from '../structs/Result_BlindedHopFeaturesDecodeErrorZ.mjs';
140 import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs';
141 import { Result_ChannelTypeFeaturesDecodeErrorZ } from '../structs/Result_ChannelTypeFeaturesDecodeErrorZ.mjs';
142 import { Offer } from '../structs/Offer.mjs';
143 import { Result_OfferBolt12ParseErrorZ } from '../structs/Result_OfferBolt12ParseErrorZ.mjs';
144 import { Result_PublicKeySecp256k1ErrorZ } from '../structs/Result_PublicKeySecp256k1ErrorZ.mjs';
145 import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs';
146 import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
147 import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
148 import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.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_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs';
156 import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs';
157 import { ChannelAnnouncement } from '../structs/ChannelAnnouncement.mjs';
158 import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs';
159 import { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ } from '../structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.mjs';
160 import { AcceptChannel } from '../structs/AcceptChannel.mjs';
161 import { AcceptChannelV2 } from '../structs/AcceptChannelV2.mjs';
162 import { OpenChannel } from '../structs/OpenChannel.mjs';
163 import { OpenChannelV2 } from '../structs/OpenChannelV2.mjs';
164 import { FundingCreated } from '../structs/FundingCreated.mjs';
165 import { FundingSigned } from '../structs/FundingSigned.mjs';
166 import { TxAddInput } from '../structs/TxAddInput.mjs';
167 import { TxAddOutput } from '../structs/TxAddOutput.mjs';
168 import { TxRemoveInput } from '../structs/TxRemoveInput.mjs';
169 import { TxRemoveOutput } from '../structs/TxRemoveOutput.mjs';
170 import { TxComplete } from '../structs/TxComplete.mjs';
171 import { TxSignatures } from '../structs/TxSignatures.mjs';
172 import { TxInitRbf } from '../structs/TxInitRbf.mjs';
173 import { TxAckRbf } from '../structs/TxAckRbf.mjs';
174 import { TxAbort } from '../structs/TxAbort.mjs';
175 import { ChannelReady } from '../structs/ChannelReady.mjs';
176 import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs';
177 import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs';
178 import { RevokeAndACK } from '../structs/RevokeAndACK.mjs';
179 import { ClosingSigned } from '../structs/ClosingSigned.mjs';
180 import { Shutdown } from '../structs/Shutdown.mjs';
181 import { ChannelReestablish } from '../structs/ChannelReestablish.mjs';
182 import { NodeAnnouncement } from '../structs/NodeAnnouncement.mjs';
183 import { ErrorMessage } from '../structs/ErrorMessage.mjs';
184 import { WarningMessage } from '../structs/WarningMessage.mjs';
185 import { ErrorAction } from '../structs/ErrorAction.mjs';
186 import { QueryChannelRange } from '../structs/QueryChannelRange.mjs';
187 import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs';
188 import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs';
189 import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs';
190 import { MessageSendEvent } from '../structs/MessageSendEvent.mjs';
191 import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs';
192 import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs';
193 import { ChannelInfo } from '../structs/ChannelInfo.mjs';
194 import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
195 import { RoutingFees } from '../structs/RoutingFees.mjs';
196 import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
197 import { Hostname } from '../structs/Hostname.mjs';
198 import { SocketAddress } from '../structs/SocketAddress.mjs';
199 import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
200 import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
201 import { NodeAlias } from '../structs/NodeAlias.mjs';
202 import { Result_NodeAliasDecodeErrorZ } from '../structs/Result_NodeAliasDecodeErrorZ.mjs';
203 import { NodeInfo } from '../structs/NodeInfo.mjs';
204 import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs';
205 import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs';
206 import { Option_CVec_SocketAddressZZ } from '../structs/Option_CVec_SocketAddressZZ.mjs';
207 import { Utxo } from '../structs/Utxo.mjs';
208 import { Option_TxOutZ } from '../structs/Option_TxOutZ.mjs';
209 import { Input } from '../structs/Input.mjs';
210 import { CoinSelection } from '../structs/CoinSelection.mjs';
211 import { Result_CoinSelectionNoneZ } from '../structs/Result_CoinSelectionNoneZ.mjs';
212 import { Result_CVec_UtxoZNoneZ } from '../structs/Result_CVec_UtxoZNoneZ.mjs';
213 import { TwoTuple_u64u16Z } from '../structs/TwoTuple_u64u16Z.mjs';
214 import { Option_C2Tuple_u64u16ZZ } from '../structs/Option_C2Tuple_u64u16ZZ.mjs';
215 import { Option_ChannelShutdownStateZ } from '../structs/Option_ChannelShutdownStateZ.mjs';
216 import { Result_ThirtyTwoBytesAPIErrorZ } from '../structs/Result_ThirtyTwoBytesAPIErrorZ.mjs';
217 import { RecentPaymentDetails } from '../structs/RecentPaymentDetails.mjs';
218 import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs';
219 import { Result_NonePaymentSendFailureZ } from '../structs/Result_NonePaymentSendFailureZ.mjs';
220 import { Result_NoneRetryableSendFailureZ } from '../structs/Result_NoneRetryableSendFailureZ.mjs';
221 import { Result_ThirtyTwoBytesPaymentSendFailureZ } from '../structs/Result_ThirtyTwoBytesPaymentSendFailureZ.mjs';
222 import { Result_ThirtyTwoBytesRetryableSendFailureZ } from '../structs/Result_ThirtyTwoBytesRetryableSendFailureZ.mjs';
223 import { TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ } from '../structs/TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ.mjs';
224 import { Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.mjs';
225 import { ProbeSendFailure } from '../structs/ProbeSendFailure.mjs';
226 import { Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ } from '../structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.mjs';
227 import { TwoTuple_ThirtyTwoBytesPublicKeyZ } from '../structs/TwoTuple_ThirtyTwoBytesPublicKeyZ.mjs';
228 import { Option_StrZ } from '../structs/Option_StrZ.mjs';
229 import { Result_NoneBolt12SemanticErrorZ } from '../structs/Result_NoneBolt12SemanticErrorZ.mjs';
230 import { Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.mjs';
231 import { InvoiceRequest } from '../structs/InvoiceRequest.mjs';
232 import { Bolt12Invoice } from '../structs/Bolt12Invoice.mjs';
233 import { InvoiceError } from '../structs/InvoiceError.mjs';
234 import { OffersMessage } from '../structs/OffersMessage.mjs';
235 import { Option_OffersMessageZ } from '../structs/Option_OffersMessageZ.mjs';
236 import { Destination } from '../structs/Destination.mjs';
237 import { ThreeTuple_OffersMessageDestinationBlindedPathZ } from '../structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.mjs';
238 import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs';
239 import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs';
240 import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs';
241 import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_ChannelCounterpartyDecodeErrorZ.mjs';
242 import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs';
243 import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs';
244 import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs';
245 import { Result_ChannelShutdownStateDecodeErrorZ } from '../structs/Result_ChannelShutdownStateDecodeErrorZ.mjs';
246 import { ChannelMonitor } from '../structs/ChannelMonitor.mjs';
247 import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs';
248 import { Watch, WatchInterface } from '../structs/Watch.mjs';
249 import { BroadcasterInterface, BroadcasterInterfaceInterface } from '../structs/BroadcasterInterface.mjs';
250 import { EntropySource, EntropySourceInterface } from '../structs/EntropySource.mjs';
251 import { UnsignedInvoiceRequest } from '../structs/UnsignedInvoiceRequest.mjs';
252 import { UnsignedBolt12Invoice } from '../structs/UnsignedBolt12Invoice.mjs';
253 import { UnsignedChannelUpdate } from '../structs/UnsignedChannelUpdate.mjs';
254 import { UnsignedNodeAnnouncement } from '../structs/UnsignedNodeAnnouncement.mjs';
255 import { UnsignedGossipMessage } from '../structs/UnsignedGossipMessage.mjs';
256 import { NodeSigner, NodeSignerInterface } from '../structs/NodeSigner.mjs';
257 import { SignerProvider, SignerProviderInterface } from '../structs/SignerProvider.mjs';
258 import { FeeEstimator, FeeEstimatorInterface } from '../structs/FeeEstimator.mjs';
259 import { Router, RouterInterface } from '../structs/Router.mjs';
260 import { TwoTuple_ThirtyTwoBytesChannelManagerZ } from '../structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.mjs';
261 import { Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.mjs';
262 import { MaxDustHTLCExposure } from '../structs/MaxDustHTLCExposure.mjs';
263 import { Result_MaxDustHTLCExposureDecodeErrorZ } from '../structs/Result_MaxDustHTLCExposureDecodeErrorZ.mjs';
264 import { ChannelConfig } from '../structs/ChannelConfig.mjs';
265 import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs';
266 import { Option_MaxDustHTLCExposureZ } from '../structs/Option_MaxDustHTLCExposureZ.mjs';
267 import { Option_APIErrorZ } from '../structs/Option_APIErrorZ.mjs';
268 import { Result_COption_APIErrorZDecodeErrorZ } from '../structs/Result_COption_APIErrorZDecodeErrorZ.mjs';
269 import { Result_ChannelMonitorUpdateDecodeErrorZ } from '../structs/Result_ChannelMonitorUpdateDecodeErrorZ.mjs';
270 import { Option_MonitorEventZ } from '../structs/Option_MonitorEventZ.mjs';
271 import { Result_COption_MonitorEventZDecodeErrorZ } from '../structs/Result_COption_MonitorEventZDecodeErrorZ.mjs';
272 import { Result_HTLCUpdateDecodeErrorZ } from '../structs/Result_HTLCUpdateDecodeErrorZ.mjs';
273 import { TwoTuple_OutPointCVec_u8ZZ } from '../structs/TwoTuple_OutPointCVec_u8ZZ.mjs';
274 import { TwoTuple_u32CVec_u8ZZ } from '../structs/TwoTuple_u32CVec_u8ZZ.mjs';
275 import { TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ } from '../structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.mjs';
276 import { TwoTuple_u32TxOutZ } from '../structs/TwoTuple_u32TxOutZ.mjs';
277 import { TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ } from '../structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.mjs';
278 import { Balance } from '../structs/Balance.mjs';
279 import { TwoTuple_ThirtyTwoBytesChannelMonitorZ } from '../structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.mjs';
280 import { Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.mjs';
281 import { Type, TypeInterface } from '../structs/Type.mjs';
282 import { TwoTuple_PublicKeyTypeZ } from '../structs/TwoTuple_PublicKeyTypeZ.mjs';
283 import { OnionMessageContents, OnionMessageContentsInterface } from '../structs/OnionMessageContents.mjs';
284 import { Option_OnionMessageContentsZ } from '../structs/Option_OnionMessageContentsZ.mjs';
285 import { Result_COption_OnionMessageContentsZDecodeErrorZ } from '../structs/Result_COption_OnionMessageContentsZDecodeErrorZ.mjs';
286 import { ThreeTuple_OnionMessageContentsDestinationBlindedPathZ } from '../structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.mjs';
287 import { Option_TypeZ } from '../structs/Option_TypeZ.mjs';
288 import { Result_COption_TypeZDecodeErrorZ } from '../structs/Result_COption_TypeZDecodeErrorZ.mjs';
289 import { Option_SocketAddressZ } from '../structs/Option_SocketAddressZ.mjs';
290 import { TwoTuple_PublicKeyCOption_SocketAddressZZ } from '../structs/TwoTuple_PublicKeyCOption_SocketAddressZZ.mjs';
291 import { PeerHandleError } from '../structs/PeerHandleError.mjs';
292 import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs';
293 import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs';
294 import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs';
295 import { GraphSyncError } from '../structs/GraphSyncError.mjs';
296 import { Result_u32GraphSyncErrorZ } from '../structs/Result_u32GraphSyncErrorZ.mjs';
297 import { Result_CVec_u8ZIOErrorZ } from '../structs/Result_CVec_u8ZIOErrorZ.mjs';
298 import { Result_NoneIOErrorZ } from '../structs/Result_NoneIOErrorZ.mjs';
299 import { Result_CVec_StrZIOErrorZ } from '../structs/Result_CVec_StrZIOErrorZ.mjs';
300 import { Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ } from '../structs/Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.mjs';
301 import { Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ } from '../structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.mjs';
302 import { Option_SecretKeyZ } from '../structs/Option_SecretKeyZ.mjs';
303 import { VerifiedInvoiceRequest } from '../structs/VerifiedInvoiceRequest.mjs';
304 import { Result_VerifiedInvoiceRequestNoneZ } from '../structs/Result_VerifiedInvoiceRequestNoneZ.mjs';
305 import { Option_i64Z } from '../structs/Option_i64Z.mjs';
306 import { Result_SocketAddressDecodeErrorZ } from '../structs/Result_SocketAddressDecodeErrorZ.mjs';
307 import { Result_SocketAddressSocketAddressParseErrorZ } from '../structs/Result_SocketAddressSocketAddressParseErrorZ.mjs';
308 import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs';
309 import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs';
310 import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs';
311 import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs';
312 import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs';
313 import { Result_AcceptChannelV2DecodeErrorZ } from '../structs/Result_AcceptChannelV2DecodeErrorZ.mjs';
314 import { Result_TxAddInputDecodeErrorZ } from '../structs/Result_TxAddInputDecodeErrorZ.mjs';
315 import { Result_TxAddOutputDecodeErrorZ } from '../structs/Result_TxAddOutputDecodeErrorZ.mjs';
316 import { Result_TxRemoveInputDecodeErrorZ } from '../structs/Result_TxRemoveInputDecodeErrorZ.mjs';
317 import { Result_TxRemoveOutputDecodeErrorZ } from '../structs/Result_TxRemoveOutputDecodeErrorZ.mjs';
318 import { Result_TxCompleteDecodeErrorZ } from '../structs/Result_TxCompleteDecodeErrorZ.mjs';
319 import { Result_TxSignaturesDecodeErrorZ } from '../structs/Result_TxSignaturesDecodeErrorZ.mjs';
320 import { Result_TxInitRbfDecodeErrorZ } from '../structs/Result_TxInitRbfDecodeErrorZ.mjs';
321 import { Result_TxAckRbfDecodeErrorZ } from '../structs/Result_TxAckRbfDecodeErrorZ.mjs';
322 import { Result_TxAbortDecodeErrorZ } from '../structs/Result_TxAbortDecodeErrorZ.mjs';
323 import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs';
324 import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs';
325 import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs';
326 import { ClosingSignedFeeRange } from '../structs/ClosingSignedFeeRange.mjs';
327 import { Result_ClosingSignedFeeRangeDecodeErrorZ } from '../structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mjs';
328 import { CommitmentSigned } from '../structs/CommitmentSigned.mjs';
329 import { Result_CommitmentSignedDecodeErrorZ } from '../structs/Result_CommitmentSignedDecodeErrorZ.mjs';
330 import { Result_FundingCreatedDecodeErrorZ } from '../structs/Result_FundingCreatedDecodeErrorZ.mjs';
331 import { Result_FundingSignedDecodeErrorZ } from '../structs/Result_FundingSignedDecodeErrorZ.mjs';
332 import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyDecodeErrorZ.mjs';
333 import { Init } from '../structs/Init.mjs';
334 import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs';
335 import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs';
336 import { Result_OpenChannelV2DecodeErrorZ } from '../structs/Result_OpenChannelV2DecodeErrorZ.mjs';
337 import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs';
338 import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
339 import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs';
340 import { Result_UpdateFailMalformedHTLCDecodeErrorZ } from '../structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mjs';
341 import { UpdateFee } from '../structs/UpdateFee.mjs';
342 import { Result_UpdateFeeDecodeErrorZ } from '../structs/Result_UpdateFeeDecodeErrorZ.mjs';
343 import { Result_UpdateFulfillHTLCDecodeErrorZ } from '../structs/Result_UpdateFulfillHTLCDecodeErrorZ.mjs';
344 import { Result_UpdateAddHTLCDecodeErrorZ } from '../structs/Result_UpdateAddHTLCDecodeErrorZ.mjs';
345 import { OnionMessage } from '../structs/OnionMessage.mjs';
346 import { Result_OnionMessageDecodeErrorZ } from '../structs/Result_OnionMessageDecodeErrorZ.mjs';
347 import { Ping } from '../structs/Ping.mjs';
348 import { Result_PingDecodeErrorZ } from '../structs/Result_PingDecodeErrorZ.mjs';
349 import { Pong } from '../structs/Pong.mjs';
350 import { Result_PongDecodeErrorZ } from '../structs/Result_PongDecodeErrorZ.mjs';
351 import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs';
352 import { Result_ChannelAnnouncementDecodeErrorZ } from '../structs/Result_ChannelAnnouncementDecodeErrorZ.mjs';
353 import { Result_UnsignedChannelUpdateDecodeErrorZ } from '../structs/Result_UnsignedChannelUpdateDecodeErrorZ.mjs';
354 import { Result_ChannelUpdateDecodeErrorZ } from '../structs/Result_ChannelUpdateDecodeErrorZ.mjs';
355 import { Result_ErrorMessageDecodeErrorZ } from '../structs/Result_ErrorMessageDecodeErrorZ.mjs';
356 import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs';
357 import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
358 import { Result_NodeAnnouncementDecodeErrorZ } from '../structs/Result_NodeAnnouncementDecodeErrorZ.mjs';
359 import { Result_QueryShortChannelIdsDecodeErrorZ } from '../structs/Result_QueryShortChannelIdsDecodeErrorZ.mjs';
360 import { ReplyShortChannelIdsEnd } from '../structs/ReplyShortChannelIdsEnd.mjs';
361 import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mjs';
362 import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs';
363 import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs';
364 import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs';
365 import { Bolt11Invoice } from '../structs/Bolt11Invoice.mjs';
366 import { SignOrCreationError } from '../structs/SignOrCreationError.mjs';
367 import { Result_Bolt11InvoiceSignOrCreationErrorZ } from '../structs/Result_Bolt11InvoiceSignOrCreationErrorZ.mjs';
368 import { Result_OffersMessageDecodeErrorZ } from '../structs/Result_OffersMessageDecodeErrorZ.mjs';
369 import { Option_HTLCClaimZ } from '../structs/Option_HTLCClaimZ.mjs';
370 import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs';
371 import { Result_CounterpartyCommitmentSecretsDecodeErrorZ } from '../structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.mjs';
372 import { TxCreationKeys } from '../structs/TxCreationKeys.mjs';
373 import { Result_TxCreationKeysDecodeErrorZ } from '../structs/Result_TxCreationKeysDecodeErrorZ.mjs';
374 import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelPublicKeysDecodeErrorZ.mjs';
375 import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs';
376 import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs';
377 import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs';
378 import { Result_ChannelTransactionParametersDecodeErrorZ } from '../structs/Result_ChannelTransactionParametersDecodeErrorZ.mjs';
379 import { Result_HolderCommitmentTransactionDecodeErrorZ } from '../structs/Result_HolderCommitmentTransactionDecodeErrorZ.mjs';
380 import { BuiltCommitmentTransaction } from '../structs/BuiltCommitmentTransaction.mjs';
381 import { Result_BuiltCommitmentTransactionDecodeErrorZ } from '../structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mjs';
382 import { TrustedClosingTransaction } from '../structs/TrustedClosingTransaction.mjs';
383 import { Result_TrustedClosingTransactionNoneZ } from '../structs/Result_TrustedClosingTransactionNoneZ.mjs';
384 import { Result_CommitmentTransactionDecodeErrorZ } from '../structs/Result_CommitmentTransactionDecodeErrorZ.mjs';
385 import { TrustedCommitmentTransaction } from '../structs/TrustedCommitmentTransaction.mjs';
386 import { Result_TrustedCommitmentTransactionNoneZ } from '../structs/Result_TrustedCommitmentTransactionNoneZ.mjs';
387 import { Result_CVec_ECDSASignatureZNoneZ } from '../structs/Result_CVec_ECDSASignatureZNoneZ.mjs';
388 import { Option_usizeZ } from '../structs/Option_usizeZ.mjs';
389 import { Result_ShutdownScriptDecodeErrorZ } from '../structs/Result_ShutdownScriptDecodeErrorZ.mjs';
390 import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs';
391 import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs';
392 import { PaymentPurpose } from '../structs/PaymentPurpose.mjs';
393 import { Result_PaymentPurposeDecodeErrorZ } from '../structs/Result_PaymentPurposeDecodeErrorZ.mjs';
394 import { ClaimedHTLC } from '../structs/ClaimedHTLC.mjs';
395 import { Result_ClaimedHTLCDecodeErrorZ } from '../structs/Result_ClaimedHTLCDecodeErrorZ.mjs';
396 import { PathFailure } from '../structs/PathFailure.mjs';
397 import { Option_PathFailureZ } from '../structs/Option_PathFailureZ.mjs';
398 import { Result_COption_PathFailureZDecodeErrorZ } from '../structs/Result_COption_PathFailureZDecodeErrorZ.mjs';
399 import { UntrustedString } from '../structs/UntrustedString.mjs';
400 import { ClosureReason } from '../structs/ClosureReason.mjs';
401 import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
402 import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
403 import { HTLCDestination } from '../structs/HTLCDestination.mjs';
404 import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs';
405 import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs';
406 import { Result_PaymentFailureReasonDecodeErrorZ } from '../structs/Result_PaymentFailureReasonDecodeErrorZ.mjs';
407 import { Option_U128Z } from '../structs/Option_U128Z.mjs';
408 import { Option_PaymentFailureReasonZ } from '../structs/Option_PaymentFailureReasonZ.mjs';
409 import { AnchorDescriptor } from '../structs/AnchorDescriptor.mjs';
410 import { BumpTransactionEvent } from '../structs/BumpTransactionEvent.mjs';
411 import { Event } from '../structs/Event.mjs';
412 import { Option_EventZ } from '../structs/Option_EventZ.mjs';
413 import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs';
414 import { Bolt11ParseError } from '../structs/Bolt11ParseError.mjs';
415 import { Result_SiPrefixBolt11ParseErrorZ } from '../structs/Result_SiPrefixBolt11ParseErrorZ.mjs';
416 import { ParseOrSemanticError } from '../structs/ParseOrSemanticError.mjs';
417 import { Result_Bolt11InvoiceParseOrSemanticErrorZ } from '../structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.mjs';
418 import { SignedRawBolt11Invoice } from '../structs/SignedRawBolt11Invoice.mjs';
419 import { Result_SignedRawBolt11InvoiceBolt11ParseErrorZ } from '../structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.mjs';
420 import { RawBolt11Invoice } from '../structs/RawBolt11Invoice.mjs';
421 import { Bolt11InvoiceSignature } from '../structs/Bolt11InvoiceSignature.mjs';
422 import { ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ } from '../structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.mjs';
423 import { PayeePubKey } from '../structs/PayeePubKey.mjs';
424 import { Result_PayeePubKeySecp256k1ErrorZ } from '../structs/Result_PayeePubKeySecp256k1ErrorZ.mjs';
425 import { PrivateRoute } from '../structs/PrivateRoute.mjs';
426 import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs';
427 import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs';
428 import { Result_NoneBolt11SemanticErrorZ } from '../structs/Result_NoneBolt11SemanticErrorZ.mjs';
429 import { Result_Bolt11InvoiceBolt11SemanticErrorZ } from '../structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.mjs';
430 import { Description } from '../structs/Description.mjs';
431 import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs';
432 import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs';
433 import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs';
434 import { BigSize } from '../structs/BigSize.mjs';
435 import { Result_BigSizeDecodeErrorZ } from '../structs/Result_BigSizeDecodeErrorZ.mjs';
436 import { Result_HostnameDecodeErrorZ } from '../structs/Result_HostnameDecodeErrorZ.mjs';
437 import { TransactionU16LenLimited } from '../structs/TransactionU16LenLimited.mjs';
438 import { Result_TransactionU16LenLimitedNoneZ } from '../structs/Result_TransactionU16LenLimitedNoneZ.mjs';
439 import { Result_TransactionU16LenLimitedDecodeErrorZ } from '../structs/Result_TransactionU16LenLimitedDecodeErrorZ.mjs';
440 import { Result_UntrustedStringDecodeErrorZ } from '../structs/Result_UntrustedStringDecodeErrorZ.mjs';
441 import { ReceiveTlvs } from '../structs/ReceiveTlvs.mjs';
442 import { Result_ReceiveTlvsDecodeErrorZ } from '../structs/Result_ReceiveTlvsDecodeErrorZ.mjs';
443 import { PaymentRelay } from '../structs/PaymentRelay.mjs';
444 import { Result_PaymentRelayDecodeErrorZ } from '../structs/Result_PaymentRelayDecodeErrorZ.mjs';
445 import { PaymentConstraints } from '../structs/PaymentConstraints.mjs';
446 import { Result_PaymentConstraintsDecodeErrorZ } from '../structs/Result_PaymentConstraintsDecodeErrorZ.mjs';
447 import { PaymentError } from '../structs/PaymentError.mjs';
448 import { Result_ThirtyTwoBytesPaymentErrorZ } from '../structs/Result_ThirtyTwoBytesPaymentErrorZ.mjs';
449 import { Result_NonePaymentErrorZ } from '../structs/Result_NonePaymentErrorZ.mjs';
450 import { ProbingError } from '../structs/ProbingError.mjs';
451 import { Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ } from '../structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ.mjs';
452 import { Result_StrSecp256k1ErrorZ } from '../structs/Result_StrSecp256k1ErrorZ.mjs';
453 import { OnionMessagePath } from '../structs/OnionMessagePath.mjs';
454 import { Result_OnionMessagePathNoneZ } from '../structs/Result_OnionMessagePathNoneZ.mjs';
455 import { TwoTuple_PublicKeyOnionMessageZ } from '../structs/TwoTuple_PublicKeyOnionMessageZ.mjs';
456 import { SendError } from '../structs/SendError.mjs';
457 import { Result_C2Tuple_PublicKeyOnionMessageZSendErrorZ } from '../structs/Result_C2Tuple_PublicKeyOnionMessageZSendErrorZ.mjs';
458 import { ParsedOnionMessageContents } from '../structs/ParsedOnionMessageContents.mjs';
459 import { PeeledOnion } from '../structs/PeeledOnion.mjs';
460 import { Result_PeeledOnionNoneZ } from '../structs/Result_PeeledOnionNoneZ.mjs';
461 import { Result_NoneSendErrorZ } from '../structs/Result_NoneSendErrorZ.mjs';
462 import { Result_BlindedPathNoneZ } from '../structs/Result_BlindedPathNoneZ.mjs';
463 import { Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ } from '../structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.mjs';
464 import { Result_BlindedPathDecodeErrorZ } from '../structs/Result_BlindedPathDecodeErrorZ.mjs';
465 import { Result_BlindedHopDecodeErrorZ } from '../structs/Result_BlindedHopDecodeErrorZ.mjs';
466 import { Result_InvoiceErrorDecodeErrorZ } from '../structs/Result_InvoiceErrorDecodeErrorZ.mjs';
467 import { WatchedOutput } from '../structs/WatchedOutput.mjs';
468 import { Filter, FilterInterface } from '../structs/Filter.mjs';
469 import { Option_FilterZ } from '../structs/Option_FilterZ.mjs';
470 import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs';
471 import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs';
472 import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs';
473 import { TwoTuple_OutPointCVec_MonitorUpdateIdZZ } from '../structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.mjs';
474 import { KVStore, KVStoreInterface } from '../structs/KVStore.mjs';
475 import { ChannelUsage } from '../structs/ChannelUsage.mjs';
476 import { ProbabilisticScoringFeeParameters } from '../structs/ProbabilisticScoringFeeParameters.mjs';
477 import { ScoreLookUp, ScoreLookUpInterface } from '../structs/ScoreLookUp.mjs';
478 import { ScoreUpdate, ScoreUpdateInterface } from '../structs/ScoreUpdate.mjs';
479 import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs';
480 import { WriteableScore, WriteableScoreInterface } from '../structs/WriteableScore.mjs';
481 import { Persister, PersisterInterface } from '../structs/Persister.mjs';
482 import { MonitorUpdatingPersister } from '../structs/MonitorUpdatingPersister.mjs';
483 import { Persist, PersistInterface } from '../structs/Persist.mjs';
484 import { PrintableString } from '../structs/PrintableString.mjs';
485 import { FutureCallback, FutureCallbackInterface } from '../structs/FutureCallback.mjs';
486 import { Future } from '../structs/Future.mjs';
487 import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs';
488 import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs';
489 import { ChannelConfigUpdate } from '../structs/ChannelConfigUpdate.mjs';
490 import { UserConfig } from '../structs/UserConfig.mjs';
491 import { BestBlock } from '../structs/BestBlock.mjs';
492 import { Listen, ListenInterface } from '../structs/Listen.mjs';
493 import { Confirm, ConfirmInterface } from '../structs/Confirm.mjs';
494 import { ChainMonitor } from '../structs/ChainMonitor.mjs';
495 import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs';
496 import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs';
497 import { FailureCode } from '../structs/FailureCode.mjs';
498 import { ChainParameters } from '../structs/ChainParameters.mjs';
499 import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs';
500 import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs';
501 import { OffersMessageHandler, OffersMessageHandlerInterface } from '../structs/OffersMessageHandler.mjs';
502 import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs';
503 import { ExpandedKey } from '../structs/ExpandedKey.mjs';
504 import { Packet } from '../structs/Packet.mjs';
505 import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs';
506 import { OnionMessageHandler, OnionMessageHandlerInterface } from '../structs/OnionMessageHandler.mjs';
507 import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs';
508 import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs';
509 import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs';
510 import { CustomOnionMessageHandler, CustomOnionMessageHandlerInterface } from '../structs/CustomOnionMessageHandler.mjs';
511 import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs';
512 import { MessageHandler } from '../structs/MessageHandler.mjs';
513 import { SocketDescriptor, SocketDescriptorInterface } from '../structs/SocketDescriptor.mjs';
514 import { PeerManager } from '../structs/PeerManager.mjs';
515 import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs';
516 import { OfferFeatures } from '../structs/OfferFeatures.mjs';
517 import { InvoiceRequestFeatures } from '../structs/InvoiceRequestFeatures.mjs';
518 import { Amount } from '../structs/Amount.mjs';
519 import { Quantity } from '../structs/Quantity.mjs';
520 import { TaggedHash } from '../structs/TaggedHash.mjs';
521 import { ErroneousField } from '../structs/ErroneousField.mjs';
522 import { P2PGossipSync } from '../structs/P2PGossipSync.mjs';
523 import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs';
524 import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs';
525 import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs';
526 import { DefaultRouter } from '../structs/DefaultRouter.mjs';
527 import { ScorerAccountingForInFlightHtlcs } from '../structs/ScorerAccountingForInFlightHtlcs.mjs';
528 import { Payee } from '../structs/Payee.mjs';
529 import { Score, ScoreInterface } from '../structs/Score.mjs';
530 import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs';
531 import { MultiThreadedScoreLockRead } from '../structs/MultiThreadedScoreLockRead.mjs';
532 import { MultiThreadedScoreLockWrite } from '../structs/MultiThreadedScoreLockWrite.mjs';
533 import { ProbabilisticScoringDecayParameters } from '../structs/ProbabilisticScoringDecayParameters.mjs';
534 import { KeysManager } from '../structs/KeysManager.mjs';
535 import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs';
536 import { MessageRouter, MessageRouterInterface } from '../structs/MessageRouter.mjs';
537 import { OnionMessenger } from '../structs/OnionMessenger.mjs';
538 import { DefaultMessageRouter } from '../structs/DefaultMessageRouter.mjs';
539 import { ForwardNode } from '../structs/ForwardNode.mjs';
540 import { ForwardTlvs } from '../structs/ForwardTlvs.mjs';
541 import { CoinSelectionSource, CoinSelectionSourceInterface } from '../structs/CoinSelectionSource.mjs';
542 import { WalletSource, WalletSourceInterface } from '../structs/WalletSource.mjs';
543 import { Wallet } from '../structs/Wallet.mjs';
544 import { BumpTransactionEventHandler } from '../structs/BumpTransactionEventHandler.mjs';
545 import { RapidGossipSync } from '../structs/RapidGossipSync.mjs';
546 import { GossipSync } from '../structs/GossipSync.mjs';
547 import { RawDataPart } from '../structs/RawDataPart.mjs';
548 import { Sha256 } from '../structs/Sha256.mjs';
549 import { ExpiryTime } from '../structs/ExpiryTime.mjs';
550 import { MinFinalCltvExpiryDelta } from '../structs/MinFinalCltvExpiryDelta.mjs';
551 import { Fallback } from '../structs/Fallback.mjs';
552
553 import { CommonBase, UInt5, WitnessVersion, UnqualifiedError } from './CommonBase.mjs';
554 import * as bindings from '../bindings.mjs'
555
556
557 /**
558  * Manager which keeps track of a number of channels and sends messages to the appropriate
559  * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
560  * 
561  * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
562  * to individual Channels.
563  * 
564  * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
565  * all peers during write/read (though does not modify this instance, only the instance being
566  * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
567  * called [`funding_transaction_generated`] for outbound channels) being closed.
568  * 
569  * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
570  * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
571  * [`ChannelMonitorUpdate`] before returning from
572  * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
573  * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
574  * `ChannelManager` operations from occurring during the serialization process). If the
575  * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
576  * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
577  * will be lost (modulo on-chain transaction fees).
578  * 
579  * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
580  * tells you the last block hash which was connected. You should get the best block tip before using the manager.
581  * See [`chain::Listen`] and [`chain::Confirm`] for more details.
582  * 
583  * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
584  * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
585  * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
586  * offline for a full minute. In order to track this, you must call
587  * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
588  * 
589  * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
590  * inbound channels without confirmed funding transactions. This may result in nodes which we do
591  * not have a channel with being unable to connect to us or open new channels with us if we have
592  * many peers with unfunded channels.
593  * 
594  * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
595  * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
596  * never limited. Please ensure you limit the count of such channels yourself.
597  * 
598  * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
599  * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
600  * essentially you should default to using a [`SimpleRefChannelManager`], and use a
601  * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
602  * you're using lightning-net-tokio.
603  * 
604  * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
605  * [`funding_created`]: msgs::FundingCreated
606  * [`funding_transaction_generated`]: Self::funding_transaction_generated
607  * [`BlockHash`]: bitcoin::hash_types::BlockHash
608  * [`update_channel`]: chain::Watch::update_channel
609  * [`ChannelUpdate`]: msgs::ChannelUpdate
610  * [`timer_tick_occurred`]: Self::timer_tick_occurred
611  * [`read`]: ReadableArgs::read
612  */
613 export class ChannelManager extends CommonBase {
614         /* @internal */
615         public constructor(_dummy: null, ptr: bigint) {
616                 super(ptr, bindings.ChannelManager_free);
617         }
618
619         /**
620          * Constructs a new `ChannelManager` to hold several channels and route between them.
621          * 
622          * The current time or latest block header time can be provided as the `current_timestamp`.
623          * 
624          * This is the main \"logic hub\" for all channel-related actions, and implements
625          * [`ChannelMessageHandler`].
626          * 
627          * Non-proportional fees are fixed according to our risk using the provided fee estimator.
628          * 
629          * Users need to notify the new `ChannelManager` when a new block is connected or
630          * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
631          * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
632          * more details.
633          * 
634          * [`block_connected`]: chain::Listen::block_connected
635          * [`block_disconnected`]: chain::Listen::block_disconnected
636          * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
637          */
638         public static constructor_new(fee_est: FeeEstimator, chain_monitor: Watch, tx_broadcaster: BroadcasterInterface, router: Router, logger: Logger, entropy_source: EntropySource, node_signer: NodeSigner, signer_provider: SignerProvider, config: UserConfig, params: ChainParameters, current_timestamp: number): ChannelManager {
639                 const ret: bigint = bindings.ChannelManager_new(CommonBase.get_ptr_of(fee_est), CommonBase.get_ptr_of(chain_monitor), CommonBase.get_ptr_of(tx_broadcaster), CommonBase.get_ptr_of(router), CommonBase.get_ptr_of(logger), CommonBase.get_ptr_of(entropy_source), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(signer_provider), config == null ? 0n : CommonBase.get_ptr_of(config), params == null ? 0n : CommonBase.get_ptr_of(params), current_timestamp);
640                 const ret_hu_conv: ChannelManager = new ChannelManager(null, ret);
641                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
642                 CommonBase.add_ref_from(ret_hu_conv, fee_est);
643                 CommonBase.add_ref_from(ret_hu_conv, chain_monitor);
644                 CommonBase.add_ref_from(ret_hu_conv, tx_broadcaster);
645                 CommonBase.add_ref_from(ret_hu_conv, router);
646                 CommonBase.add_ref_from(ret_hu_conv, logger);
647                 CommonBase.add_ref_from(ret_hu_conv, entropy_source);
648                 CommonBase.add_ref_from(ret_hu_conv, node_signer);
649                 CommonBase.add_ref_from(ret_hu_conv, signer_provider);
650                 CommonBase.add_ref_from(ret_hu_conv, config);
651                 CommonBase.add_ref_from(ret_hu_conv, params);
652                 return ret_hu_conv;
653         }
654
655         /**
656          * Gets the current configuration applied to all new channels.
657          */
658         public get_current_default_configuration(): UserConfig {
659                 const ret: bigint = bindings.ChannelManager_get_current_default_configuration(this.ptr);
660                 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
661                 CommonBase.add_ref_from(ret_hu_conv, this);
662                 return ret_hu_conv;
663         }
664
665         /**
666          * Creates a new outbound channel to the given remote node and with the given value.
667          * 
668          * `user_channel_id` will be provided back as in
669          * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
670          * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
671          * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
672          * is simply copied to events and otherwise ignored.
673          * 
674          * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
675          * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
676          * 
677          * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
678          * generate a shutdown scriptpubkey or destination script set by
679          * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
680          * 
681          * Note that we do not check if you are currently connected to the given peer. If no
682          * connection is available, the outbound `open_channel` message may fail to send, resulting in
683          * the channel eventually being silently forgotten (dropped on reload).
684          * 
685          * Returns the new Channel's temporary `channel_id`. This ID will appear as
686          * [`Event::FundingGenerationReady::temporary_channel_id`] and in
687          * [`ChannelDetails::channel_id`] until after
688          * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
689          * one derived from the funding transaction's TXID. If the counterparty rejects the channel
690          * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
691          * 
692          * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
693          * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
694          * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
695          * 
696          * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
697          */
698         public create_channel(their_network_key: Uint8Array, channel_value_satoshis: bigint, push_msat: bigint, user_channel_id: bigint, override_config: UserConfig|null): Result_ThirtyTwoBytesAPIErrorZ {
699                 const ret: bigint = bindings.ChannelManager_create_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_network_key, 33)), channel_value_satoshis, push_msat, bindings.encodeUint128(user_channel_id), override_config == null ? 0n : CommonBase.get_ptr_of(override_config));
700                 const ret_hu_conv: Result_ThirtyTwoBytesAPIErrorZ = Result_ThirtyTwoBytesAPIErrorZ.constr_from_ptr(ret);
701                 CommonBase.add_ref_from(this, override_config);
702                 return ret_hu_conv;
703         }
704
705         /**
706          * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
707          * more information.
708          */
709         public list_channels(): ChannelDetails[] {
710                 const ret: number = bindings.ChannelManager_list_channels(this.ptr);
711                 const ret_conv_16_len: number = bindings.getArrayLength(ret);
712                 const ret_conv_16_arr: ChannelDetails[] = new Array(ret_conv_16_len).fill(null);
713                 for (var q = 0; q < ret_conv_16_len; q++) {
714                         const ret_conv_16: bigint = bindings.getU64ArrayElem(ret, q);
715                         const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
716                         CommonBase.add_ref_from(ret_conv_16_hu_conv, this);
717                         ret_conv_16_arr[q] = ret_conv_16_hu_conv;
718                 }
719                 bindings.freeWasmMemory(ret)
720                 return ret_conv_16_arr;
721         }
722
723         /**
724          * Gets the list of usable channels, in random order. Useful as an argument to
725          * [`Router::find_route`] to ensure non-announced channels are used.
726          * 
727          * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
728          * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
729          * are.
730          */
731         public list_usable_channels(): ChannelDetails[] {
732                 const ret: number = bindings.ChannelManager_list_usable_channels(this.ptr);
733                 const ret_conv_16_len: number = bindings.getArrayLength(ret);
734                 const ret_conv_16_arr: ChannelDetails[] = new Array(ret_conv_16_len).fill(null);
735                 for (var q = 0; q < ret_conv_16_len; q++) {
736                         const ret_conv_16: bigint = bindings.getU64ArrayElem(ret, q);
737                         const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
738                         CommonBase.add_ref_from(ret_conv_16_hu_conv, this);
739                         ret_conv_16_arr[q] = ret_conv_16_hu_conv;
740                 }
741                 bindings.freeWasmMemory(ret)
742                 return ret_conv_16_arr;
743         }
744
745         /**
746          * Gets the list of channels we have with a given counterparty, in random order.
747          */
748         public list_channels_with_counterparty(counterparty_node_id: Uint8Array): ChannelDetails[] {
749                 const ret: number = bindings.ChannelManager_list_channels_with_counterparty(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)));
750                 const ret_conv_16_len: number = bindings.getArrayLength(ret);
751                 const ret_conv_16_arr: ChannelDetails[] = new Array(ret_conv_16_len).fill(null);
752                 for (var q = 0; q < ret_conv_16_len; q++) {
753                         const ret_conv_16: bigint = bindings.getU64ArrayElem(ret, q);
754                         const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
755                         CommonBase.add_ref_from(ret_conv_16_hu_conv, this);
756                         ret_conv_16_arr[q] = ret_conv_16_hu_conv;
757                 }
758                 bindings.freeWasmMemory(ret)
759                 return ret_conv_16_arr;
760         }
761
762         /**
763          * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
764          * successful path, or have unresolved HTLCs.
765          * 
766          * This can be useful for payments that may have been prepared, but ultimately not sent, as a
767          * result of a crash. If such a payment exists, is not listed here, and an
768          * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
769          * 
770          * [`Event::PaymentSent`]: events::Event::PaymentSent
771          */
772         public list_recent_payments(): RecentPaymentDetails[] {
773                 const ret: number = bindings.ChannelManager_list_recent_payments(this.ptr);
774                 const ret_conv_22_len: number = bindings.getArrayLength(ret);
775                 const ret_conv_22_arr: RecentPaymentDetails[] = new Array(ret_conv_22_len).fill(null);
776                 for (var w = 0; w < ret_conv_22_len; w++) {
777                         const ret_conv_22: bigint = bindings.getU64ArrayElem(ret, w);
778                         const ret_conv_22_hu_conv: RecentPaymentDetails = RecentPaymentDetails.constr_from_ptr(ret_conv_22);
779                         CommonBase.add_ref_from(ret_conv_22_hu_conv, this);
780                         ret_conv_22_arr[w] = ret_conv_22_hu_conv;
781                 }
782                 bindings.freeWasmMemory(ret)
783                 return ret_conv_22_arr;
784         }
785
786         /**
787          * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
788          * will be accepted on the given channel, and after additional timeout/the closing of all
789          * pending HTLCs, the channel will be closed on chain.
790          * 
791          * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
792          * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
793          * fee estimate.
794          * If our counterparty is the channel initiator, we will require a channel closing
795          * transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
796          * would appear on a force-closure transaction, whichever is lower. We will allow our
797          * counterparty to pay as much fee as they'd like, however.
798          * 
799          * May generate a [`SendShutdown`] message event on success, which should be relayed.
800          * 
801          * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
802          * generate a shutdown scriptpubkey or destination script set by
803          * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
804          * channel.
805          * 
806          * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
807          * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
808          * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
809          * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
810          */
811         public close_channel(channel_id: Uint8Array, counterparty_node_id: Uint8Array): Result_NoneAPIErrorZ {
812                 const ret: bigint = bindings.ChannelManager_close_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)));
813                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
814                 return ret_hu_conv;
815         }
816
817         /**
818          * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
819          * will be accepted on the given channel, and after additional timeout/the closing of all
820          * pending HTLCs, the channel will be closed on chain.
821          * 
822          * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
823          * the channel being closed or not:
824          * If we are the channel initiator, we will pay at least this feerate on the closing
825          * transaction. The upper-bound is set by
826          * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
827          * fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
828          * If our counterparty is the channel initiator, we will refuse to accept a channel closure
829          * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
830          * will appear on a force-closure transaction, whichever is lower).
831          * 
832          * The `shutdown_script` provided  will be used as the `scriptPubKey` for the closing transaction.
833          * Will fail if a shutdown script has already been set for this channel by
834          * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
835          * also be compatible with our and the counterparty's features.
836          * 
837          * May generate a [`SendShutdown`] message event on success, which should be relayed.
838          * 
839          * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
840          * generate a shutdown scriptpubkey or destination script set by
841          * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
842          * channel.
843          * 
844          * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
845          * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
846          * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
847          * 
848          * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
849          */
850         public close_channel_with_feerate_and_script(channel_id: Uint8Array, counterparty_node_id: Uint8Array, target_feerate_sats_per_1000_weight: Option_u32Z, shutdown_script: ShutdownScript|null): Result_NoneAPIErrorZ {
851                 const ret: bigint = bindings.ChannelManager_close_channel_with_feerate_and_script(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), CommonBase.get_ptr_of(target_feerate_sats_per_1000_weight), shutdown_script == null ? 0n : CommonBase.get_ptr_of(shutdown_script));
852                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
853                 CommonBase.add_ref_from(this, target_feerate_sats_per_1000_weight);
854                 CommonBase.add_ref_from(this, shutdown_script);
855                 return ret_hu_conv;
856         }
857
858         /**
859          * Force closes a channel, immediately broadcasting the latest local transaction(s) and
860          * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
861          * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
862          * channel.
863          */
864         public force_close_broadcasting_latest_txn(channel_id: Uint8Array, counterparty_node_id: Uint8Array): Result_NoneAPIErrorZ {
865                 const ret: bigint = bindings.ChannelManager_force_close_broadcasting_latest_txn(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)));
866                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
867                 return ret_hu_conv;
868         }
869
870         /**
871          * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
872          * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
873          * `counterparty_node_id` isn't the counterparty of the corresponding channel.
874          * 
875          * You can always get the latest local transaction(s) to broadcast from
876          * [`ChannelMonitor::get_latest_holder_commitment_txn`].
877          */
878         public force_close_without_broadcasting_txn(channel_id: Uint8Array, counterparty_node_id: Uint8Array): Result_NoneAPIErrorZ {
879                 const ret: bigint = bindings.ChannelManager_force_close_without_broadcasting_txn(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)));
880                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
881                 return ret_hu_conv;
882         }
883
884         /**
885          * Force close all channels, immediately broadcasting the latest local commitment transaction
886          * for each to the chain and rejecting new HTLCs on each.
887          */
888         public force_close_all_channels_broadcasting_latest_txn(): void {
889                 bindings.ChannelManager_force_close_all_channels_broadcasting_latest_txn(this.ptr);
890         }
891
892         /**
893          * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
894          * local transaction(s).
895          */
896         public force_close_all_channels_without_broadcasting_txn(): void {
897                 bindings.ChannelManager_force_close_all_channels_without_broadcasting_txn(this.ptr);
898         }
899
900         /**
901          * Sends a payment along a given route.
902          * 
903          * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
904          * fields for more info.
905          * 
906          * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
907          * [`PeerManager::process_events`]).
908          * 
909          * # Avoiding Duplicate Payments
910          * 
911          * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
912          * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
913          * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
914          * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
915          * second payment with the same [`PaymentId`].
916          * 
917          * Thus, in order to ensure duplicate payments are not sent, you should implement your own
918          * tracking of payments, including state to indicate once a payment has completed. Because you
919          * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
920          * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
921          * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
922          * 
923          * Additionally, in the scenario where we begin the process of sending a payment, but crash
924          * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
925          * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
926          * [`ChannelManager::list_recent_payments`] for more information.
927          * 
928          * # Possible Error States on [`PaymentSendFailure`]
929          * 
930          * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
931          * each entry matching the corresponding-index entry in the route paths, see
932          * [`PaymentSendFailure`] for more info.
933          * 
934          * In general, a path may raise:
935          * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
936          * node public key) is specified.
937          * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
938          * closed, doesn't exist, or the peer is currently disconnected.
939          * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
940          * relevant updates.
941          * 
942          * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
943          * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
944          * different route unless you intend to pay twice!
945          * 
946          * [`RouteHop`]: crate::routing::router::RouteHop
947          * [`Event::PaymentSent`]: events::Event::PaymentSent
948          * [`Event::PaymentFailed`]: events::Event::PaymentFailed
949          * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
950          * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
951          * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
952          */
953         public send_payment_with_route(route: Route, payment_hash: Uint8Array, recipient_onion: RecipientOnionFields, payment_id: Uint8Array): Result_NonePaymentSendFailureZ {
954                 const ret: bigint = bindings.ChannelManager_send_payment_with_route(this.ptr, route == null ? 0n : CommonBase.get_ptr_of(route), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), recipient_onion == null ? 0n : CommonBase.get_ptr_of(recipient_onion), bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)));
955                 const ret_hu_conv: Result_NonePaymentSendFailureZ = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
956                 CommonBase.add_ref_from(this, route);
957                 CommonBase.add_ref_from(this, recipient_onion);
958                 return ret_hu_conv;
959         }
960
961         /**
962          * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
963          * `route_params` and retry failed payment paths based on `retry_strategy`.
964          */
965         public send_payment(payment_hash: Uint8Array, recipient_onion: RecipientOnionFields, payment_id: Uint8Array, route_params: RouteParameters, retry_strategy: Retry): Result_NoneRetryableSendFailureZ {
966                 const ret: bigint = bindings.ChannelManager_send_payment(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), recipient_onion == null ? 0n : CommonBase.get_ptr_of(recipient_onion), bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), route_params == null ? 0n : CommonBase.get_ptr_of(route_params), CommonBase.get_ptr_of(retry_strategy));
967                 const ret_hu_conv: Result_NoneRetryableSendFailureZ = Result_NoneRetryableSendFailureZ.constr_from_ptr(ret);
968                 CommonBase.add_ref_from(this, recipient_onion);
969                 CommonBase.add_ref_from(this, route_params);
970                 CommonBase.add_ref_from(this, retry_strategy);
971                 return ret_hu_conv;
972         }
973
974         /**
975          * Signals that no further attempts for the given payment should occur. Useful if you have a
976          * pending outbound payment with retries remaining, but wish to stop retrying the payment before
977          * retries are exhausted.
978          * 
979          * # Event Generation
980          * 
981          * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
982          * as there are no remaining pending HTLCs for this payment.
983          * 
984          * Note that calling this method does *not* prevent a payment from succeeding. You must still
985          * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
986          * determine the ultimate status of a payment.
987          * 
988          * # Requested Invoices
989          * 
990          * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
991          * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
992          * and prevent any attempts at paying it once received. The other events may only be generated
993          * once the invoice has been received.
994          * 
995          * # Restart Behavior
996          * 
997          * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
998          * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
999          * [`Event::InvoiceRequestFailed`].
1000          * 
1001          * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1002          */
1003         public abandon_payment(payment_id: Uint8Array): void {
1004                 bindings.ChannelManager_abandon_payment(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)));
1005         }
1006
1007         /**
1008          * Send a spontaneous payment, which is a payment that does not require the recipient to have
1009          * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
1010          * the preimage, it must be a cryptographically secure random value that no intermediate node
1011          * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
1012          * never reach the recipient.
1013          * 
1014          * See [`send_payment`] documentation for more details on the return value of this function
1015          * and idempotency guarantees provided by the [`PaymentId`] key.
1016          * 
1017          * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
1018          * [`send_payment`] for more information about the risks of duplicate preimage usage.
1019          * 
1020          * [`send_payment`]: Self::send_payment
1021          */
1022         public send_spontaneous_payment(route: Route, payment_preimage: Option_ThirtyTwoBytesZ, recipient_onion: RecipientOnionFields, payment_id: Uint8Array): Result_ThirtyTwoBytesPaymentSendFailureZ {
1023                 const ret: bigint = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0n : CommonBase.get_ptr_of(route), CommonBase.get_ptr_of(payment_preimage), recipient_onion == null ? 0n : CommonBase.get_ptr_of(recipient_onion), bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)));
1024                 const ret_hu_conv: Result_ThirtyTwoBytesPaymentSendFailureZ = Result_ThirtyTwoBytesPaymentSendFailureZ.constr_from_ptr(ret);
1025                 CommonBase.add_ref_from(this, route);
1026                 CommonBase.add_ref_from(this, payment_preimage);
1027                 CommonBase.add_ref_from(this, recipient_onion);
1028                 return ret_hu_conv;
1029         }
1030
1031         /**
1032          * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
1033          * based on `route_params` and retry failed payment paths based on `retry_strategy`.
1034          * 
1035          * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
1036          * payments.
1037          * 
1038          * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
1039          */
1040         public send_spontaneous_payment_with_retry(payment_preimage: Option_ThirtyTwoBytesZ, recipient_onion: RecipientOnionFields, payment_id: Uint8Array, route_params: RouteParameters, retry_strategy: Retry): Result_ThirtyTwoBytesRetryableSendFailureZ {
1041                 const ret: bigint = bindings.ChannelManager_send_spontaneous_payment_with_retry(this.ptr, CommonBase.get_ptr_of(payment_preimage), recipient_onion == null ? 0n : CommonBase.get_ptr_of(recipient_onion), bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), route_params == null ? 0n : CommonBase.get_ptr_of(route_params), CommonBase.get_ptr_of(retry_strategy));
1042                 const ret_hu_conv: Result_ThirtyTwoBytesRetryableSendFailureZ = Result_ThirtyTwoBytesRetryableSendFailureZ.constr_from_ptr(ret);
1043                 CommonBase.add_ref_from(this, payment_preimage);
1044                 CommonBase.add_ref_from(this, recipient_onion);
1045                 CommonBase.add_ref_from(this, route_params);
1046                 CommonBase.add_ref_from(this, retry_strategy);
1047                 return ret_hu_conv;
1048         }
1049
1050         /**
1051          * Send a payment that is probing the given route for liquidity. We calculate the
1052          * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
1053          * us to easily discern them from real payments.
1054          */
1055         public send_probe(path: Path): Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
1056                 const ret: bigint = bindings.ChannelManager_send_probe(this.ptr, path == null ? 0n : CommonBase.get_ptr_of(path));
1057                 const ret_hu_conv: Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret);
1058                 CommonBase.add_ref_from(this, path);
1059                 return ret_hu_conv;
1060         }
1061
1062         /**
1063          * Sends payment probes over all paths of a route that would be used to pay the given
1064          * amount to the given `node_id`.
1065          * 
1066          * See [`ChannelManager::send_preflight_probes`] for more information.
1067          */
1068         public send_spontaneous_preflight_probes(node_id: Uint8Array, amount_msat: bigint, final_cltv_expiry_delta: number, liquidity_limit_multiplier: Option_u64Z): Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
1069                 const ret: bigint = bindings.ChannelManager_send_spontaneous_preflight_probes(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), amount_msat, final_cltv_expiry_delta, CommonBase.get_ptr_of(liquidity_limit_multiplier));
1070                 const ret_hu_conv: Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret);
1071                 CommonBase.add_ref_from(this, liquidity_limit_multiplier);
1072                 return ret_hu_conv;
1073         }
1074
1075         /**
1076          * Sends payment probes over all paths of a route that would be used to pay a route found
1077          * according to the given [`RouteParameters`].
1078          * 
1079          * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
1080          * the actual payment. Note this is only useful if there likely is sufficient time for the
1081          * probe to settle before sending out the actual payment, e.g., when waiting for user
1082          * confirmation in a wallet UI.
1083          * 
1084          * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
1085          * actual payment. Users should therefore be cautious and might avoid sending probes if
1086          * liquidity is scarce and/or they don't expect the probe to return before they send the
1087          * payment. To mitigate this issue, channels with available liquidity less than the required
1088          * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
1089          * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
1090          */
1091         public send_preflight_probes(route_params: RouteParameters, liquidity_limit_multiplier: Option_u64Z): Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
1092                 const ret: bigint = bindings.ChannelManager_send_preflight_probes(this.ptr, route_params == null ? 0n : CommonBase.get_ptr_of(route_params), CommonBase.get_ptr_of(liquidity_limit_multiplier));
1093                 const ret_hu_conv: Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret);
1094                 CommonBase.add_ref_from(this, route_params);
1095                 CommonBase.add_ref_from(this, liquidity_limit_multiplier);
1096                 return ret_hu_conv;
1097         }
1098
1099         /**
1100          * Call this upon creation of a funding transaction for the given channel.
1101          * 
1102          * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
1103          * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
1104          * 
1105          * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
1106          * across the p2p network.
1107          * 
1108          * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
1109          * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
1110          * 
1111          * May panic if the output found in the funding transaction is duplicative with some other
1112          * channel (note that this should be trivially prevented by using unique funding transaction
1113          * keys per-channel).
1114          * 
1115          * Do NOT broadcast the funding transaction yourself. When we have safely received our
1116          * counterparty's signature the funding transaction will automatically be broadcast via the
1117          * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
1118          * 
1119          * Note that this includes RBF or similar transaction replacement strategies - lightning does
1120          * not currently support replacing a funding transaction on an existing channel. Instead,
1121          * create a new channel with a conflicting funding transaction.
1122          * 
1123          * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
1124          * the wallet software generating the funding transaction to apply anti-fee sniping as
1125          * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
1126          * for more details.
1127          * 
1128          * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
1129          * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
1130          */
1131         public funding_transaction_generated(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, funding_transaction: Uint8Array): Result_NoneAPIErrorZ {
1132                 const ret: bigint = bindings.ChannelManager_funding_transaction_generated(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), bindings.encodeUint8Array(funding_transaction));
1133                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
1134                 return ret_hu_conv;
1135         }
1136
1137         /**
1138          * Call this upon creation of a batch funding transaction for the given channels.
1139          * 
1140          * Return values are identical to [`Self::funding_transaction_generated`], respective to
1141          * each individual channel and transaction output.
1142          * 
1143          * Do NOT broadcast the funding transaction yourself. This batch funding transcaction
1144          * will only be broadcast when we have safely received and persisted the counterparty's
1145          * signature for each channel.
1146          * 
1147          * If there is an error, all channels in the batch are to be considered closed.
1148          */
1149         public batch_funding_transaction_generated(temporary_channels: TwoTuple_ThirtyTwoBytesPublicKeyZ[], funding_transaction: Uint8Array): Result_NoneAPIErrorZ {
1150                 const ret: bigint = bindings.ChannelManager_batch_funding_transaction_generated(this.ptr, bindings.encodeUint64Array(temporary_channels.map(temporary_channels_conv_35 => temporary_channels_conv_35 != null ? CommonBase.get_ptr_of(temporary_channels_conv_35) : 0n)), bindings.encodeUint8Array(funding_transaction));
1151                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
1152                 return ret_hu_conv;
1153         }
1154
1155         /**
1156          * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
1157          * 
1158          * Once the updates are applied, each eligible channel (advertised with a known short channel
1159          * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
1160          * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
1161          * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
1162          * 
1163          * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
1164          * `counterparty_node_id` is provided.
1165          * 
1166          * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
1167          * below [`MIN_CLTV_EXPIRY_DELTA`].
1168          * 
1169          * If an error is returned, none of the updates should be considered applied.
1170          * 
1171          * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
1172          * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
1173          * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
1174          * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
1175          * [`ChannelUpdate`]: msgs::ChannelUpdate
1176          * [`ChannelUnavailable`]: APIError::ChannelUnavailable
1177          * [`APIMisuseError`]: APIError::APIMisuseError
1178          */
1179         public update_partial_channel_config(counterparty_node_id: Uint8Array, channel_ids: Uint8Array[], config_update: ChannelConfigUpdate): Result_NoneAPIErrorZ {
1180                 const ret: bigint = bindings.ChannelManager_update_partial_channel_config(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), bindings.encodeUint32Array(channel_ids.map(channel_ids_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(channel_ids_conv_12, 32)))), config_update == null ? 0n : CommonBase.get_ptr_of(config_update));
1181                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
1182                 CommonBase.add_ref_from(this, config_update);
1183                 return ret_hu_conv;
1184         }
1185
1186         /**
1187          * Atomically updates the [`ChannelConfig`] for the given channels.
1188          * 
1189          * Once the updates are applied, each eligible channel (advertised with a known short channel
1190          * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
1191          * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
1192          * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
1193          * 
1194          * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
1195          * `counterparty_node_id` is provided.
1196          * 
1197          * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
1198          * below [`MIN_CLTV_EXPIRY_DELTA`].
1199          * 
1200          * If an error is returned, none of the updates should be considered applied.
1201          * 
1202          * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
1203          * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
1204          * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
1205          * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
1206          * [`ChannelUpdate`]: msgs::ChannelUpdate
1207          * [`ChannelUnavailable`]: APIError::ChannelUnavailable
1208          * [`APIMisuseError`]: APIError::APIMisuseError
1209          */
1210         public update_channel_config(counterparty_node_id: Uint8Array, channel_ids: Uint8Array[], config: ChannelConfig): Result_NoneAPIErrorZ {
1211                 const ret: bigint = bindings.ChannelManager_update_channel_config(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), bindings.encodeUint32Array(channel_ids.map(channel_ids_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(channel_ids_conv_12, 32)))), config == null ? 0n : CommonBase.get_ptr_of(config));
1212                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
1213                 CommonBase.add_ref_from(this, config);
1214                 return ret_hu_conv;
1215         }
1216
1217         /**
1218          * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
1219          * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
1220          * 
1221          * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
1222          * channel to a receiving node if the node lacks sufficient inbound liquidity.
1223          * 
1224          * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
1225          * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
1226          * receiver's invoice route hints. These route hints will signal to LDK to generate an
1227          * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
1228          * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
1229          * 
1230          * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
1231          * you from forwarding more than you received. See
1232          * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
1233          * than expected.
1234          * 
1235          * Errors if the event was not handled in time, in which case the HTLC was automatically failed
1236          * backwards.
1237          * 
1238          * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
1239          * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
1240          * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
1241          */
1242         public forward_intercepted_htlc(intercept_id: Uint8Array, next_hop_channel_id: Uint8Array, next_node_id: Uint8Array, amt_to_forward_msat: bigint): Result_NoneAPIErrorZ {
1243                 const ret: bigint = bindings.ChannelManager_forward_intercepted_htlc(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(intercept_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(next_hop_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(next_node_id, 33)), amt_to_forward_msat);
1244                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
1245                 return ret_hu_conv;
1246         }
1247
1248         /**
1249          * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
1250          * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
1251          * 
1252          * Errors if the event was not handled in time, in which case the HTLC was automatically failed
1253          * backwards.
1254          * 
1255          * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
1256          */
1257         public fail_intercepted_htlc(intercept_id: Uint8Array): Result_NoneAPIErrorZ {
1258                 const ret: bigint = bindings.ChannelManager_fail_intercepted_htlc(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(intercept_id, 32)));
1259                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
1260                 return ret_hu_conv;
1261         }
1262
1263         /**
1264          * Processes HTLCs which are pending waiting on random forward delay.
1265          * 
1266          * Should only really ever be called in response to a PendingHTLCsForwardable event.
1267          * Will likely generate further events.
1268          */
1269         public process_pending_htlc_forwards(): void {
1270                 bindings.ChannelManager_process_pending_htlc_forwards(this.ptr);
1271         }
1272
1273         /**
1274          * Performs actions which should happen on startup and roughly once per minute thereafter.
1275          * 
1276          * This currently includes:
1277          * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
1278          * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
1279          * than a minute, informing the network that they should no longer attempt to route over
1280          * the channel.
1281          * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
1282          * with the current [`ChannelConfig`].
1283          * Removing peers which have disconnected but and no longer have any channels.
1284          * Force-closing and removing channels which have not completed establishment in a timely manner.
1285          * Forgetting about stale outbound payments, either those that have already been fulfilled
1286          * or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
1287          * The latter is determined using the system clock in `std` and the highest seen block time
1288          * minus two hours in `no-std`.
1289          * 
1290          * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
1291          * estimate fetches.
1292          * 
1293          * [`ChannelUpdate`]: msgs::ChannelUpdate
1294          * [`ChannelConfig`]: crate::util::config::ChannelConfig
1295          */
1296         public timer_tick_occurred(): void {
1297                 bindings.ChannelManager_timer_tick_occurred(this.ptr);
1298         }
1299
1300         /**
1301          * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
1302          * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
1303          * along the path (including in our own channel on which we received it).
1304          * 
1305          * Note that in some cases around unclean shutdown, it is possible the payment may have
1306          * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
1307          * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
1308          * may have already been failed automatically by LDK if it was nearing its expiration time.
1309          * 
1310          * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
1311          * [`ChannelManager::claim_funds`]), you should still monitor for
1312          * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
1313          * startup during which time claims that were in-progress at shutdown may be replayed.
1314          */
1315         public fail_htlc_backwards(payment_hash: Uint8Array): void {
1316                 bindings.ChannelManager_fail_htlc_backwards(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)));
1317         }
1318
1319         /**
1320          * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
1321          * reason for the failure.
1322          * 
1323          * See [`FailureCode`] for valid failure codes.
1324          */
1325         public fail_htlc_backwards_with_reason(payment_hash: Uint8Array, failure_code: FailureCode): void {
1326                 bindings.ChannelManager_fail_htlc_backwards_with_reason(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(failure_code));
1327                 CommonBase.add_ref_from(this, failure_code);
1328         }
1329
1330         /**
1331          * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
1332          * [`MessageSendEvent`]s needed to claim the payment.
1333          * 
1334          * This method is guaranteed to ensure the payment has been claimed but only if the current
1335          * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
1336          * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
1337          * successful. It will generally be available in the next [`process_pending_events`] call.
1338          * 
1339          * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
1340          * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
1341          * event matches your expectation. If you fail to do so and call this method, you may provide
1342          * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
1343          * 
1344          * This function will fail the payment if it has custom TLVs with even type numbers, as we
1345          * will assume they are unknown. If you intend to accept even custom TLVs, you should use
1346          * [`claim_funds_with_known_custom_tlvs`].
1347          * 
1348          * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
1349          * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
1350          * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
1351          * [`process_pending_events`]: EventsProvider::process_pending_events
1352          * [`create_inbound_payment`]: Self::create_inbound_payment
1353          * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
1354          * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
1355          */
1356         public claim_funds(payment_preimage: Uint8Array): void {
1357                 bindings.ChannelManager_claim_funds(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32)));
1358         }
1359
1360         /**
1361          * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
1362          * even type numbers.
1363          * 
1364          * # Note
1365          * 
1366          * You MUST check you've understood all even TLVs before using this to
1367          * claim, otherwise you may unintentionally agree to some protocol you do not understand.
1368          * 
1369          * [`claim_funds`]: Self::claim_funds
1370          */
1371         public claim_funds_with_known_custom_tlvs(payment_preimage: Uint8Array): void {
1372                 bindings.ChannelManager_claim_funds_with_known_custom_tlvs(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32)));
1373         }
1374
1375         /**
1376          * Gets the node_id held by this ChannelManager
1377          */
1378         public get_our_node_id(): Uint8Array {
1379                 const ret: number = bindings.ChannelManager_get_our_node_id(this.ptr);
1380                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
1381                 return ret_conv;
1382         }
1383
1384         /**
1385          * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
1386          * 
1387          * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
1388          * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
1389          * the channel.
1390          * 
1391          * The `user_channel_id` parameter will be provided back in
1392          * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
1393          * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
1394          * 
1395          * Note that this method will return an error and reject the channel, if it requires support
1396          * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
1397          * used to accept such channels.
1398          * 
1399          * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
1400          * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
1401          */
1402         public accept_inbound_channel(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, user_channel_id: bigint): Result_NoneAPIErrorZ {
1403                 const ret: bigint = bindings.ChannelManager_accept_inbound_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), bindings.encodeUint128(user_channel_id));
1404                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
1405                 return ret_hu_conv;
1406         }
1407
1408         /**
1409          * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
1410          * it as confirmed immediately.
1411          * 
1412          * The `user_channel_id` parameter will be provided back in
1413          * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
1414          * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
1415          * 
1416          * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
1417          * and (if the counterparty agrees), enables forwarding of payments immediately.
1418          * 
1419          * This fully trusts that the counterparty has honestly and correctly constructed the funding
1420          * transaction and blindly assumes that it will eventually confirm.
1421          * 
1422          * If it does not confirm before we decide to close the channel, or if the funding transaction
1423          * does not pay to the correct script the correct amount, *you will lose funds*.
1424          * 
1425          * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
1426          * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
1427          */
1428         public accept_inbound_channel_from_trusted_peer_0conf(temporary_channel_id: Uint8Array, counterparty_node_id: Uint8Array, user_channel_id: bigint): Result_NoneAPIErrorZ {
1429                 const ret: bigint = bindings.ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)), bindings.encodeUint128(user_channel_id));
1430                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
1431                 return ret_hu_conv;
1432         }
1433
1434         /**
1435          * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
1436          * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
1437          * [`Bolt12Invoice`] once it is received.
1438          * 
1439          * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
1440          * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
1441          * The optional parameters are used in the builder, if `Some`:
1442          * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
1443          * [`Offer::expects_quantity`] is `true`.
1444          * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
1445          * - `payer_note` for [`InvoiceRequest::payer_note`].
1446          * 
1447          * If `max_total_routing_fee_msat` is not specified, The default from
1448          * [`RouteParameters::from_payment_params_and_value`] is applied.
1449          * 
1450          * # Payment
1451          * 
1452          * The provided `payment_id` is used to ensure that only one invoice is paid for the request
1453          * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
1454          * been sent.
1455          * 
1456          * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
1457          * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
1458          * payment will fail with an [`Event::InvoiceRequestFailed`].
1459          * 
1460          * # Privacy
1461          * 
1462          * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
1463          * as the introduction node and a derived payer id for payer privacy. As such, currently, the
1464          * node must be announced. Otherwise, there is no way to find a path to the introduction node
1465          * in order to send the [`Bolt12Invoice`].
1466          * 
1467          * # Limitations
1468          * 
1469          * Requires a direct connection to an introduction node in [`Offer::paths`] or to
1470          * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
1471          * [`Bolt12Invoice::payment_paths`].
1472          * 
1473          * # Errors
1474          * 
1475          * Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link
1476          * or if the provided parameters are invalid for the offer.
1477          * 
1478          * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
1479          * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
1480          * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
1481          * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
1482          * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1483          * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
1484          * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
1485          */
1486         public pay_for_offer(offer: Offer, quantity: Option_u64Z, amount_msats: Option_u64Z, payer_note: Option_StrZ, payment_id: Uint8Array, retry_strategy: Retry, max_total_routing_fee_msat: Option_u64Z): Result_NoneBolt12SemanticErrorZ {
1487                 const ret: bigint = bindings.ChannelManager_pay_for_offer(this.ptr, offer == null ? 0n : CommonBase.get_ptr_of(offer), CommonBase.get_ptr_of(quantity), CommonBase.get_ptr_of(amount_msats), CommonBase.get_ptr_of(payer_note), bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), CommonBase.get_ptr_of(retry_strategy), CommonBase.get_ptr_of(max_total_routing_fee_msat));
1488                 const ret_hu_conv: Result_NoneBolt12SemanticErrorZ = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret);
1489                 CommonBase.add_ref_from(this, offer);
1490                 CommonBase.add_ref_from(this, quantity);
1491                 CommonBase.add_ref_from(this, amount_msats);
1492                 CommonBase.add_ref_from(this, payer_note);
1493                 CommonBase.add_ref_from(this, retry_strategy);
1494                 CommonBase.add_ref_from(this, max_total_routing_fee_msat);
1495                 return ret_hu_conv;
1496         }
1497
1498         /**
1499          * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
1500          * message.
1501          * 
1502          * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
1503          * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
1504          * [`PaymentPreimage`].
1505          * 
1506          * # Limitations
1507          * 
1508          * Requires a direct connection to an introduction node in [`Refund::paths`] or to
1509          * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
1510          * node meeting the aforementioned criteria, but there's no guarantee that they will be
1511          * received and no retries will be made.
1512          * 
1513          * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1514          */
1515         public request_refund_payment(refund: Refund): Result_NoneBolt12SemanticErrorZ {
1516                 const ret: bigint = bindings.ChannelManager_request_refund_payment(this.ptr, refund == null ? 0n : CommonBase.get_ptr_of(refund));
1517                 const ret_hu_conv: Result_NoneBolt12SemanticErrorZ = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret);
1518                 CommonBase.add_ref_from(this, refund);
1519                 return ret_hu_conv;
1520         }
1521
1522         /**
1523          * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
1524          * to pay us.
1525          * 
1526          * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
1527          * [`PaymentHash`] and [`PaymentPreimage`] for you.
1528          * 
1529          * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
1530          * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
1531          * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
1532          * passed directly to [`claim_funds`].
1533          * 
1534          * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
1535          * 
1536          * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
1537          * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
1538          * 
1539          * # Note
1540          * 
1541          * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
1542          * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
1543          * 
1544          * Errors if `min_value_msat` is greater than total bitcoin supply.
1545          * 
1546          * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
1547          * on versions of LDK prior to 0.0.114.
1548          * 
1549          * [`claim_funds`]: Self::claim_funds
1550          * [`PaymentClaimable`]: events::Event::PaymentClaimable
1551          * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
1552          * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
1553          * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
1554          * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
1555          */
1556         public create_inbound_payment(min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number, min_final_cltv_expiry_delta: Option_u16Z): Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
1557                 const ret: bigint = bindings.ChannelManager_create_inbound_payment(this.ptr, CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs, CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
1558                 const ret_hu_conv: Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.constr_from_ptr(ret);
1559                 CommonBase.add_ref_from(this, min_value_msat);
1560                 CommonBase.add_ref_from(this, min_final_cltv_expiry_delta);
1561                 return ret_hu_conv;
1562         }
1563
1564         /**
1565          * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
1566          * stored external to LDK.
1567          * 
1568          * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
1569          * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
1570          * the `min_value_msat` provided here, if one is provided.
1571          * 
1572          * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
1573          * note that LDK will not stop you from registering duplicate payment hashes for inbound
1574          * payments.
1575          * 
1576          * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
1577          * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
1578          * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
1579          * sender \"proof-of-payment\" unless they have paid the required amount.
1580          * 
1581          * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
1582          * in excess of the current time. This should roughly match the expiry time set in the invoice.
1583          * After this many seconds, we will remove the inbound payment, resulting in any attempts to
1584          * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
1585          * invoices when no timeout is set.
1586          * 
1587          * Note that we use block header time to time-out pending inbound payments (with some margin
1588          * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
1589          * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
1590          * If you need exact expiry semantics, you should enforce them upon receipt of
1591          * [`PaymentClaimable`].
1592          * 
1593          * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
1594          * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
1595          * 
1596          * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
1597          * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
1598          * 
1599          * # Note
1600          * 
1601          * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
1602          * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
1603          * 
1604          * Errors if `min_value_msat` is greater than total bitcoin supply.
1605          * 
1606          * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
1607          * on versions of LDK prior to 0.0.114.
1608          * 
1609          * [`create_inbound_payment`]: Self::create_inbound_payment
1610          * [`PaymentClaimable`]: events::Event::PaymentClaimable
1611          */
1612         public create_inbound_payment_for_hash(payment_hash: Uint8Array, min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number, min_final_cltv_expiry: Option_u16Z): Result_ThirtyTwoBytesNoneZ {
1613                 const ret: bigint = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs, CommonBase.get_ptr_of(min_final_cltv_expiry));
1614                 const ret_hu_conv: Result_ThirtyTwoBytesNoneZ = Result_ThirtyTwoBytesNoneZ.constr_from_ptr(ret);
1615                 CommonBase.add_ref_from(this, min_value_msat);
1616                 CommonBase.add_ref_from(this, min_final_cltv_expiry);
1617                 return ret_hu_conv;
1618         }
1619
1620         /**
1621          * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
1622          * previously returned from [`create_inbound_payment`].
1623          * 
1624          * [`create_inbound_payment`]: Self::create_inbound_payment
1625          */
1626         public get_payment_preimage(payment_hash: Uint8Array, payment_secret: Uint8Array): Result_ThirtyTwoBytesAPIErrorZ {
1627                 const ret: bigint = bindings.ChannelManager_get_payment_preimage(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_secret, 32)));
1628                 const ret_hu_conv: Result_ThirtyTwoBytesAPIErrorZ = Result_ThirtyTwoBytesAPIErrorZ.constr_from_ptr(ret);
1629                 return ret_hu_conv;
1630         }
1631
1632         /**
1633          * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
1634          * are used when constructing the phantom invoice's route hints.
1635          * 
1636          * [phantom node payments]: crate::sign::PhantomKeysManager
1637          */
1638         public get_phantom_scid(): bigint {
1639                 const ret: bigint = bindings.ChannelManager_get_phantom_scid(this.ptr);
1640                 return ret;
1641         }
1642
1643         /**
1644          * Gets route hints for use in receiving [phantom node payments].
1645          * 
1646          * [phantom node payments]: crate::sign::PhantomKeysManager
1647          */
1648         public get_phantom_route_hints(): PhantomRouteHints {
1649                 const ret: bigint = bindings.ChannelManager_get_phantom_route_hints(this.ptr);
1650                 const ret_hu_conv: PhantomRouteHints = new PhantomRouteHints(null, ret);
1651                 CommonBase.add_ref_from(ret_hu_conv, this);
1652                 return ret_hu_conv;
1653         }
1654
1655         /**
1656          * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
1657          * used when constructing the route hints for HTLCs intended to be intercepted. See
1658          * [`ChannelManager::forward_intercepted_htlc`].
1659          * 
1660          * Note that this method is not guaranteed to return unique values, you may need to call it a few
1661          * times to get a unique scid.
1662          */
1663         public get_intercept_scid(): bigint {
1664                 const ret: bigint = bindings.ChannelManager_get_intercept_scid(this.ptr);
1665                 return ret;
1666         }
1667
1668         /**
1669          * Gets inflight HTLC information by processing pending outbound payments that are in
1670          * our channels. May be used during pathfinding to account for in-use channel liquidity.
1671          */
1672         public compute_inflight_htlcs(): InFlightHtlcs {
1673                 const ret: bigint = bindings.ChannelManager_compute_inflight_htlcs(this.ptr);
1674                 const ret_hu_conv: InFlightHtlcs = new InFlightHtlcs(null, ret);
1675                 CommonBase.add_ref_from(ret_hu_conv, this);
1676                 return ret_hu_conv;
1677         }
1678
1679         /**
1680          * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
1681          * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
1682          */
1683         public as_MessageSendEventsProvider(): MessageSendEventsProvider {
1684                 const ret: bigint = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr);
1685                 const ret_hu_conv: MessageSendEventsProvider = new MessageSendEventsProvider(null, ret);
1686                 CommonBase.add_ref_from(ret_hu_conv, this);
1687                 return ret_hu_conv;
1688         }
1689
1690         /**
1691          * Constructs a new EventsProvider which calls the relevant methods on this_arg.
1692          * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
1693          */
1694         public as_EventsProvider(): EventsProvider {
1695                 const ret: bigint = bindings.ChannelManager_as_EventsProvider(this.ptr);
1696                 const ret_hu_conv: EventsProvider = new EventsProvider(null, ret);
1697                 CommonBase.add_ref_from(ret_hu_conv, this);
1698                 return ret_hu_conv;
1699         }
1700
1701         /**
1702          * Constructs a new Listen which calls the relevant methods on this_arg.
1703          * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
1704          */
1705         public as_Listen(): Listen {
1706                 const ret: bigint = bindings.ChannelManager_as_Listen(this.ptr);
1707                 const ret_hu_conv: Listen = new Listen(null, ret);
1708                 CommonBase.add_ref_from(ret_hu_conv, this);
1709                 return ret_hu_conv;
1710         }
1711
1712         /**
1713          * Constructs a new Confirm which calls the relevant methods on this_arg.
1714          * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
1715          */
1716         public as_Confirm(): Confirm {
1717                 const ret: bigint = bindings.ChannelManager_as_Confirm(this.ptr);
1718                 const ret_hu_conv: Confirm = new Confirm(null, ret);
1719                 CommonBase.add_ref_from(ret_hu_conv, this);
1720                 return ret_hu_conv;
1721         }
1722
1723         /**
1724          * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
1725          * may have events that need processing.
1726          * 
1727          * In order to check if this [`ChannelManager`] needs persisting, call
1728          * [`Self::get_and_clear_needs_persistence`].
1729          * 
1730          * Note that callbacks registered on the [`Future`] MUST NOT call back into this
1731          * [`ChannelManager`] and should instead register actions to be taken later.
1732          */
1733         public get_event_or_persistence_needed_future(): Future {
1734                 const ret: bigint = bindings.ChannelManager_get_event_or_persistence_needed_future(this.ptr);
1735                 const ret_hu_conv: Future = new Future(null, ret);
1736                 CommonBase.add_ref_from(ret_hu_conv, this);
1737                 return ret_hu_conv;
1738         }
1739
1740         /**
1741          * Returns true if this [`ChannelManager`] needs to be persisted.
1742          */
1743         public get_and_clear_needs_persistence(): boolean {
1744                 const ret: boolean = bindings.ChannelManager_get_and_clear_needs_persistence(this.ptr);
1745                 return ret;
1746         }
1747
1748         /**
1749          * Gets the latest best block which was connected either via the [`chain::Listen`] or
1750          * [`chain::Confirm`] interfaces.
1751          */
1752         public current_best_block(): BestBlock {
1753                 const ret: bigint = bindings.ChannelManager_current_best_block(this.ptr);
1754                 const ret_hu_conv: BestBlock = new BestBlock(null, ret);
1755                 CommonBase.add_ref_from(ret_hu_conv, this);
1756                 return ret_hu_conv;
1757         }
1758
1759         /**
1760          * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
1761          * [`ChannelManager`].
1762          */
1763         public node_features(): NodeFeatures {
1764                 const ret: bigint = bindings.ChannelManager_node_features(this.ptr);
1765                 const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret);
1766                 CommonBase.add_ref_from(ret_hu_conv, this);
1767                 return ret_hu_conv;
1768         }
1769
1770         /**
1771          * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
1772          * [`ChannelManager`].
1773          */
1774         public channel_features(): ChannelFeatures {
1775                 const ret: bigint = bindings.ChannelManager_channel_features(this.ptr);
1776                 const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret);
1777                 CommonBase.add_ref_from(ret_hu_conv, this);
1778                 return ret_hu_conv;
1779         }
1780
1781         /**
1782          * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
1783          * [`ChannelManager`].
1784          */
1785         public channel_type_features(): ChannelTypeFeatures {
1786                 const ret: bigint = bindings.ChannelManager_channel_type_features(this.ptr);
1787                 const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret);
1788                 CommonBase.add_ref_from(ret_hu_conv, this);
1789                 return ret_hu_conv;
1790         }
1791
1792         /**
1793          * Fetches the set of [`InitFeatures`] flags that are provided by or required by
1794          * [`ChannelManager`].
1795          */
1796         public init_features(): InitFeatures {
1797                 const ret: bigint = bindings.ChannelManager_init_features(this.ptr);
1798                 const ret_hu_conv: InitFeatures = new InitFeatures(null, ret);
1799                 CommonBase.add_ref_from(ret_hu_conv, this);
1800                 return ret_hu_conv;
1801         }
1802
1803         /**
1804          * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
1805          * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
1806          */
1807         public as_ChannelMessageHandler(): ChannelMessageHandler {
1808                 const ret: bigint = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr);
1809                 const ret_hu_conv: ChannelMessageHandler = new ChannelMessageHandler(null, ret);
1810                 CommonBase.add_ref_from(ret_hu_conv, this);
1811                 return ret_hu_conv;
1812         }
1813
1814         /**
1815          * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
1816          * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
1817          */
1818         public as_OffersMessageHandler(): OffersMessageHandler {
1819                 const ret: bigint = bindings.ChannelManager_as_OffersMessageHandler(this.ptr);
1820                 const ret_hu_conv: OffersMessageHandler = new OffersMessageHandler(null, ret);
1821                 CommonBase.add_ref_from(ret_hu_conv, this);
1822                 return ret_hu_conv;
1823         }
1824
1825         /**
1826          * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
1827          */
1828         public write(): Uint8Array {
1829                 const ret: number = bindings.ChannelManager_write(this.ptr);
1830                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
1831                 return ret_conv;
1832         }
1833
1834 }