Merge pull request #119 from TheBlueMatt/main
[ldk-java] / ts / structs / BaseSign.mts
1 import { TxOut } from '../structs/TxOut.mjs';
2 import { BigEndianScalar } from '../structs/BigEndianScalar.mjs';
3 import { AccessError } from '../enums/AccessError.mjs';
4 import { COption_NoneZ } from '../enums/COption_NoneZ.mjs';
5 import { ChannelMonitorUpdateErr } from '../enums/ChannelMonitorUpdateErr.mjs';
6 import { ConfirmationTarget } from '../enums/ConfirmationTarget.mjs';
7 import { CreationError } from '../enums/CreationError.mjs';
8 import { Currency } from '../enums/Currency.mjs';
9 import { IOError } from '../enums/IOError.mjs';
10 import { Level } from '../enums/Level.mjs';
11 import { Network } from '../enums/Network.mjs';
12 import { Recipient } from '../enums/Recipient.mjs';
13 import { Secp256k1Error } from '../enums/Secp256k1Error.mjs';
14 import { SemanticError } from '../enums/SemanticError.mjs';
15 import { SiPrefix } from '../enums/SiPrefix.mjs';
16 import { Bech32Error } from '../structs/Bech32Error.mjs';
17 import { BlindedRoute } from '../structs/BlindedRoute.mjs';
18 import { Result_BlindedRouteNoneZ } from '../structs/Result_BlindedRouteNoneZ.mjs';
19 import { DecodeError } from '../structs/DecodeError.mjs';
20 import { Result_BlindedRouteDecodeErrorZ } from '../structs/Result_BlindedRouteDecodeErrorZ.mjs';
21 import { BlindedHop } from '../structs/BlindedHop.mjs';
22 import { Result_BlindedHopDecodeErrorZ } from '../structs/Result_BlindedHopDecodeErrorZ.mjs';
23 import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs';
24 import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs';
25 import { Result_CounterpartyCommitmentSecretsDecodeErrorZ } from '../structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.mjs';
26 import { Result_SecretKeyErrorZ } from '../structs/Result_SecretKeyErrorZ.mjs';
27 import { Result_PublicKeyErrorZ } from '../structs/Result_PublicKeyErrorZ.mjs';
28 import { TxCreationKeys } from '../structs/TxCreationKeys.mjs';
29 import { Result_TxCreationKeysDecodeErrorZ } from '../structs/Result_TxCreationKeysDecodeErrorZ.mjs';
30 import { ChannelPublicKeys } from '../structs/ChannelPublicKeys.mjs';
31 import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelPublicKeysDecodeErrorZ.mjs';
32 import { Result_TxCreationKeysErrorZ } from '../structs/Result_TxCreationKeysErrorZ.mjs';
33 import { Option_u32Z } from '../structs/Option_u32Z.mjs';
34 import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs';
35 import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs';
36 import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs';
37 import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs';
38 import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs';
39 import { Result_ChannelTransactionParametersDecodeErrorZ } from '../structs/Result_ChannelTransactionParametersDecodeErrorZ.mjs';
40 import { HolderCommitmentTransaction } from '../structs/HolderCommitmentTransaction.mjs';
41 import { Result_HolderCommitmentTransactionDecodeErrorZ } from '../structs/Result_HolderCommitmentTransactionDecodeErrorZ.mjs';
42 import { BuiltCommitmentTransaction } from '../structs/BuiltCommitmentTransaction.mjs';
43 import { Result_BuiltCommitmentTransactionDecodeErrorZ } from '../structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mjs';
44 import { TrustedClosingTransaction } from '../structs/TrustedClosingTransaction.mjs';
45 import { Result_TrustedClosingTransactionNoneZ } from '../structs/Result_TrustedClosingTransactionNoneZ.mjs';
46 import { CommitmentTransaction } from '../structs/CommitmentTransaction.mjs';
47 import { Result_CommitmentTransactionDecodeErrorZ } from '../structs/Result_CommitmentTransactionDecodeErrorZ.mjs';
48 import { TrustedCommitmentTransaction } from '../structs/TrustedCommitmentTransaction.mjs';
49 import { Result_TrustedCommitmentTransactionNoneZ } from '../structs/Result_TrustedCommitmentTransactionNoneZ.mjs';
50 import { Result_CVec_SignatureZNoneZ } from '../structs/Result_CVec_SignatureZNoneZ.mjs';
51 import { ShutdownScript } from '../structs/ShutdownScript.mjs';
52 import { Result_ShutdownScriptDecodeErrorZ } from '../structs/Result_ShutdownScriptDecodeErrorZ.mjs';
53 import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs';
54 import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs';
55 import { RouteHop } from '../structs/RouteHop.mjs';
56 import { Result_RouteHopDecodeErrorZ } from '../structs/Result_RouteHopDecodeErrorZ.mjs';
57 import { Route } from '../structs/Route.mjs';
58 import { Result_RouteDecodeErrorZ } from '../structs/Result_RouteDecodeErrorZ.mjs';
59 import { RouteParameters } from '../structs/RouteParameters.mjs';
60 import { Result_RouteParametersDecodeErrorZ } from '../structs/Result_RouteParametersDecodeErrorZ.mjs';
61 import { RouteHint } from '../structs/RouteHint.mjs';
62 import { Option_u64Z } from '../structs/Option_u64Z.mjs';
63 import { PaymentParameters } from '../structs/PaymentParameters.mjs';
64 import { Result_PaymentParametersDecodeErrorZ } from '../structs/Result_PaymentParametersDecodeErrorZ.mjs';
65 import { RouteHintHop } from '../structs/RouteHintHop.mjs';
66 import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs';
67 import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs';
68 import { ChannelDetails } from '../structs/ChannelDetails.mjs';
69 import { LightningError } from '../structs/LightningError.mjs';
70 import { Result_RouteLightningErrorZ } from '../structs/Result_RouteLightningErrorZ.mjs';
71 import { PaymentPurpose } from '../structs/PaymentPurpose.mjs';
72 import { Result_PaymentPurposeDecodeErrorZ } from '../structs/Result_PaymentPurposeDecodeErrorZ.mjs';
73 import { ClosureReason } from '../structs/ClosureReason.mjs';
74 import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
75 import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
76 import { HTLCDestination } from '../structs/HTLCDestination.mjs';
77 import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs';
78 import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs';
79 import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
80 import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
81 import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
82 import { OutPoint } from '../structs/OutPoint.mjs';
83 import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs';
84 import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs';
85 import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs';
86 import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs';
87 import { Event } from '../structs/Event.mjs';
88 import { Option_EventZ } from '../structs/Option_EventZ.mjs';
89 import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs';
90 import { AcceptChannel } from '../structs/AcceptChannel.mjs';
91 import { OpenChannel } from '../structs/OpenChannel.mjs';
92 import { FundingCreated } from '../structs/FundingCreated.mjs';
93 import { FundingSigned } from '../structs/FundingSigned.mjs';
94 import { ChannelReady } from '../structs/ChannelReady.mjs';
95 import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs';
96 import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs';
97 import { RevokeAndACK } from '../structs/RevokeAndACK.mjs';
98 import { ClosingSigned } from '../structs/ClosingSigned.mjs';
99 import { Shutdown } from '../structs/Shutdown.mjs';
100 import { ChannelReestablish } from '../structs/ChannelReestablish.mjs';
101 import { ChannelAnnouncement } from '../structs/ChannelAnnouncement.mjs';
102 import { ErrorMessage } from '../structs/ErrorMessage.mjs';
103 import { WarningMessage } from '../structs/WarningMessage.mjs';
104 import { ErrorAction } from '../structs/ErrorAction.mjs';
105 import { QueryChannelRange } from '../structs/QueryChannelRange.mjs';
106 import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs';
107 import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs';
108 import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs';
109 import { MessageSendEvent } from '../structs/MessageSendEvent.mjs';
110 import { Result_TxOutAccessErrorZ } from '../structs/Result_TxOutAccessErrorZ.mjs';
111 import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs';
112 import { Result_NoneChannelMonitorUpdateErrZ } from '../structs/Result_NoneChannelMonitorUpdateErrZ.mjs';
113 import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
114 import { MonitorEvent } from '../structs/MonitorEvent.mjs';
115 import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs';
116 import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
117 import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
118 import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs';
119 import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs';
120 import { NodeId } from '../structs/NodeId.mjs';
121 import { Record } from '../structs/Record.mjs';
122 import { Logger, LoggerInterface } from '../structs/Logger.mjs';
123 import { NetworkGraph } from '../structs/NetworkGraph.mjs';
124 import { ProbabilisticScorer } from '../structs/ProbabilisticScorer.mjs';
125 import { Result_ProbabilisticScorerDecodeErrorZ } from '../structs/Result_ProbabilisticScorerDecodeErrorZ.mjs';
126 import { InitFeatures } from '../structs/InitFeatures.mjs';
127 import { Result_InitFeaturesDecodeErrorZ } from '../structs/Result_InitFeaturesDecodeErrorZ.mjs';
128 import { ChannelFeatures } from '../structs/ChannelFeatures.mjs';
129 import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs';
130 import { NodeFeatures } from '../structs/NodeFeatures.mjs';
131 import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs';
132 import { InvoiceFeatures } from '../structs/InvoiceFeatures.mjs';
133 import { Result_InvoiceFeaturesDecodeErrorZ } from '../structs/Result_InvoiceFeaturesDecodeErrorZ.mjs';
134 import { Result_ChannelTypeFeaturesDecodeErrorZ } from '../structs/Result_ChannelTypeFeaturesDecodeErrorZ.mjs';
135 import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs';
136 import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs';
137 import { Access, AccessInterface } from '../structs/Access.mjs';
138 import { Option_AccessZ } from '../structs/Option_AccessZ.mjs';
139 import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs';
140 import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs';
141 import { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ } from '../structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.mjs';
142 import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs';
143 import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs';
144 import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs';
145 import { ChannelInfo } from '../structs/ChannelInfo.mjs';
146 import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
147 import { RoutingFees } from '../structs/RoutingFees.mjs';
148 import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
149 import { Hostname } from '../structs/Hostname.mjs';
150 import { NetAddress } from '../structs/NetAddress.mjs';
151 import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
152 import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
153 import { NodeAlias } from '../structs/NodeAlias.mjs';
154 import { Result_NodeAliasDecodeErrorZ } from '../structs/Result_NodeAliasDecodeErrorZ.mjs';
155 import { NodeInfo } from '../structs/NodeInfo.mjs';
156 import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs';
157 import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs';
158 import { Option_CVec_NetAddressZZ } from '../structs/Option_CVec_NetAddressZZ.mjs';
159 import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs';
160 import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs';
161 import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs';
162 import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs';
163 import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs';
164 import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs';
165 import { TwoTuple_SignatureSignatureZ } from '../structs/TwoTuple_SignatureSignatureZ.mjs';
166 import { Result_C2Tuple_SignatureSignatureZNoneZ } from '../structs/Result_C2Tuple_SignatureSignatureZNoneZ.mjs';
167 import { Result_SecretKeyNoneZ } from '../structs/Result_SecretKeyNoneZ.mjs';
168 import { Option_ScalarZ } from '../structs/Option_ScalarZ.mjs';
169 import { Result_SharedSecretNoneZ } from '../structs/Result_SharedSecretNoneZ.mjs';
170 import { ClosingTransaction } from '../structs/ClosingTransaction.mjs';
171 import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs';
172 import { Sign, SignInterface } from '../structs/Sign.mjs';
173 import { Result_SignDecodeErrorZ } from '../structs/Result_SignDecodeErrorZ.mjs';
174 import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs';
175 import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs';
176 import { InMemorySigner } from '../structs/InMemorySigner.mjs';
177 import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs';
178 import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs';
179 import { Option_u16Z } from '../structs/Option_u16Z.mjs';
180 import { APIError } from '../structs/APIError.mjs';
181 import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs';
182 import { Result__u832APIErrorZ } from '../structs/Result__u832APIErrorZ.mjs';
183 import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs';
184 import { Result_PaymentIdPaymentSendFailureZ } from '../structs/Result_PaymentIdPaymentSendFailureZ.mjs';
185 import { Result_NonePaymentSendFailureZ } from '../structs/Result_NonePaymentSendFailureZ.mjs';
186 import { TwoTuple_PaymentHashPaymentIdZ } from '../structs/TwoTuple_PaymentHashPaymentIdZ.mjs';
187 import { Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ } from '../structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mjs';
188 import { TwoTuple_PaymentHashPaymentSecretZ } from '../structs/TwoTuple_PaymentHashPaymentSecretZ.mjs';
189 import { Result_C2Tuple_PaymentHashPaymentSecretZNoneZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mjs';
190 import { Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mjs';
191 import { Result_PaymentSecretNoneZ } from '../structs/Result_PaymentSecretNoneZ.mjs';
192 import { Result_PaymentSecretAPIErrorZ } from '../structs/Result_PaymentSecretAPIErrorZ.mjs';
193 import { Result_PaymentPreimageAPIErrorZ } from '../structs/Result_PaymentPreimageAPIErrorZ.mjs';
194 import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs';
195 import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs';
196 import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs';
197 import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_ChannelCounterpartyDecodeErrorZ.mjs';
198 import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs';
199 import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs';
200 import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs';
201 import { ChannelMonitor } from '../structs/ChannelMonitor.mjs';
202 import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs';
203 import { Watch, WatchInterface } from '../structs/Watch.mjs';
204 import { BroadcasterInterface, BroadcasterInterfaceInterface } from '../structs/BroadcasterInterface.mjs';
205 import { KeysInterface, KeysInterfaceInterface } from '../structs/KeysInterface.mjs';
206 import { FeeEstimator, FeeEstimatorInterface } from '../structs/FeeEstimator.mjs';
207 import { ChannelManager } from '../structs/ChannelManager.mjs';
208 import { TwoTuple_BlockHashChannelManagerZ } from '../structs/TwoTuple_BlockHashChannelManagerZ.mjs';
209 import { Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mjs';
210 import { ChannelConfig } from '../structs/ChannelConfig.mjs';
211 import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs';
212 import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs';
213 import { Type, TypeInterface } from '../structs/Type.mjs';
214 import { Option_TypeZ } from '../structs/Option_TypeZ.mjs';
215 import { Result_COption_TypeZDecodeErrorZ } from '../structs/Result_COption_TypeZDecodeErrorZ.mjs';
216 import { PaymentError } from '../structs/PaymentError.mjs';
217 import { Result_PaymentIdPaymentErrorZ } from '../structs/Result_PaymentIdPaymentErrorZ.mjs';
218 import { InFlightHtlcs } from '../structs/InFlightHtlcs.mjs';
219 import { Result_InFlightHtlcsDecodeErrorZ } from '../structs/Result_InFlightHtlcsDecodeErrorZ.mjs';
220 import { ParseError } from '../structs/ParseError.mjs';
221 import { Result_SiPrefixParseErrorZ } from '../structs/Result_SiPrefixParseErrorZ.mjs';
222 import { Invoice } from '../structs/Invoice.mjs';
223 import { ParseOrSemanticError } from '../structs/ParseOrSemanticError.mjs';
224 import { Result_InvoiceParseOrSemanticErrorZ } from '../structs/Result_InvoiceParseOrSemanticErrorZ.mjs';
225 import { SignedRawInvoice } from '../structs/SignedRawInvoice.mjs';
226 import { Result_SignedRawInvoiceParseErrorZ } from '../structs/Result_SignedRawInvoiceParseErrorZ.mjs';
227 import { RawInvoice } from '../structs/RawInvoice.mjs';
228 import { InvoiceSignature } from '../structs/InvoiceSignature.mjs';
229 import { ThreeTuple_RawInvoice_u832InvoiceSignatureZ } from '../structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.mjs';
230 import { PayeePubKey } from '../structs/PayeePubKey.mjs';
231 import { Result_PayeePubKeyErrorZ } from '../structs/Result_PayeePubKeyErrorZ.mjs';
232 import { PrivateRoute } from '../structs/PrivateRoute.mjs';
233 import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs';
234 import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs';
235 import { Result_NoneSemanticErrorZ } from '../structs/Result_NoneSemanticErrorZ.mjs';
236 import { Result_InvoiceSemanticErrorZ } from '../structs/Result_InvoiceSemanticErrorZ.mjs';
237 import { Description } from '../structs/Description.mjs';
238 import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs';
239 import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs';
240 import { Result_StringErrorZ } from '../structs/Result_StringErrorZ.mjs';
241 import { Result_ChannelMonitorUpdateDecodeErrorZ } from '../structs/Result_ChannelMonitorUpdateDecodeErrorZ.mjs';
242 import { Option_MonitorEventZ } from '../structs/Option_MonitorEventZ.mjs';
243 import { Result_COption_MonitorEventZDecodeErrorZ } from '../structs/Result_COption_MonitorEventZDecodeErrorZ.mjs';
244 import { Result_HTLCUpdateDecodeErrorZ } from '../structs/Result_HTLCUpdateDecodeErrorZ.mjs';
245 import { TwoTuple_OutPointScriptZ } from '../structs/TwoTuple_OutPointScriptZ.mjs';
246 import { TwoTuple_u32ScriptZ } from '../structs/TwoTuple_u32ScriptZ.mjs';
247 import { TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mjs';
248 import { TwoTuple_u32TxOutZ } from '../structs/TwoTuple_u32TxOutZ.mjs';
249 import { TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ } from '../structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mjs';
250 import { Balance } from '../structs/Balance.mjs';
251 import { TwoTuple_BlockHashChannelMonitorZ } from '../structs/TwoTuple_BlockHashChannelMonitorZ.mjs';
252 import { Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mjs';
253 import { TwoTuple_PublicKeyTypeZ } from '../structs/TwoTuple_PublicKeyTypeZ.mjs';
254 import { Option_NetAddressZ } from '../structs/Option_NetAddressZ.mjs';
255 import { PeerHandleError } from '../structs/PeerHandleError.mjs';
256 import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs';
257 import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs';
258 import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs';
259 import { SendError } from '../structs/SendError.mjs';
260 import { Result_NoneSendErrorZ } from '../structs/Result_NoneSendErrorZ.mjs';
261 import { Result_NoneErrorZ } from '../structs/Result_NoneErrorZ.mjs';
262 import { Result_NetAddressDecodeErrorZ } from '../structs/Result_NetAddressDecodeErrorZ.mjs';
263 import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs';
264 import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs';
265 import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs';
266 import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs';
267 import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs';
268 import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs';
269 import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs';
270 import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs';
271 import { ClosingSignedFeeRange } from '../structs/ClosingSignedFeeRange.mjs';
272 import { Result_ClosingSignedFeeRangeDecodeErrorZ } from '../structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mjs';
273 import { CommitmentSigned } from '../structs/CommitmentSigned.mjs';
274 import { Result_CommitmentSignedDecodeErrorZ } from '../structs/Result_CommitmentSignedDecodeErrorZ.mjs';
275 import { Result_FundingCreatedDecodeErrorZ } from '../structs/Result_FundingCreatedDecodeErrorZ.mjs';
276 import { Result_FundingSignedDecodeErrorZ } from '../structs/Result_FundingSignedDecodeErrorZ.mjs';
277 import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyDecodeErrorZ.mjs';
278 import { Init } from '../structs/Init.mjs';
279 import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs';
280 import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs';
281 import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs';
282 import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
283 import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs';
284 import { Result_UpdateFailMalformedHTLCDecodeErrorZ } from '../structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mjs';
285 import { UpdateFee } from '../structs/UpdateFee.mjs';
286 import { Result_UpdateFeeDecodeErrorZ } from '../structs/Result_UpdateFeeDecodeErrorZ.mjs';
287 import { Result_UpdateFulfillHTLCDecodeErrorZ } from '../structs/Result_UpdateFulfillHTLCDecodeErrorZ.mjs';
288 import { Result_UpdateAddHTLCDecodeErrorZ } from '../structs/Result_UpdateAddHTLCDecodeErrorZ.mjs';
289 import { OnionMessage } from '../structs/OnionMessage.mjs';
290 import { Result_OnionMessageDecodeErrorZ } from '../structs/Result_OnionMessageDecodeErrorZ.mjs';
291 import { Ping } from '../structs/Ping.mjs';
292 import { Result_PingDecodeErrorZ } from '../structs/Result_PingDecodeErrorZ.mjs';
293 import { Pong } from '../structs/Pong.mjs';
294 import { Result_PongDecodeErrorZ } from '../structs/Result_PongDecodeErrorZ.mjs';
295 import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs';
296 import { Result_ChannelAnnouncementDecodeErrorZ } from '../structs/Result_ChannelAnnouncementDecodeErrorZ.mjs';
297 import { UnsignedChannelUpdate } from '../structs/UnsignedChannelUpdate.mjs';
298 import { Result_UnsignedChannelUpdateDecodeErrorZ } from '../structs/Result_UnsignedChannelUpdateDecodeErrorZ.mjs';
299 import { Result_ChannelUpdateDecodeErrorZ } from '../structs/Result_ChannelUpdateDecodeErrorZ.mjs';
300 import { Result_ErrorMessageDecodeErrorZ } from '../structs/Result_ErrorMessageDecodeErrorZ.mjs';
301 import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs';
302 import { UnsignedNodeAnnouncement } from '../structs/UnsignedNodeAnnouncement.mjs';
303 import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
304 import { NodeAnnouncement } from '../structs/NodeAnnouncement.mjs';
305 import { Result_NodeAnnouncementDecodeErrorZ } from '../structs/Result_NodeAnnouncementDecodeErrorZ.mjs';
306 import { Result_QueryShortChannelIdsDecodeErrorZ } from '../structs/Result_QueryShortChannelIdsDecodeErrorZ.mjs';
307 import { ReplyShortChannelIdsEnd } from '../structs/ReplyShortChannelIdsEnd.mjs';
308 import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mjs';
309 import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs';
310 import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs';
311 import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs';
312 import { SignOrCreationError } from '../structs/SignOrCreationError.mjs';
313 import { Result_InvoiceSignOrCreationErrorZ } from '../structs/Result_InvoiceSignOrCreationErrorZ.mjs';
314 import { WatchedOutput } from '../structs/WatchedOutput.mjs';
315 import { Filter, FilterInterface } from '../structs/Filter.mjs';
316 import { Option_FilterZ } from '../structs/Option_FilterZ.mjs';
317 import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs';
318 import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs';
319 import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs';
320 import { OnionMessageProvider, OnionMessageProviderInterface } from '../structs/OnionMessageProvider.mjs';
321 import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs';
322 import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs';
323 import { BigSize } from '../structs/BigSize.mjs';
324 import { ChannelUsage } from '../structs/ChannelUsage.mjs';
325 import { Score, ScoreInterface } from '../structs/Score.mjs';
326 import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs';
327 import { WriteableScore, WriteableScoreInterface } from '../structs/WriteableScore.mjs';
328 import { Persister, PersisterInterface } from '../structs/Persister.mjs';
329 import { FutureCallback, FutureCallbackInterface } from '../structs/FutureCallback.mjs';
330 import { Future } from '../structs/Future.mjs';
331 import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs';
332 import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs';
333 import { UserConfig } from '../structs/UserConfig.mjs';
334 import { BestBlock } from '../structs/BestBlock.mjs';
335 import { Listen, ListenInterface } from '../structs/Listen.mjs';
336 import { Confirm, ConfirmInterface } from '../structs/Confirm.mjs';
337 import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs';
338 import { Persist, PersistInterface } from '../structs/Persist.mjs';
339 import { ChainMonitor } from '../structs/ChainMonitor.mjs';
340 import { KeysManager } from '../structs/KeysManager.mjs';
341 import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs';
342 import { ChainParameters } from '../structs/ChainParameters.mjs';
343 import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs';
344 import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs';
345 import { ExpandedKey } from '../structs/ExpandedKey.mjs';
346 import { DataLossProtect } from '../structs/DataLossProtect.mjs';
347 import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs';
348 import { OnionMessageHandler, OnionMessageHandlerInterface } from '../structs/OnionMessageHandler.mjs';
349 import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs';
350 import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs';
351 import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs';
352 import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs';
353 import { MessageHandler } from '../structs/MessageHandler.mjs';
354 import { SocketDescriptor, SocketDescriptorInterface } from '../structs/SocketDescriptor.mjs';
355 import { PeerManager } from '../structs/PeerManager.mjs';
356 import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs';
357 import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs';
358 import { P2PGossipSync } from '../structs/P2PGossipSync.mjs';
359 import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs';
360 import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs';
361 import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs';
362 import { MultiThreadedScoreLock } from '../structs/MultiThreadedScoreLock.mjs';
363 import { ProbabilisticScoringParameters } from '../structs/ProbabilisticScoringParameters.mjs';
364 import { OnionMessenger } from '../structs/OnionMessenger.mjs';
365 import { Destination } from '../structs/Destination.mjs';
366 import { RawDataPart } from '../structs/RawDataPart.mjs';
367 import { Sha256 } from '../structs/Sha256.mjs';
368 import { ExpiryTime } from '../structs/ExpiryTime.mjs';
369 import { MinFinalCltvExpiry } from '../structs/MinFinalCltvExpiry.mjs';
370 import { Fallback } from '../structs/Fallback.mjs';
371 import { Payer, PayerInterface } from '../structs/Payer.mjs';
372 import { Router, RouterInterface } from '../structs/Router.mjs';
373 import { InvoicePayer } from '../structs/InvoicePayer.mjs';
374 import { Retry } from '../structs/Retry.mjs';
375 import { DefaultRouter } from '../structs/DefaultRouter.mjs';
376
377
378 import { CommonBase, UInt5, WitnessVersion, UnqualifiedError } from './CommonBase.mjs';
379 import * as bindings from '../bindings.mjs'
380
381
382
383 /** An implementation of BaseSign */
384 export interface BaseSignInterface {
385         /**Gets the per-commitment point for a specific commitment number
386          * 
387          * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
388          */
389         get_per_commitment_point(idx: bigint): Uint8Array;
390         /**Gets the commitment secret for a specific commitment number as part of the revocation process
391          * 
392          * An external signer implementation should error here if the commitment was already signed
393          * and should refuse to sign it in the future.
394          * 
395          * May be called more than once for the same index.
396          * 
397          * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
398          */
399         release_commitment_secret(idx: bigint): Uint8Array;
400         /**Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
401          * 
402          * This is required in order for the signer to make sure that releasing a commitment
403          * secret won't leave us without a broadcastable holder transaction.
404          * Policy checks should be implemented in this function, including checking the amount
405          * sent to us and checking the HTLCs.
406          * 
407          * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
408          * A validating signer should ensure that an HTLC output is removed only when the matching
409          * preimage is provided, or when the value to holder is restored.
410          * 
411          * NOTE: all the relevant preimages will be provided, but there may also be additional
412          * irrelevant or duplicate preimages.
413          */
414         validate_holder_commitment(holder_tx: HolderCommitmentTransaction, preimages: Uint8Array[]): Result_NoneNoneZ;
415         /**Gets an arbitrary identifier describing the set of keys which are provided back to you in
416          * some SpendableOutputDescriptor types. This should be sufficient to identify this
417          * Sign object uniquely and lookup or re-derive its keys.
418          */
419         channel_keys_id(): Uint8Array;
420         /**Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
421          * 
422          * Note that if signing fails or is rejected, the channel will be force-closed.
423          * 
424          * Policy checks should be implemented in this function, including checking the amount
425          * sent to us and checking the HTLCs.
426          * 
427          * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
428          * A validating signer should ensure that an HTLC output is removed only when the matching
429          * preimage is provided, or when the value to holder is restored.
430          * 
431          * NOTE: all the relevant preimages will be provided, but there may also be additional
432          * irrelevant or duplicate preimages.
433          */
434         sign_counterparty_commitment(commitment_tx: CommitmentTransaction, preimages: Uint8Array[]): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ;
435         /**Validate the counterparty's revocation.
436          * 
437          * This is required in order for the signer to make sure that the state has moved
438          * forward and it is safe to sign the next counterparty commitment.
439          */
440         validate_counterparty_revocation(idx: bigint, secret: Uint8Array): Result_NoneNoneZ;
441         /**Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
442          * This will only ever be called with a non-revoked commitment_tx.  This will be called with the
443          * latest commitment_tx when we initiate a force-close.
444          * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
445          * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
446          * the latest.
447          * This may be called multiple times for the same transaction.
448          * 
449          * An external signer implementation should check that the commitment has not been revoked.
450          * 
451          * May return Err if key derivation fails.  Callers, such as ChannelMonitor, will panic in such a case.
452          */
453         sign_holder_commitment_and_htlcs(commitment_tx: HolderCommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ;
454         /**Create a signature for the given input in a transaction spending an HTLC transaction output
455          * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
456          * 
457          * A justice transaction may claim multiple outputs at the same time if timelocks are
458          * similar, but only a signature for the input at index `input` should be signed for here.
459          * It may be called multiple times for same output(s) if a fee-bump is needed with regards
460          * to an upcoming timelock expiration.
461          * 
462          * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
463          * 
464          * per_commitment_key is revocation secret which was provided by our counterparty when they
465          * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
466          * not allow the spending of any funds by itself (you need our holder revocation_secret to do
467          * so).
468          */
469         sign_justice_revoked_output(justice_tx: Uint8Array, input: number, amount: bigint, per_commitment_key: Uint8Array): Result_SignatureNoneZ;
470         /**Create a signature for the given input in a transaction spending a commitment transaction
471          * HTLC output when our counterparty broadcasts an old state.
472          * 
473          * A justice transaction may claim multiple outputs at the same time if timelocks are
474          * similar, but only a signature for the input at index `input` should be signed for here.
475          * It may be called multiple times for same output(s) if a fee-bump is needed with regards
476          * to an upcoming timelock expiration.
477          * 
478          * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
479          * 
480          * per_commitment_key is revocation secret which was provided by our counterparty when they
481          * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
482          * not allow the spending of any funds by itself (you need our holder revocation_secret to do
483          * so).
484          * 
485          * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
486          * (which is committed to in the BIP 143 signatures).
487          */
488         sign_justice_revoked_htlc(justice_tx: Uint8Array, input: number, amount: bigint, per_commitment_key: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ;
489         /**Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
490          * transaction, either offered or received.
491          * 
492          * Such a transaction may claim multiples offered outputs at same time if we know the
493          * preimage for each when we create it, but only the input at index `input` should be
494          * signed for here. It may be called multiple times for same output(s) if a fee-bump is
495          * needed with regards to an upcoming timelock expiration.
496          * 
497          * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
498          * outputs.
499          * 
500          * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
501          * 
502          * Per_commitment_point is the dynamic point corresponding to the channel state
503          * detected onchain. It has been generated by our counterparty and is used to derive
504          * channel state keys, which are then included in the witness script and committed to in the
505          * BIP 143 signature.
506          */
507         sign_counterparty_htlc_transaction(htlc_tx: Uint8Array, input: number, amount: bigint, per_commitment_point: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ;
508         /**Create a signature for a (proposed) closing transaction.
509          * 
510          * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
511          * chosen to forgo their output as dust.
512          */
513         sign_closing_transaction(closing_tx: ClosingTransaction): Result_SignatureNoneZ;
514         /**Signs a channel announcement message with our funding key and our node secret key (aka
515          * node_id or network_key), proving it comes from one of the channel participants.
516          * 
517          * The first returned signature should be from our node secret key, the second from our
518          * funding key.
519          * 
520          * Note that if this fails or is rejected, the channel will not be publicly announced and
521          * our counterparty may (though likely will not) close the channel on us for violating the
522          * protocol.
523          */
524         sign_channel_announcement(msg: UnsignedChannelAnnouncement): Result_C2Tuple_SignatureSignatureZNoneZ;
525         /**Set the counterparty static channel data, including basepoints,
526          * counterparty_selected/holder_selected_contest_delay and funding outpoint.
527          * This is done as soon as the funding outpoint is known.  Since these are static channel data,
528          * they MUST NOT be allowed to change to different values once set.
529          * 
530          * channel_parameters.is_populated() MUST be true.
531          * 
532          * We bind holder_selected_contest_delay late here for API convenience.
533          * 
534          * Will be called before any signatures are applied.
535          */
536         ready_channel(channel_parameters: ChannelTransactionParameters): void;
537 }
538
539 class LDKBaseSignHolder {
540         held: BaseSign;
541 }
542
543 /**
544  * A trait to sign lightning channel transactions as described in BOLT 3.
545  * 
546  * Signing services could be implemented on a hardware wallet. In this case,
547  * the current Sign would be a front-end on top of a communication
548  * channel connected to your secure device and lightning key material wouldn't
549  * reside on a hot server. Nevertheless, a this deployment would still need
550  * to trust the ChannelManager to avoid loss of funds as this latest component
551  * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
552  * 
553  * A more secure iteration would be to use hashlock (or payment points) to pair
554  * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
555  * at the price of more state and computation on the hardware wallet side. In the future,
556  * we are looking forward to design such interface.
557  * 
558  * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
559  * to act, as liveness and breach reply correctness are always going to be hard requirements
560  * of LN security model, orthogonal of key management issues.
561  */
562 export class BaseSign extends CommonBase {
563         /* @internal */
564         public bindings_instance?: bindings.LDKBaseSign;
565
566         /* @internal */
567         public instance_idx?: number;
568
569         /* @internal */
570         constructor(_dummy: object, ptr: bigint) {
571                 super(ptr, bindings.BaseSign_free);
572                 this.bindings_instance = null;
573         }
574
575         /** Creates a new instance of BaseSign from a given implementation */
576         public static new_impl(arg: BaseSignInterface, pubkeys: ChannelPublicKeys): BaseSign {
577                 const impl_holder: LDKBaseSignHolder = new LDKBaseSignHolder();
578                 let structImplementation = {
579                         get_per_commitment_point (idx: bigint): number {
580                                 const ret: Uint8Array = arg.get_per_commitment_point(idx);
581                                 const result: number = bindings.encodeUint8Array(bindings.check_arr_len(ret, 33));
582                                 return result;
583                         },
584                         release_commitment_secret (idx: bigint): number {
585                                 const ret: Uint8Array = arg.release_commitment_secret(idx);
586                                 const result: number = bindings.encodeUint8Array(bindings.check_arr_len(ret, 32));
587                                 return result;
588                         },
589                         validate_holder_commitment (holder_tx: bigint, preimages: number): bigint {
590                                 const holder_tx_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, holder_tx);
591                                 const preimages_conv_12_len: number = bindings.getArrayLength(preimages);
592                                 const preimages_conv_12_arr: Uint8Array[] = new Array(preimages_conv_12_len).fill(null);
593                                 for (var m = 0; m < preimages_conv_12_len; m++) {
594                                         const preimages_conv_12: number = bindings.getU32ArrayElem(preimages, m);
595                                         const preimages_conv_12_conv: Uint8Array = bindings.decodeUint8Array(preimages_conv_12);
596                                         preimages_conv_12_arr[m] = preimages_conv_12_conv;
597                                 }
598                                 bindings.freeWasmMemory(preimages)
599                                 const ret: Result_NoneNoneZ = arg.validate_holder_commitment(holder_tx_hu_conv, preimages_conv_12_arr);
600                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
601                                 return result;
602                         },
603                         channel_keys_id (): number {
604                                 const ret: Uint8Array = arg.channel_keys_id();
605                                 const result: number = bindings.encodeUint8Array(bindings.check_arr_len(ret, 32));
606                                 return result;
607                         },
608                         sign_counterparty_commitment (commitment_tx: bigint, preimages: number): bigint {
609                                 const commitment_tx_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, commitment_tx);
610                                 const preimages_conv_12_len: number = bindings.getArrayLength(preimages);
611                                 const preimages_conv_12_arr: Uint8Array[] = new Array(preimages_conv_12_len).fill(null);
612                                 for (var m = 0; m < preimages_conv_12_len; m++) {
613                                         const preimages_conv_12: number = bindings.getU32ArrayElem(preimages, m);
614                                         const preimages_conv_12_conv: Uint8Array = bindings.decodeUint8Array(preimages_conv_12);
615                                         preimages_conv_12_arr[m] = preimages_conv_12_conv;
616                                 }
617                                 bindings.freeWasmMemory(preimages)
618                                 const ret: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = arg.sign_counterparty_commitment(commitment_tx_hu_conv, preimages_conv_12_arr);
619                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
620                                 return result;
621                         },
622                         validate_counterparty_revocation (idx: bigint, secret: number): bigint {
623                                 const secret_conv: Uint8Array = bindings.decodeUint8Array(secret);
624                                 const ret: Result_NoneNoneZ = arg.validate_counterparty_revocation(idx, secret_conv);
625                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
626                                 return result;
627                         },
628                         sign_holder_commitment_and_htlcs (commitment_tx: bigint): bigint {
629                                 const commitment_tx_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, commitment_tx);
630                                 const ret: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv);
631                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
632                                 return result;
633                         },
634                         sign_justice_revoked_output (justice_tx: number, input: number, amount: bigint, per_commitment_key: number): bigint {
635                                 const justice_tx_conv: Uint8Array = bindings.decodeUint8Array(justice_tx);
636                                 const per_commitment_key_conv: Uint8Array = bindings.decodeUint8Array(per_commitment_key);
637                                 const ret: Result_SignatureNoneZ = arg.sign_justice_revoked_output(justice_tx_conv, input, amount, per_commitment_key_conv);
638                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
639                                 return result;
640                         },
641                         sign_justice_revoked_htlc (justice_tx: number, input: number, amount: bigint, per_commitment_key: number, htlc: bigint): bigint {
642                                 const justice_tx_conv: Uint8Array = bindings.decodeUint8Array(justice_tx);
643                                 const per_commitment_key_conv: Uint8Array = bindings.decodeUint8Array(per_commitment_key);
644                                 const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc);
645                                 const ret: Result_SignatureNoneZ = arg.sign_justice_revoked_htlc(justice_tx_conv, input, amount, per_commitment_key_conv, htlc_hu_conv);
646                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
647                                 return result;
648                         },
649                         sign_counterparty_htlc_transaction (htlc_tx: number, input: number, amount: bigint, per_commitment_point: number, htlc: bigint): bigint {
650                                 const htlc_tx_conv: Uint8Array = bindings.decodeUint8Array(htlc_tx);
651                                 const per_commitment_point_conv: Uint8Array = bindings.decodeUint8Array(per_commitment_point);
652                                 const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc);
653                                 const ret: Result_SignatureNoneZ = arg.sign_counterparty_htlc_transaction(htlc_tx_conv, input, amount, per_commitment_point_conv, htlc_hu_conv);
654                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
655                                 return result;
656                         },
657                         sign_closing_transaction (closing_tx: bigint): bigint {
658                                 const closing_tx_hu_conv: ClosingTransaction = new ClosingTransaction(null, closing_tx);
659                                 const ret: Result_SignatureNoneZ = arg.sign_closing_transaction(closing_tx_hu_conv);
660                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
661                                 return result;
662                         },
663                         sign_channel_announcement (msg: bigint): bigint {
664                                 const msg_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, msg);
665                                 const ret: Result_C2Tuple_SignatureSignatureZNoneZ = arg.sign_channel_announcement(msg_hu_conv);
666                                 const result: bigint = ret == null ? 0n : ret.clone_ptr();
667                                 return result;
668                         },
669                         ready_channel (channel_parameters: bigint): void {
670                                 const channel_parameters_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, channel_parameters);
671                                 arg.ready_channel(channel_parameters_hu_conv);
672                         },
673                 } as bindings.LDKBaseSign;
674                 const ptr_idx: [bigint, number] = bindings.LDKBaseSign_new(structImplementation, pubkeys == null ? 0n : pubkeys.clone_ptr());
675
676                 impl_holder.held = new BaseSign(null, ptr_idx[0]);
677                 impl_holder.held.instance_idx = ptr_idx[1];
678                 impl_holder.held.bindings_instance = structImplementation;
679                 return impl_holder.held;
680         }
681
682         /**
683          * Gets the per-commitment point for a specific commitment number
684          * 
685          * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
686          */
687         public get_per_commitment_point(idx: bigint): Uint8Array {
688                 const ret: number = bindings.BaseSign_get_per_commitment_point(this.ptr, idx);
689                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
690                 return ret_conv;
691         }
692
693         /**
694          * Gets the commitment secret for a specific commitment number as part of the revocation process
695          * 
696          * An external signer implementation should error here if the commitment was already signed
697          * and should refuse to sign it in the future.
698          * 
699          * May be called more than once for the same index.
700          * 
701          * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
702          */
703         public release_commitment_secret(idx: bigint): Uint8Array {
704                 const ret: number = bindings.BaseSign_release_commitment_secret(this.ptr, idx);
705                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
706                 return ret_conv;
707         }
708
709         /**
710          * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
711          * 
712          * This is required in order for the signer to make sure that releasing a commitment
713          * secret won't leave us without a broadcastable holder transaction.
714          * Policy checks should be implemented in this function, including checking the amount
715          * sent to us and checking the HTLCs.
716          * 
717          * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
718          * A validating signer should ensure that an HTLC output is removed only when the matching
719          * preimage is provided, or when the value to holder is restored.
720          * 
721          * NOTE: all the relevant preimages will be provided, but there may also be additional
722          * irrelevant or duplicate preimages.
723          */
724         public validate_holder_commitment(holder_tx: HolderCommitmentTransaction, preimages: Uint8Array[]): Result_NoneNoneZ {
725                 const ret: bigint = bindings.BaseSign_validate_holder_commitment(this.ptr, holder_tx == null ? 0n : CommonBase.get_ptr_of(holder_tx), bindings.encodeUint32Array(preimages != null ? preimages.map(preimages_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(preimages_conv_12, 32))) : null));
726                 const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret);
727                 CommonBase.add_ref_from(this, holder_tx);
728                 return ret_hu_conv;
729         }
730
731         /**
732          * Gets an arbitrary identifier describing the set of keys which are provided back to you in
733          * some SpendableOutputDescriptor types. This should be sufficient to identify this
734          * Sign object uniquely and lookup or re-derive its keys.
735          */
736         public channel_keys_id(): Uint8Array {
737                 const ret: number = bindings.BaseSign_channel_keys_id(this.ptr);
738                 const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
739                 return ret_conv;
740         }
741
742         /**
743          * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
744          * 
745          * Note that if signing fails or is rejected, the channel will be force-closed.
746          * 
747          * Policy checks should be implemented in this function, including checking the amount
748          * sent to us and checking the HTLCs.
749          * 
750          * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
751          * A validating signer should ensure that an HTLC output is removed only when the matching
752          * preimage is provided, or when the value to holder is restored.
753          * 
754          * NOTE: all the relevant preimages will be provided, but there may also be additional
755          * irrelevant or duplicate preimages.
756          */
757         public sign_counterparty_commitment(commitment_tx: CommitmentTransaction, preimages: Uint8Array[]): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ {
758                 const ret: bigint = bindings.BaseSign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0n : CommonBase.get_ptr_of(commitment_tx), bindings.encodeUint32Array(preimages != null ? preimages.map(preimages_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(preimages_conv_12, 32))) : null));
759                 const ret_hu_conv: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
760                 CommonBase.add_ref_from(this, commitment_tx);
761                 return ret_hu_conv;
762         }
763
764         /**
765          * Validate the counterparty's revocation.
766          * 
767          * This is required in order for the signer to make sure that the state has moved
768          * forward and it is safe to sign the next counterparty commitment.
769          */
770         public validate_counterparty_revocation(idx: bigint, secret: Uint8Array): Result_NoneNoneZ {
771                 const ret: bigint = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, bindings.encodeUint8Array(bindings.check_arr_len(secret, 32)));
772                 const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret);
773                 return ret_hu_conv;
774         }
775
776         /**
777          * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
778          * This will only ever be called with a non-revoked commitment_tx.  This will be called with the
779          * latest commitment_tx when we initiate a force-close.
780          * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
781          * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
782          * the latest.
783          * This may be called multiple times for the same transaction.
784          * 
785          * An external signer implementation should check that the commitment has not been revoked.
786          * 
787          * May return Err if key derivation fails.  Callers, such as ChannelMonitor, will panic in such a case.
788          */
789         public sign_holder_commitment_and_htlcs(commitment_tx: HolderCommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ {
790                 const ret: bigint = bindings.BaseSign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0n : CommonBase.get_ptr_of(commitment_tx));
791                 const ret_hu_conv: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
792                 CommonBase.add_ref_from(this, commitment_tx);
793                 return ret_hu_conv;
794         }
795
796         /**
797          * Create a signature for the given input in a transaction spending an HTLC transaction output
798          * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
799          * 
800          * A justice transaction may claim multiple outputs at the same time if timelocks are
801          * similar, but only a signature for the input at index `input` should be signed for here.
802          * It may be called multiple times for same output(s) if a fee-bump is needed with regards
803          * to an upcoming timelock expiration.
804          * 
805          * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
806          * 
807          * per_commitment_key is revocation secret which was provided by our counterparty when they
808          * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
809          * not allow the spending of any funds by itself (you need our holder revocation_secret to do
810          * so).
811          */
812         public sign_justice_revoked_output(justice_tx: Uint8Array, input: number, amount: bigint, per_commitment_key: Uint8Array): Result_SignatureNoneZ {
813                 const ret: bigint = bindings.BaseSign_sign_justice_revoked_output(this.ptr, bindings.encodeUint8Array(justice_tx), input, amount, bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_key, 32)));
814                 const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret);
815                 return ret_hu_conv;
816         }
817
818         /**
819          * Create a signature for the given input in a transaction spending a commitment transaction
820          * HTLC output when our counterparty broadcasts an old state.
821          * 
822          * A justice transaction may claim multiple outputs at the same time if timelocks are
823          * similar, but only a signature for the input at index `input` should be signed for here.
824          * It may be called multiple times for same output(s) if a fee-bump is needed with regards
825          * to an upcoming timelock expiration.
826          * 
827          * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
828          * 
829          * per_commitment_key is revocation secret which was provided by our counterparty when they
830          * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
831          * not allow the spending of any funds by itself (you need our holder revocation_secret to do
832          * so).
833          * 
834          * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
835          * (which is committed to in the BIP 143 signatures).
836          */
837         public sign_justice_revoked_htlc(justice_tx: Uint8Array, input: number, amount: bigint, per_commitment_key: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ {
838                 const ret: bigint = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, bindings.encodeUint8Array(justice_tx), input, amount, bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_key, 32)), htlc == null ? 0n : CommonBase.get_ptr_of(htlc));
839                 const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret);
840                 CommonBase.add_ref_from(this, htlc);
841                 return ret_hu_conv;
842         }
843
844         /**
845          * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
846          * transaction, either offered or received.
847          * 
848          * Such a transaction may claim multiples offered outputs at same time if we know the
849          * preimage for each when we create it, but only the input at index `input` should be
850          * signed for here. It may be called multiple times for same output(s) if a fee-bump is
851          * needed with regards to an upcoming timelock expiration.
852          * 
853          * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
854          * outputs.
855          * 
856          * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
857          * 
858          * Per_commitment_point is the dynamic point corresponding to the channel state
859          * detected onchain. It has been generated by our counterparty and is used to derive
860          * channel state keys, which are then included in the witness script and committed to in the
861          * BIP 143 signature.
862          */
863         public sign_counterparty_htlc_transaction(htlc_tx: Uint8Array, input: number, amount: bigint, per_commitment_point: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ {
864                 const ret: bigint = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, bindings.encodeUint8Array(htlc_tx), input, amount, bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), htlc == null ? 0n : CommonBase.get_ptr_of(htlc));
865                 const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret);
866                 CommonBase.add_ref_from(this, htlc);
867                 return ret_hu_conv;
868         }
869
870         /**
871          * Create a signature for a (proposed) closing transaction.
872          * 
873          * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
874          * chosen to forgo their output as dust.
875          */
876         public sign_closing_transaction(closing_tx: ClosingTransaction): Result_SignatureNoneZ {
877                 const ret: bigint = bindings.BaseSign_sign_closing_transaction(this.ptr, closing_tx == null ? 0n : CommonBase.get_ptr_of(closing_tx));
878                 const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret);
879                 CommonBase.add_ref_from(this, closing_tx);
880                 return ret_hu_conv;
881         }
882
883         /**
884          * Signs a channel announcement message with our funding key and our node secret key (aka
885          * node_id or network_key), proving it comes from one of the channel participants.
886          * 
887          * The first returned signature should be from our node secret key, the second from our
888          * funding key.
889          * 
890          * Note that if this fails or is rejected, the channel will not be publicly announced and
891          * our counterparty may (though likely will not) close the channel on us for violating the
892          * protocol.
893          */
894         public sign_channel_announcement(msg: UnsignedChannelAnnouncement): Result_C2Tuple_SignatureSignatureZNoneZ {
895                 const ret: bigint = bindings.BaseSign_sign_channel_announcement(this.ptr, msg == null ? 0n : CommonBase.get_ptr_of(msg));
896                 const ret_hu_conv: Result_C2Tuple_SignatureSignatureZNoneZ = Result_C2Tuple_SignatureSignatureZNoneZ.constr_from_ptr(ret);
897                 CommonBase.add_ref_from(this, msg);
898                 return ret_hu_conv;
899         }
900
901         /**
902          * Set the counterparty static channel data, including basepoints,
903          * counterparty_selected/holder_selected_contest_delay and funding outpoint.
904          * This is done as soon as the funding outpoint is known.  Since these are static channel data,
905          * they MUST NOT be allowed to change to different values once set.
906          * 
907          * channel_parameters.is_populated() MUST be true.
908          * 
909          * We bind holder_selected_contest_delay late here for API convenience.
910          * 
911          * Will be called before any signatures are applied.
912          */
913         public ready_channel(channel_parameters: ChannelTransactionParameters): void {
914                 bindings.BaseSign_ready_channel(this.ptr, channel_parameters == null ? 0n : CommonBase.get_ptr_of(channel_parameters));
915                 CommonBase.add_ref_from(this, channel_parameters);
916         }
917
918         /**
919          * Frees any resources associated with this object given its this_arg pointer.
920          * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
921          */
922         public get_pubkeys(): ChannelPublicKeys {
923                 const ret: bigint = bindings.BaseSign_get_pubkeys(this.ptr);
924                 const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret);
925                 CommonBase.add_ref_from(ret_hu_conv, this);
926                 return ret_hu_conv;
927         }
928
929 }