[TS] Update auto-generated bindings for 0.0.105.0
[ldk-java] / ts / structs / ChannelManager.mts
1 import { TxOut } from '../structs/TxOut.mjs';
2 import { AccessError } from '../enums/AccessError.mjs';
3 import { COption_NoneZ } from '../enums/COption_NoneZ.mjs';
4 import { ChannelMonitorUpdateErr } from '../enums/ChannelMonitorUpdateErr.mjs';
5 import { ConfirmationTarget } from '../enums/ConfirmationTarget.mjs';
6 import { CreationError } from '../enums/CreationError.mjs';
7 import { Currency } from '../enums/Currency.mjs';
8 import { Level } from '../enums/Level.mjs';
9 import { Network } from '../enums/Network.mjs';
10 import { Recipient } from '../enums/Recipient.mjs';
11 import { Secp256k1Error } from '../enums/Secp256k1Error.mjs';
12 import { SemanticError } from '../enums/SemanticError.mjs';
13 import { SiPrefix } from '../enums/SiPrefix.mjs';
14 import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs';
15 import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs';
16 import { DecodeError } from '../structs/DecodeError.mjs';
17 import { Result_CounterpartyCommitmentSecretsDecodeErrorZ } from '../structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.mjs';
18 import { Result_SecretKeyErrorZ } from '../structs/Result_SecretKeyErrorZ.mjs';
19 import { Result_PublicKeyErrorZ } from '../structs/Result_PublicKeyErrorZ.mjs';
20 import { TxCreationKeys } from '../structs/TxCreationKeys.mjs';
21 import { Result_TxCreationKeysDecodeErrorZ } from '../structs/Result_TxCreationKeysDecodeErrorZ.mjs';
22 import { ChannelPublicKeys } from '../structs/ChannelPublicKeys.mjs';
23 import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelPublicKeysDecodeErrorZ.mjs';
24 import { Result_TxCreationKeysErrorZ } from '../structs/Result_TxCreationKeysErrorZ.mjs';
25 import { Option_u32Z } from '../structs/Option_u32Z.mjs';
26 import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs';
27 import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs';
28 import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs';
29 import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs';
30 import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs';
31 import { Result_ChannelTransactionParametersDecodeErrorZ } from '../structs/Result_ChannelTransactionParametersDecodeErrorZ.mjs';
32 import { HolderCommitmentTransaction } from '../structs/HolderCommitmentTransaction.mjs';
33 import { Result_HolderCommitmentTransactionDecodeErrorZ } from '../structs/Result_HolderCommitmentTransactionDecodeErrorZ.mjs';
34 import { BuiltCommitmentTransaction } from '../structs/BuiltCommitmentTransaction.mjs';
35 import { Result_BuiltCommitmentTransactionDecodeErrorZ } from '../structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mjs';
36 import { TrustedClosingTransaction } from '../structs/TrustedClosingTransaction.mjs';
37 import { Result_TrustedClosingTransactionNoneZ } from '../structs/Result_TrustedClosingTransactionNoneZ.mjs';
38 import { CommitmentTransaction } from '../structs/CommitmentTransaction.mjs';
39 import { Result_CommitmentTransactionDecodeErrorZ } from '../structs/Result_CommitmentTransactionDecodeErrorZ.mjs';
40 import { TrustedCommitmentTransaction } from '../structs/TrustedCommitmentTransaction.mjs';
41 import { Result_TrustedCommitmentTransactionNoneZ } from '../structs/Result_TrustedCommitmentTransactionNoneZ.mjs';
42 import { Result_CVec_SignatureZNoneZ } from '../structs/Result_CVec_SignatureZNoneZ.mjs';
43 import { ShutdownScript } from '../structs/ShutdownScript.mjs';
44 import { Result_ShutdownScriptDecodeErrorZ } from '../structs/Result_ShutdownScriptDecodeErrorZ.mjs';
45 import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs';
46 import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs';
47 import { RouteHop } from '../structs/RouteHop.mjs';
48 import { Result_RouteHopDecodeErrorZ } from '../structs/Result_RouteHopDecodeErrorZ.mjs';
49 import { Route } from '../structs/Route.mjs';
50 import { Result_RouteDecodeErrorZ } from '../structs/Result_RouteDecodeErrorZ.mjs';
51 import { RouteParameters } from '../structs/RouteParameters.mjs';
52 import { Result_RouteParametersDecodeErrorZ } from '../structs/Result_RouteParametersDecodeErrorZ.mjs';
53 import { RouteHint } from '../structs/RouteHint.mjs';
54 import { Option_u64Z } from '../structs/Option_u64Z.mjs';
55 import { PaymentParameters } from '../structs/PaymentParameters.mjs';
56 import { Result_PaymentParametersDecodeErrorZ } from '../structs/Result_PaymentParametersDecodeErrorZ.mjs';
57 import { RouteHintHop } from '../structs/RouteHintHop.mjs';
58 import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs';
59 import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs';
60 import { ChannelDetails } from '../structs/ChannelDetails.mjs';
61 import { LightningError } from '../structs/LightningError.mjs';
62 import { Result_RouteLightningErrorZ } from '../structs/Result_RouteLightningErrorZ.mjs';
63 import { Result_TxOutAccessErrorZ } from '../structs/Result_TxOutAccessErrorZ.mjs';
64 import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs';
65 import { Result_NoneChannelMonitorUpdateErrZ } from '../structs/Result_NoneChannelMonitorUpdateErrZ.mjs';
66 import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
67 import { OutPoint } from '../structs/OutPoint.mjs';
68 import { MonitorEvent } from '../structs/MonitorEvent.mjs';
69 import { Option_C2Tuple_usizeTransactionZZ } from '../structs/Option_C2Tuple_usizeTransactionZZ.mjs';
70 import { ClosureReason } from '../structs/ClosureReason.mjs';
71 import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
72 import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
73 import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
74 import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
75 import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
76 import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs';
77 import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs';
78 import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs';
79 import { PaymentPurpose } from '../structs/PaymentPurpose.mjs';
80 import { Event } from '../structs/Event.mjs';
81 import { Option_EventZ } from '../structs/Option_EventZ.mjs';
82 import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs';
83 import { AcceptChannel } from '../structs/AcceptChannel.mjs';
84 import { OpenChannel } from '../structs/OpenChannel.mjs';
85 import { FundingCreated } from '../structs/FundingCreated.mjs';
86 import { FundingSigned } from '../structs/FundingSigned.mjs';
87 import { FundingLocked } from '../structs/FundingLocked.mjs';
88 import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs';
89 import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs';
90 import { RevokeAndACK } from '../structs/RevokeAndACK.mjs';
91 import { ClosingSigned } from '../structs/ClosingSigned.mjs';
92 import { Shutdown } from '../structs/Shutdown.mjs';
93 import { ChannelReestablish } from '../structs/ChannelReestablish.mjs';
94 import { ChannelAnnouncement } from '../structs/ChannelAnnouncement.mjs';
95 import { NodeAnnouncement } from '../structs/NodeAnnouncement.mjs';
96 import { ErrorMessage } from '../structs/ErrorMessage.mjs';
97 import { WarningMessage } from '../structs/WarningMessage.mjs';
98 import { ErrorAction } from '../structs/ErrorAction.mjs';
99 import { QueryChannelRange } from '../structs/QueryChannelRange.mjs';
100 import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs';
101 import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs';
102 import { MessageSendEvent } from '../structs/MessageSendEvent.mjs';
103 import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
104 import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
105 import { ScoringParameters } from '../structs/ScoringParameters.mjs';
106 import { Result_ScoringParametersDecodeErrorZ } from '../structs/Result_ScoringParametersDecodeErrorZ.mjs';
107 import { Scorer } from '../structs/Scorer.mjs';
108 import { Result_ScorerDecodeErrorZ } from '../structs/Result_ScorerDecodeErrorZ.mjs';
109 import { ProbabilisticScoringParameters } from '../structs/ProbabilisticScoringParameters.mjs';
110 import { Result_ProbabilisticScoringParametersDecodeErrorZ } from '../structs/Result_ProbabilisticScoringParametersDecodeErrorZ.mjs';
111 import { InitFeatures } from '../structs/InitFeatures.mjs';
112 import { Result_InitFeaturesDecodeErrorZ } from '../structs/Result_InitFeaturesDecodeErrorZ.mjs';
113 import { ChannelFeatures } from '../structs/ChannelFeatures.mjs';
114 import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs';
115 import { NodeFeatures } from '../structs/NodeFeatures.mjs';
116 import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs';
117 import { InvoiceFeatures } from '../structs/InvoiceFeatures.mjs';
118 import { Result_InvoiceFeaturesDecodeErrorZ } from '../structs/Result_InvoiceFeaturesDecodeErrorZ.mjs';
119 import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs';
120 import { Result_ChannelTypeFeaturesDecodeErrorZ } from '../structs/Result_ChannelTypeFeaturesDecodeErrorZ.mjs';
121 import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs';
122 import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs';
123 import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs';
124 import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs';
125 import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs';
126 import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs';
127 import { TwoTuple_SignatureSignatureZ } from '../structs/TwoTuple_SignatureSignatureZ.mjs';
128 import { Result_C2Tuple_SignatureSignatureZNoneZ } from '../structs/Result_C2Tuple_SignatureSignatureZNoneZ.mjs';
129 import { Result_SecretKeyNoneZ } from '../structs/Result_SecretKeyNoneZ.mjs';
130 import { ClosingTransaction } from '../structs/ClosingTransaction.mjs';
131 import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs';
132 import { BaseSign, BaseSignInterface } from '../structs/BaseSign.mjs';
133 import { Sign, SignInterface } from '../structs/Sign.mjs';
134 import { Result_SignDecodeErrorZ } from '../structs/Result_SignDecodeErrorZ.mjs';
135 import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs';
136 import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs';
137 import { InMemorySigner } from '../structs/InMemorySigner.mjs';
138 import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs';
139 import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs';
140 import { Option_u16Z } from '../structs/Option_u16Z.mjs';
141 import { APIError } from '../structs/APIError.mjs';
142 import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs';
143 import { Result__u832APIErrorZ } from '../structs/Result__u832APIErrorZ.mjs';
144 import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs';
145 import { Result_PaymentIdPaymentSendFailureZ } from '../structs/Result_PaymentIdPaymentSendFailureZ.mjs';
146 import { Result_NonePaymentSendFailureZ } from '../structs/Result_NonePaymentSendFailureZ.mjs';
147 import { TwoTuple_PaymentHashPaymentIdZ } from '../structs/TwoTuple_PaymentHashPaymentIdZ.mjs';
148 import { Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ } from '../structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mjs';
149 import { NetAddress } from '../structs/NetAddress.mjs';
150 import { TwoTuple_PaymentHashPaymentSecretZ } from '../structs/TwoTuple_PaymentHashPaymentSecretZ.mjs';
151 import { Result_C2Tuple_PaymentHashPaymentSecretZNoneZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mjs';
152 import { Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mjs';
153 import { Result_PaymentSecretNoneZ } from '../structs/Result_PaymentSecretNoneZ.mjs';
154 import { Result_PaymentSecretAPIErrorZ } from '../structs/Result_PaymentSecretAPIErrorZ.mjs';
155 import { Result_PaymentPreimageAPIErrorZ } from '../structs/Result_PaymentPreimageAPIErrorZ.mjs';
156 import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs';
157 import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs';
158 import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs';
159 import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_ChannelCounterpartyDecodeErrorZ.mjs';
160 import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs';
161 import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs';
162 import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs';
163 import { ChannelMonitor } from '../structs/ChannelMonitor.mjs';
164 import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs';
165 import { Watch, WatchInterface } from '../structs/Watch.mjs';
166 import { BroadcasterInterface, BroadcasterInterfaceInterface } from '../structs/BroadcasterInterface.mjs';
167 import { KeysInterface, KeysInterfaceInterface } from '../structs/KeysInterface.mjs';
168 import { FeeEstimator, FeeEstimatorInterface } from '../structs/FeeEstimator.mjs';
169 import { Record } from '../structs/Record.mjs';
170 import { Logger, LoggerInterface } from '../structs/Logger.mjs';
171 import { TwoTuple_BlockHashChannelManagerZ } from '../structs/TwoTuple_BlockHashChannelManagerZ.mjs';
172 import { Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mjs';
173 import { ChannelConfig } from '../structs/ChannelConfig.mjs';
174 import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs';
175 import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs';
176 import { Type, TypeInterface } from '../structs/Type.mjs';
177 import { Option_TypeZ } from '../structs/Option_TypeZ.mjs';
178 import { Result_COption_TypeZDecodeErrorZ } from '../structs/Result_COption_TypeZDecodeErrorZ.mjs';
179 import { PaymentError } from '../structs/PaymentError.mjs';
180 import { Result_PaymentIdPaymentErrorZ } from '../structs/Result_PaymentIdPaymentErrorZ.mjs';
181 import { Result_SiPrefixNoneZ } from '../structs/Result_SiPrefixNoneZ.mjs';
182 import { Invoice } from '../structs/Invoice.mjs';
183 import { Result_InvoiceNoneZ } from '../structs/Result_InvoiceNoneZ.mjs';
184 import { SignedRawInvoice } from '../structs/SignedRawInvoice.mjs';
185 import { Result_SignedRawInvoiceNoneZ } from '../structs/Result_SignedRawInvoiceNoneZ.mjs';
186 import { RawInvoice } from '../structs/RawInvoice.mjs';
187 import { InvoiceSignature } from '../structs/InvoiceSignature.mjs';
188 import { ThreeTuple_RawInvoice_u832InvoiceSignatureZ } from '../structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.mjs';
189 import { PayeePubKey } from '../structs/PayeePubKey.mjs';
190 import { Result_PayeePubKeyErrorZ } from '../structs/Result_PayeePubKeyErrorZ.mjs';
191 import { PrivateRoute } from '../structs/PrivateRoute.mjs';
192 import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs';
193 import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs';
194 import { Result_NoneSemanticErrorZ } from '../structs/Result_NoneSemanticErrorZ.mjs';
195 import { Result_InvoiceSemanticErrorZ } from '../structs/Result_InvoiceSemanticErrorZ.mjs';
196 import { Description } from '../structs/Description.mjs';
197 import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs';
198 import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs';
199 import { Result_StringErrorZ } from '../structs/Result_StringErrorZ.mjs';
200 import { Result_ChannelMonitorUpdateDecodeErrorZ } from '../structs/Result_ChannelMonitorUpdateDecodeErrorZ.mjs';
201 import { Option_MonitorEventZ } from '../structs/Option_MonitorEventZ.mjs';
202 import { Result_COption_MonitorEventZDecodeErrorZ } from '../structs/Result_COption_MonitorEventZDecodeErrorZ.mjs';
203 import { Result_HTLCUpdateDecodeErrorZ } from '../structs/Result_HTLCUpdateDecodeErrorZ.mjs';
204 import { TwoTuple_OutPointScriptZ } from '../structs/TwoTuple_OutPointScriptZ.mjs';
205 import { TwoTuple_u32ScriptZ } from '../structs/TwoTuple_u32ScriptZ.mjs';
206 import { TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mjs';
207 import { TwoTuple_u32TxOutZ } from '../structs/TwoTuple_u32TxOutZ.mjs';
208 import { TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mjs';
209 import { Balance } from '../structs/Balance.mjs';
210 import { TwoTuple_BlockHashChannelMonitorZ } from '../structs/TwoTuple_BlockHashChannelMonitorZ.mjs';
211 import { Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mjs';
212 import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs';
213 import { TwoTuple_PublicKeyTypeZ } from '../structs/TwoTuple_PublicKeyTypeZ.mjs';
214 import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs';
215 import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs';
216 import { PeerHandleError } from '../structs/PeerHandleError.mjs';
217 import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs';
218 import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs';
219 import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs';
220 import { NodeId } from '../structs/NodeId.mjs';
221 import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs';
222 import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs';
223 import { Access, AccessInterface } from '../structs/Access.mjs';
224 import { Option_AccessZ } from '../structs/Option_AccessZ.mjs';
225 import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs';
226 import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs';
227 import { ChannelInfo } from '../structs/ChannelInfo.mjs';
228 import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
229 import { RoutingFees } from '../structs/RoutingFees.mjs';
230 import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
231 import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
232 import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
233 import { NodeInfo } from '../structs/NodeInfo.mjs';
234 import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs';
235 import { NetworkGraph } from '../structs/NetworkGraph.mjs';
236 import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs';
237 import { Option_CVec_NetAddressZZ } from '../structs/Option_CVec_NetAddressZZ.mjs';
238 import { Result_NetAddressDecodeErrorZ } from '../structs/Result_NetAddressDecodeErrorZ.mjs';
239 import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs';
240 import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs';
241 import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs';
242 import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs';
243 import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs';
244 import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs';
245 import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs';
246 import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs';
247 import { ClosingSignedFeeRange } from '../structs/ClosingSignedFeeRange.mjs';
248 import { Result_ClosingSignedFeeRangeDecodeErrorZ } from '../structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mjs';
249 import { CommitmentSigned } from '../structs/CommitmentSigned.mjs';
250 import { Result_CommitmentSignedDecodeErrorZ } from '../structs/Result_CommitmentSignedDecodeErrorZ.mjs';
251 import { Result_FundingCreatedDecodeErrorZ } from '../structs/Result_FundingCreatedDecodeErrorZ.mjs';
252 import { Result_FundingSignedDecodeErrorZ } from '../structs/Result_FundingSignedDecodeErrorZ.mjs';
253 import { Result_FundingLockedDecodeErrorZ } from '../structs/Result_FundingLockedDecodeErrorZ.mjs';
254 import { Init } from '../structs/Init.mjs';
255 import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs';
256 import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs';
257 import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs';
258 import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
259 import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs';
260 import { Result_UpdateFailMalformedHTLCDecodeErrorZ } from '../structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mjs';
261 import { UpdateFee } from '../structs/UpdateFee.mjs';
262 import { Result_UpdateFeeDecodeErrorZ } from '../structs/Result_UpdateFeeDecodeErrorZ.mjs';
263 import { Result_UpdateFulfillHTLCDecodeErrorZ } from '../structs/Result_UpdateFulfillHTLCDecodeErrorZ.mjs';
264 import { Result_UpdateAddHTLCDecodeErrorZ } from '../structs/Result_UpdateAddHTLCDecodeErrorZ.mjs';
265 import { Ping } from '../structs/Ping.mjs';
266 import { Result_PingDecodeErrorZ } from '../structs/Result_PingDecodeErrorZ.mjs';
267 import { Pong } from '../structs/Pong.mjs';
268 import { Result_PongDecodeErrorZ } from '../structs/Result_PongDecodeErrorZ.mjs';
269 import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs';
270 import { Result_ChannelAnnouncementDecodeErrorZ } from '../structs/Result_ChannelAnnouncementDecodeErrorZ.mjs';
271 import { UnsignedChannelUpdate } from '../structs/UnsignedChannelUpdate.mjs';
272 import { Result_UnsignedChannelUpdateDecodeErrorZ } from '../structs/Result_UnsignedChannelUpdateDecodeErrorZ.mjs';
273 import { Result_ChannelUpdateDecodeErrorZ } from '../structs/Result_ChannelUpdateDecodeErrorZ.mjs';
274 import { Result_ErrorMessageDecodeErrorZ } from '../structs/Result_ErrorMessageDecodeErrorZ.mjs';
275 import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs';
276 import { UnsignedNodeAnnouncement } from '../structs/UnsignedNodeAnnouncement.mjs';
277 import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
278 import { Result_NodeAnnouncementDecodeErrorZ } from '../structs/Result_NodeAnnouncementDecodeErrorZ.mjs';
279 import { Result_QueryShortChannelIdsDecodeErrorZ } from '../structs/Result_QueryShortChannelIdsDecodeErrorZ.mjs';
280 import { ReplyShortChannelIdsEnd } from '../structs/ReplyShortChannelIdsEnd.mjs';
281 import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mjs';
282 import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs';
283 import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs';
284 import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs';
285 import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs';
286 import { SignOrCreationError } from '../structs/SignOrCreationError.mjs';
287 import { Result_InvoiceSignOrCreationErrorZ } from '../structs/Result_InvoiceSignOrCreationErrorZ.mjs';
288 import { WatchedOutput } from '../structs/WatchedOutput.mjs';
289 import { Filter, FilterInterface } from '../structs/Filter.mjs';
290 import { Option_FilterZ } from '../structs/Option_FilterZ.mjs';
291 import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs';
292 import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs';
293 import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs';
294 import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs';
295 import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs';
296 import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs';
297 import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs';
298 import { UserConfig } from '../structs/UserConfig.mjs';
299 import { BestBlock } from '../structs/BestBlock.mjs';
300 import { Listen, ListenInterface } from '../structs/Listen.mjs';
301 import { Confirm, ConfirmInterface } from '../structs/Confirm.mjs';
302 import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs';
303 import { Persist, PersistInterface } from '../structs/Persist.mjs';
304 import { ChainMonitor } from '../structs/ChainMonitor.mjs';
305 import { KeysManager } from '../structs/KeysManager.mjs';
306 import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs';
307 import { ChainParameters } from '../structs/ChainParameters.mjs';
308 import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs';
309 import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs';
310 import { DataLossProtect } from '../structs/DataLossProtect.mjs';
311 import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs';
312 import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs';
313 import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs';
314 import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs';
315 import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs';
316 import { MessageHandler } from '../structs/MessageHandler.mjs';
317 import { SocketDescriptor, SocketDescriptorInterface } from '../structs/SocketDescriptor.mjs';
318 import { PeerManager } from '../structs/PeerManager.mjs';
319 import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs';
320 import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs';
321 import { NetGraphMsgHandler } from '../structs/NetGraphMsgHandler.mjs';
322 import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs';
323 import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs';
324 import { Score, ScoreInterface } from '../structs/Score.mjs';
325 import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs';
326 import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs';
327 import { RawDataPart } from '../structs/RawDataPart.mjs';
328 import { Sha256 } from '../structs/Sha256.mjs';
329 import { ExpiryTime } from '../structs/ExpiryTime.mjs';
330 import { MinFinalCltvExpiry } from '../structs/MinFinalCltvExpiry.mjs';
331 import { Fallback } from '../structs/Fallback.mjs';
332 import { Payer, PayerInterface } from '../structs/Payer.mjs';
333 import { Router, RouterInterface } from '../structs/Router.mjs';
334 import { InvoicePayer } from '../structs/InvoicePayer.mjs';
335 import { RetryAttempts } from '../structs/RetryAttempts.mjs';
336 import { DefaultRouter } from '../structs/DefaultRouter.mjs';
337
338 import { CommonBase, UInt5 } from './CommonBase.mjs';
339 import * as bindings from '../bindings.mjs'
340
341
342 /**
343  * Manager which keeps track of a number of channels and sends messages to the appropriate
344  * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
345  * 
346  * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
347  * to individual Channels.
348  * 
349  * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
350  * all peers during write/read (though does not modify this instance, only the instance being
351  * serialized). This will result in any channels which have not yet exchanged funding_created (ie
352  * called funding_transaction_generated for outbound channels).
353  * 
354  * Note that you can be a bit lazier about writing out ChannelManager than you can be with
355  * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
356  * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
357  * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
358  * the serialization process). If the deserialized version is out-of-date compared to the
359  * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
360  * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
361  * 
362  * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
363  * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
364  * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
365  * block_connected() to step towards your best block) upon deserialization before using the
366  * object!
367  * 
368  * Note that ChannelManager is responsible for tracking liveness of its channels and generating
369  * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
370  * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
371  * offline for a full minute. In order to track this, you must call
372  * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
373  * 
374  * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
375  * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
376  * essentially you should default to using a SimpleRefChannelManager, and use a
377  * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
378  * you're using lightning-net-tokio.
379  */
380 export class ChannelManager extends CommonBase {
381         /* @internal */
382         public constructor(_dummy: object, ptr: number) {
383                 super(ptr, bindings.ChannelManager_free);
384         }
385
386         /**
387          * Constructs a new ChannelManager to hold several channels and route between them.
388          * 
389          * This is the main \"logic hub\" for all channel-related actions, and implements
390          * ChannelMessageHandler.
391          * 
392          * Non-proportional fees are fixed according to our risk using the provided fee estimator.
393          * 
394          * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
395          * 
396          * Users need to notify the new ChannelManager when a new block is connected or
397          * disconnected using its `block_connected` and `block_disconnected` methods, starting
398          * from after `params.latest_hash`.
399          */
400         public static constructor_new(fee_est: FeeEstimator, chain_monitor: Watch, tx_broadcaster: BroadcasterInterface, logger: Logger, keys_manager: KeysInterface, config: UserConfig, params: ChainParameters): ChannelManager {
401                 const ret: number = bindings.ChannelManager_new(fee_est == null ? 0 : CommonBase.get_ptr_of(fee_est), chain_monitor == null ? 0 : CommonBase.get_ptr_of(chain_monitor), tx_broadcaster == null ? 0 : CommonBase.get_ptr_of(tx_broadcaster), logger == null ? 0 : CommonBase.get_ptr_of(logger), keys_manager == null ? 0 : CommonBase.get_ptr_of(keys_manager), config == null ? 0 : CommonBase.get_ptr_of(config) & ~1, params == null ? 0 : CommonBase.get_ptr_of(params) & ~1);
402                 const ret_hu_conv: ChannelManager = new ChannelManager(null, ret);
403                 CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
404                 CommonBase.add_ref_from(ret_hu_conv, fee_est);
405                 CommonBase.add_ref_from(ret_hu_conv, chain_monitor);
406                 CommonBase.add_ref_from(ret_hu_conv, tx_broadcaster);
407                 CommonBase.add_ref_from(ret_hu_conv, logger);
408                 CommonBase.add_ref_from(ret_hu_conv, keys_manager);
409                 return ret_hu_conv;
410         }
411
412         /**
413          * Gets the current configuration applied to all new channels,  as
414          */
415         public get_current_default_configuration(): UserConfig {
416                 const ret: number = bindings.ChannelManager_get_current_default_configuration(this.ptr);
417                 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
418                 CommonBase.add_ref_from(ret_hu_conv, this);
419                 return ret_hu_conv;
420         }
421
422         /**
423          * Creates a new outbound channel to the given remote node and with the given value.
424          * 
425          * `user_channel_id` will be provided back as in
426          * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
427          * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
428          * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
429          * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
430          * ignored.
431          * 
432          * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
433          * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
434          * 
435          * Note that we do not check if you are currently connected to the given peer. If no
436          * connection is available, the outbound `open_channel` message may fail to send, resulting in
437          * the channel eventually being silently forgotten (dropped on reload).
438          * 
439          * Returns the new Channel's temporary `channel_id`. This ID will appear as
440          * [`Event::FundingGenerationReady::temporary_channel_id`] and in
441          * [`ChannelDetails::channel_id`] until after
442          * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
443          * one derived from the funding transaction's TXID. If the counterparty rejects the channel
444          * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
445          * 
446          * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
447          * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
448          * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
449          * 
450          * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
451          */
452         public create_channel(their_network_key: Uint8Array, channel_value_satoshis: bigint, push_msat: bigint, user_channel_id: bigint, override_config: UserConfig): Result__u832APIErrorZ {
453                 const ret: number = bindings.ChannelManager_create_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_network_key, 33)), channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : CommonBase.get_ptr_of(override_config) & ~1);
454                 const ret_hu_conv: Result__u832APIErrorZ = Result__u832APIErrorZ.constr_from_ptr(ret);
455                 return ret_hu_conv;
456         }
457
458         /**
459          * Gets the list of open channels, in random order. See ChannelDetail field documentation for
460          * more information.
461          */
462         public list_channels(): ChannelDetails[] {
463                 const ret: number = bindings.ChannelManager_list_channels(this.ptr);
464                 const ret_conv_16_len: number = bindings.getArrayLength(ret);
465                 const ret_conv_16_arr: ChannelDetails[] = new Array(ret_conv_16_len).fill(null);
466                 for (var q = 0; q < ret_conv_16_len; q++) {
467                         const ret_conv_16: number = bindings.getU32ArrayElem(ret, q);
468                         const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
469                         CommonBase.add_ref_from(ret_conv_16_hu_conv, this);
470                         ret_conv_16_arr[q] = ret_conv_16_hu_conv;
471                 }
472                 bindings.freeWasmMemory(ret)
473                 return ret_conv_16_arr;
474         }
475
476         /**
477          * Gets the list of usable channels, in random order. Useful as an argument to
478          * get_route to ensure non-announced channels are used.
479          * 
480          * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
481          * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
482          * are.
483          */
484         public list_usable_channels(): ChannelDetails[] {
485                 const ret: number = bindings.ChannelManager_list_usable_channels(this.ptr);
486                 const ret_conv_16_len: number = bindings.getArrayLength(ret);
487                 const ret_conv_16_arr: ChannelDetails[] = new Array(ret_conv_16_len).fill(null);
488                 for (var q = 0; q < ret_conv_16_len; q++) {
489                         const ret_conv_16: number = bindings.getU32ArrayElem(ret, q);
490                         const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
491                         CommonBase.add_ref_from(ret_conv_16_hu_conv, this);
492                         ret_conv_16_arr[q] = ret_conv_16_hu_conv;
493                 }
494                 bindings.freeWasmMemory(ret)
495                 return ret_conv_16_arr;
496         }
497
498         /**
499          * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
500          * will be accepted on the given channel, and after additional timeout/the closing of all
501          * pending HTLCs, the channel will be closed on chain.
502          * 
503          * If we are the channel initiator, we will pay between our [`Background`] and
504          * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
505          * estimate.
506          * If our counterparty is the channel initiator, we will require a channel closing
507          * transaction feerate of at least our [`Background`] feerate or the feerate which
508          * would appear on a force-closure transaction, whichever is lower. We will allow our
509          * counterparty to pay as much fee as they'd like, however.
510          * 
511          * May generate a SendShutdown message event on success, which should be relayed.
512          * 
513          * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
514          * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
515          * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
516          */
517         public close_channel(channel_id: Uint8Array): Result_NoneAPIErrorZ {
518                 const ret: number = bindings.ChannelManager_close_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)));
519                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
520                 return ret_hu_conv;
521         }
522
523         /**
524          * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
525          * will be accepted on the given channel, and after additional timeout/the closing of all
526          * pending HTLCs, the channel will be closed on chain.
527          * 
528          * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
529          * the channel being closed or not:
530          * If we are the channel initiator, we will pay at least this feerate on the closing
531          * transaction. The upper-bound is set by
532          * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
533          * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
534          * If our counterparty is the channel initiator, we will refuse to accept a channel closure
535          * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
536          * will appear on a force-closure transaction, whichever is lower).
537          * 
538          * May generate a SendShutdown message event on success, which should be relayed.
539          * 
540          * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
541          * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
542          * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
543          */
544         public close_channel_with_target_feerate(channel_id: Uint8Array, target_feerate_sats_per_1000_weight: number): Result_NoneAPIErrorZ {
545                 const ret: number = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), target_feerate_sats_per_1000_weight);
546                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
547                 return ret_hu_conv;
548         }
549
550         /**
551          * Force closes a channel, immediately broadcasting the latest local commitment transaction to
552          * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
553          */
554         public force_close_channel(channel_id: Uint8Array): Result_NoneAPIErrorZ {
555                 const ret: number = bindings.ChannelManager_force_close_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)));
556                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
557                 return ret_hu_conv;
558         }
559
560         /**
561          * Force close all channels, immediately broadcasting the latest local commitment transaction
562          * for each to the chain and rejecting new HTLCs on each.
563          */
564         public force_close_all_channels(): void {
565                 bindings.ChannelManager_force_close_all_channels(this.ptr);
566         }
567
568         /**
569          * Sends a payment along a given route.
570          * 
571          * Value parameters are provided via the last hop in route, see documentation for RouteHop
572          * fields for more info.
573          * 
574          * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
575          * payment), we don't do anything to stop you! We always try to ensure that if the provided
576          * next hop knows the preimage to payment_hash they can claim an additional amount as
577          * specified in the last hop in the route! Thus, you should probably do your own
578          * payment_preimage tracking (which you should already be doing as they represent \"proof of
579          * payment\") and prevent double-sends yourself.
580          * 
581          * May generate SendHTLCs message(s) event on success, which should be relayed.
582          * 
583          * Each path may have a different return value, and PaymentSendValue may return a Vec with
584          * each entry matching the corresponding-index entry in the route paths, see
585          * PaymentSendFailure for more info.
586          * 
587          * In general, a path may raise:
588          * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
589          * node public key) is specified.
590          * APIError::ChannelUnavailable if the next-hop channel is not available for updates
591          * (including due to previous monitor update failure or new permanent monitor update
592          * failure).
593          * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
594          * relevant updates.
595          * 
596          * Note that depending on the type of the PaymentSendFailure the HTLC may have been
597          * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
598          * different route unless you intend to pay twice!
599          * 
600          * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
601          * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
602          * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
603          * must not contain multiple paths as multi-path payments require a recipient-provided
604          * payment_secret.
605          * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
606          * bit set (either as required or as available). If multiple paths are present in the Route,
607          * we assume the invoice had the basic_mpp feature set.
608          * 
609          * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
610          */
611         public send_payment(route: Route, payment_hash: Uint8Array, payment_secret: Uint8Array): Result_PaymentIdPaymentSendFailureZ {
612                 const ret: number = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : CommonBase.get_ptr_of(route) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_secret, 32)));
613                 const ret_hu_conv: Result_PaymentIdPaymentSendFailureZ = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
614                 CommonBase.add_ref_from(this, route);
615                 return ret_hu_conv;
616         }
617
618         /**
619          * Retries a payment along the given [`Route`].
620          * 
621          * Errors returned are a superset of those returned from [`send_payment`], so see
622          * [`send_payment`] documentation for more details on errors. This method will also error if the
623          * retry amount puts the payment more than 10% over the payment's total amount, if the payment
624          * for the given `payment_id` cannot be found (likely due to timeout or success), or if
625          * further retries have been disabled with [`abandon_payment`].
626          * 
627          * [`send_payment`]: [`ChannelManager::send_payment`]
628          * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
629          */
630         public retry_payment(route: Route, payment_id: Uint8Array): Result_NonePaymentSendFailureZ {
631                 const ret: number = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : CommonBase.get_ptr_of(route) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)));
632                 const ret_hu_conv: Result_NonePaymentSendFailureZ = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
633                 CommonBase.add_ref_from(this, route);
634                 return ret_hu_conv;
635         }
636
637         /**
638          * Signals that no further retries for the given payment will occur.
639          * 
640          * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
641          * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
642          * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
643          * pending HTLCs for this payment.
644          * 
645          * Note that calling this method does *not* prevent a payment from succeeding. You must still
646          * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
647          * determine the ultimate status of a payment.
648          * 
649          * [`retry_payment`]: Self::retry_payment
650          * [`Event::PaymentFailed`]: events::Event::PaymentFailed
651          * [`Event::PaymentSent`]: events::Event::PaymentSent
652          */
653         public abandon_payment(payment_id: Uint8Array): void {
654                 bindings.ChannelManager_abandon_payment(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)));
655         }
656
657         /**
658          * Send a spontaneous payment, which is a payment that does not require the recipient to have
659          * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
660          * the preimage, it must be a cryptographically secure random value that no intermediate node
661          * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
662          * never reach the recipient.
663          * 
664          * See [`send_payment`] documentation for more details on the return value of this function.
665          * 
666          * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
667          * [`send_payment`] for more information about the risks of duplicate preimage usage.
668          * 
669          * Note that `route` must have exactly one path.
670          * 
671          * [`send_payment`]: Self::send_payment
672          * 
673          * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
674          */
675         public send_spontaneous_payment(route: Route, payment_preimage: Uint8Array): Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
676                 const ret: number = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : CommonBase.get_ptr_of(route) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32)));
677                 const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret);
678                 CommonBase.add_ref_from(this, route);
679                 return ret_hu_conv;
680         }
681
682         /**
683          * Call this upon creation of a funding transaction for the given channel.
684          * 
685          * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
686          * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
687          * 
688          * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
689          * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
690          * 
691          * May panic if the output found in the funding transaction is duplicative with some other
692          * channel (note that this should be trivially prevented by using unique funding transaction
693          * keys per-channel).
694          * 
695          * Do NOT broadcast the funding transaction yourself. When we have safely received our
696          * counterparty's signature the funding transaction will automatically be broadcast via the
697          * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
698          * 
699          * Note that this includes RBF or similar transaction replacement strategies - lightning does
700          * not currently support replacing a funding transaction on an existing channel. Instead,
701          * create a new channel with a conflicting funding transaction.
702          * 
703          * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
704          * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
705          */
706         public funding_transaction_generated(temporary_channel_id: Uint8Array, funding_transaction: Uint8Array): Result_NoneAPIErrorZ {
707                 const ret: number = bindings.ChannelManager_funding_transaction_generated(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)), bindings.encodeUint8Array(funding_transaction));
708                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
709                 return ret_hu_conv;
710         }
711
712         /**
713          * Regenerates channel_announcements and generates a signed node_announcement from the given
714          * arguments, providing them in corresponding events via
715          * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
716          * on-chain. This effectively re-broadcasts all channel announcements and sends our node
717          * announcement to ensure that the lightning P2P network is aware of the channels we have and
718          * our network addresses.
719          * 
720          * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
721          * node to humans. They carry no in-protocol meaning.
722          * 
723          * `addresses` represent the set (possibly empty) of socket addresses on which this node
724          * accepts incoming connections. These will be included in the node_announcement, publicly
725          * tying these addresses together and to this node. If you wish to preserve user privacy,
726          * addresses should likely contain only Tor Onion addresses.
727          * 
728          * Panics if `addresses` is absurdly large (more than 500).
729          * 
730          * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
731          */
732         public broadcast_node_announcement(rgb: Uint8Array, alias: Uint8Array, addresses: NetAddress[]): void {
733                 bindings.ChannelManager_broadcast_node_announcement(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(rgb, 3)), bindings.encodeUint8Array(bindings.check_arr_len(alias, 32)), bindings.encodeUint32Array(addresses != null ? addresses.map(addresses_conv_12 => CommonBase.get_ptr_of(addresses_conv_12)) : null));
734         }
735
736         /**
737          * Processes HTLCs which are pending waiting on random forward delay.
738          * 
739          * Should only really ever be called in response to a PendingHTLCsForwardable event.
740          * Will likely generate further events.
741          */
742         public process_pending_htlc_forwards(): void {
743                 bindings.ChannelManager_process_pending_htlc_forwards(this.ptr);
744         }
745
746         /**
747          * Performs actions which should happen on startup and roughly once per minute thereafter.
748          * 
749          * This currently includes:
750          * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
751          * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
752          * than a minute, informing the network that they should no longer attempt to route over
753          * the channel.
754          * 
755          * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
756          * estimate fetches.
757          */
758         public timer_tick_occurred(): void {
759                 bindings.ChannelManager_timer_tick_occurred(this.ptr);
760         }
761
762         /**
763          * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
764          * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
765          * along the path (including in our own channel on which we received it).
766          * Returns false if no payment was found to fail backwards, true if the process of failing the
767          * HTLC backwards has been started.
768          */
769         public fail_htlc_backwards(payment_hash: Uint8Array): boolean {
770                 const ret: boolean = bindings.ChannelManager_fail_htlc_backwards(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)));
771                 return ret;
772         }
773
774         /**
775          * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
776          * [`MessageSendEvent`]s needed to claim the payment.
777          * 
778          * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
779          * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
780          * event matches your expectation. If you fail to do so and call this method, you may provide
781          * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
782          * 
783          * Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now
784          * pending for processing via [`get_and_clear_pending_msg_events`].
785          * 
786          * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
787          * [`create_inbound_payment`]: Self::create_inbound_payment
788          * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
789          * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
790          */
791         public claim_funds(payment_preimage: Uint8Array): boolean {
792                 const ret: boolean = bindings.ChannelManager_claim_funds(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32)));
793                 return ret;
794         }
795
796         /**
797          * Gets the node_id held by this ChannelManager
798          */
799         public get_our_node_id(): Uint8Array {
800                 const ret: number = bindings.ChannelManager_get_our_node_id(this.ptr);
801                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
802                 return ret_conv;
803         }
804
805         /**
806          * Called to accept a request to open a channel after [`Event::OpenChannelRequest`] has been
807          * triggered.
808          * 
809          * The `temporary_channel_id` parameter indicates which inbound channel should be accepted.
810          * 
811          * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
812          */
813         public accept_inbound_channel(temporary_channel_id: Uint8Array): Result_NoneAPIErrorZ {
814                 const ret: number = bindings.ChannelManager_accept_inbound_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)));
815                 const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret);
816                 return ret_hu_conv;
817         }
818
819         /**
820          * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
821          * to pay us.
822          * 
823          * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
824          * [`PaymentHash`] and [`PaymentPreimage`] for you.
825          * 
826          * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
827          * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
828          * passed directly to [`claim_funds`].
829          * 
830          * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
831          * 
832          * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
833          * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
834          * 
835          * # Note
836          * 
837          * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
838          * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
839          * 
840          * Errors if `min_value_msat` is greater than total bitcoin supply.
841          * 
842          * [`claim_funds`]: Self::claim_funds
843          * [`PaymentReceived`]: events::Event::PaymentReceived
844          * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
845          * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
846          */
847         public create_inbound_payment(min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number): Result_C2Tuple_PaymentHashPaymentSecretZNoneZ {
848                 const ret: number = bindings.ChannelManager_create_inbound_payment(this.ptr, CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs);
849                 const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZNoneZ = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
850                 return ret_hu_conv;
851         }
852
853         /**
854          * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
855          * serialized state with LDK node(s) running 0.0.103 and earlier.
856          * 
857          * # Note
858          * This method is deprecated and will be removed soon.
859          * 
860          * [`create_inbound_payment`]: Self::create_inbound_payment
861          */
862         public create_inbound_payment_legacy(min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number): Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
863                 const ret: number = bindings.ChannelManager_create_inbound_payment_legacy(this.ptr, CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs);
864                 const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
865                 return ret_hu_conv;
866         }
867
868         /**
869          * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
870          * stored external to LDK.
871          * 
872          * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
873          * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
874          * the `min_value_msat` provided here, if one is provided.
875          * 
876          * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
877          * note that LDK will not stop you from registering duplicate payment hashes for inbound
878          * payments.
879          * 
880          * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
881          * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
882          * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
883          * sender \"proof-of-payment\" unless they have paid the required amount.
884          * 
885          * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
886          * in excess of the current time. This should roughly match the expiry time set in the invoice.
887          * After this many seconds, we will remove the inbound payment, resulting in any attempts to
888          * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
889          * invoices when no timeout is set.
890          * 
891          * Note that we use block header time to time-out pending inbound payments (with some margin
892          * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
893          * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
894          * If you need exact expiry semantics, you should enforce them upon receipt of
895          * [`PaymentReceived`].
896          * 
897          * May panic if `invoice_expiry_delta_secs` is greater than one year.
898          * 
899          * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
900          * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
901          * 
902          * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
903          * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
904          * 
905          * # Note
906          * 
907          * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
908          * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
909          * 
910          * Errors if `min_value_msat` is greater than total bitcoin supply.
911          * 
912          * [`create_inbound_payment`]: Self::create_inbound_payment
913          * [`PaymentReceived`]: events::Event::PaymentReceived
914          */
915         public create_inbound_payment_for_hash(payment_hash: Uint8Array, min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number): Result_PaymentSecretNoneZ {
916                 const ret: number = 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);
917                 const ret_hu_conv: Result_PaymentSecretNoneZ = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
918                 return ret_hu_conv;
919         }
920
921         /**
922          * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
923          * serialized state with LDK node(s) running 0.0.103 and earlier.
924          * 
925          * # Note
926          * This method is deprecated and will be removed soon.
927          * 
928          * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
929          */
930         public create_inbound_payment_for_hash_legacy(payment_hash: Uint8Array, min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number): Result_PaymentSecretAPIErrorZ {
931                 const ret: number = bindings.ChannelManager_create_inbound_payment_for_hash_legacy(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs);
932                 const ret_hu_conv: Result_PaymentSecretAPIErrorZ = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
933                 return ret_hu_conv;
934         }
935
936         /**
937          * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
938          * previously returned from [`create_inbound_payment`].
939          * 
940          * [`create_inbound_payment`]: Self::create_inbound_payment
941          */
942         public get_payment_preimage(payment_hash: Uint8Array, payment_secret: Uint8Array): Result_PaymentPreimageAPIErrorZ {
943                 const ret: number = 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)));
944                 const ret_hu_conv: Result_PaymentPreimageAPIErrorZ = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
945                 return ret_hu_conv;
946         }
947
948         /**
949          * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
950          * are used when constructing the phantom invoice's route hints.
951          * 
952          * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
953          */
954         public get_phantom_scid(): bigint {
955                 const ret: bigint = bindings.ChannelManager_get_phantom_scid(this.ptr);
956                 return ret;
957         }
958
959         /**
960          * Gets route hints for use in receiving [phantom node payments].
961          * 
962          * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
963          */
964         public get_phantom_route_hints(): PhantomRouteHints {
965                 const ret: number = bindings.ChannelManager_get_phantom_route_hints(this.ptr);
966                 const ret_hu_conv: PhantomRouteHints = new PhantomRouteHints(null, ret);
967                 CommonBase.add_ref_from(ret_hu_conv, this);
968                 return ret_hu_conv;
969         }
970
971         /**
972          * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
973          * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
974          */
975         public as_MessageSendEventsProvider(): MessageSendEventsProvider {
976                 const ret: number = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr);
977                 const ret_hu_conv: MessageSendEventsProvider = new MessageSendEventsProvider(null, ret);
978                 CommonBase.add_ref_from(ret_hu_conv, this);
979                 return ret_hu_conv;
980         }
981
982         /**
983          * Constructs a new EventsProvider which calls the relevant methods on this_arg.
984          * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
985          */
986         public as_EventsProvider(): EventsProvider {
987                 const ret: number = bindings.ChannelManager_as_EventsProvider(this.ptr);
988                 const ret_hu_conv: EventsProvider = new EventsProvider(null, ret);
989                 CommonBase.add_ref_from(ret_hu_conv, this);
990                 return ret_hu_conv;
991         }
992
993         /**
994          * Constructs a new Listen which calls the relevant methods on this_arg.
995          * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
996          */
997         public as_Listen(): Listen {
998                 const ret: number = bindings.ChannelManager_as_Listen(this.ptr);
999                 const ret_hu_conv: Listen = new Listen(null, ret);
1000                 CommonBase.add_ref_from(ret_hu_conv, this);
1001                 return ret_hu_conv;
1002         }
1003
1004         /**
1005          * Constructs a new Confirm which calls the relevant methods on this_arg.
1006          * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
1007          */
1008         public as_Confirm(): Confirm {
1009                 const ret: number = bindings.ChannelManager_as_Confirm(this.ptr);
1010                 const ret_hu_conv: Confirm = new Confirm(null, ret);
1011                 CommonBase.add_ref_from(ret_hu_conv, this);
1012                 return ret_hu_conv;
1013         }
1014
1015         /**
1016          * Blocks until ChannelManager needs to be persisted. Only one listener on
1017          * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
1018          * up.
1019          */
1020         public await_persistable_update(): void {
1021                 bindings.ChannelManager_await_persistable_update(this.ptr);
1022         }
1023
1024         /**
1025          * Gets the latest best block which was connected either via the [`chain::Listen`] or
1026          * [`chain::Confirm`] interfaces.
1027          */
1028         public current_best_block(): BestBlock {
1029                 const ret: number = bindings.ChannelManager_current_best_block(this.ptr);
1030                 const ret_hu_conv: BestBlock = new BestBlock(null, ret);
1031                 CommonBase.add_ref_from(ret_hu_conv, this);
1032                 return ret_hu_conv;
1033         }
1034
1035         /**
1036          * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
1037          * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
1038          */
1039         public as_ChannelMessageHandler(): ChannelMessageHandler {
1040                 const ret: number = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr);
1041                 const ret_hu_conv: ChannelMessageHandler = new ChannelMessageHandler(null, ret);
1042                 CommonBase.add_ref_from(ret_hu_conv, this);
1043                 return ret_hu_conv;
1044         }
1045
1046         /**
1047          * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
1048          */
1049         public write(): Uint8Array {
1050                 const ret: number = bindings.ChannelManager_write(this.ptr);
1051                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
1052                 return ret_conv;
1053         }
1054
1055         /**
1056          * Constructs a new Payer which calls the relevant methods on this_arg.
1057          * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
1058          */
1059         public as_Payer(): Payer {
1060                 const ret: number = bindings.ChannelManager_as_Payer(this.ptr);
1061                 const ret_hu_conv: Payer = new Payer(null, ret);
1062                 CommonBase.add_ref_from(ret_hu_conv, this);
1063                 return ret_hu_conv;
1064         }
1065
1066 }