cc60687eb4030fe31af1566e135f190410347582
[ldk-c-bindings] / lightning-c-bindings / include / lightning.h
1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
3
4 /* Generated with cbindgen:0.24.5 */
5
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
7
8 #include <stdarg.h>
9 #include <stdbool.h>
10 #include <stdint.h>
11 #include "ldk_rust_types.h"
12
13 /**
14  * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
15  * the requirements sections in BOLT #11
16  */
17 typedef enum LDKBolt11SemanticError {
18    /**
19     * The invoice is missing the mandatory payment hash
20     */
21    LDKBolt11SemanticError_NoPaymentHash,
22    /**
23     * The invoice has multiple payment hashes which isn't allowed
24     */
25    LDKBolt11SemanticError_MultiplePaymentHashes,
26    /**
27     * No description or description hash are part of the invoice
28     */
29    LDKBolt11SemanticError_NoDescription,
30    /**
31     * The invoice contains multiple descriptions and/or description hashes which isn't allowed
32     */
33    LDKBolt11SemanticError_MultipleDescriptions,
34    /**
35     * The invoice is missing the mandatory payment secret, which all modern lightning nodes
36     * should provide.
37     */
38    LDKBolt11SemanticError_NoPaymentSecret,
39    /**
40     * The invoice contains multiple payment secrets
41     */
42    LDKBolt11SemanticError_MultiplePaymentSecrets,
43    /**
44     * The invoice's features are invalid
45     */
46    LDKBolt11SemanticError_InvalidFeatures,
47    /**
48     * The recovery id doesn't fit the signature/pub key
49     */
50    LDKBolt11SemanticError_InvalidRecoveryId,
51    /**
52     * The invoice's signature is invalid
53     */
54    LDKBolt11SemanticError_InvalidSignature,
55    /**
56     * The invoice's amount was not a whole number of millisatoshis
57     */
58    LDKBolt11SemanticError_ImpreciseAmount,
59    /**
60     * Must be last for serialization purposes
61     */
62    LDKBolt11SemanticError_Sentinel,
63 } LDKBolt11SemanticError;
64
65 /**
66  * Error when interpreting a TLV stream as a specific type.
67  */
68 typedef enum LDKBolt12SemanticError {
69    /**
70     * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
71     */
72    LDKBolt12SemanticError_AlreadyExpired,
73    /**
74     * The provided chain hash does not correspond to a supported chain.
75     */
76    LDKBolt12SemanticError_UnsupportedChain,
77    /**
78     * A chain was provided but was not expected.
79     */
80    LDKBolt12SemanticError_UnexpectedChain,
81    /**
82     * An amount was expected but was missing.
83     */
84    LDKBolt12SemanticError_MissingAmount,
85    /**
86     * The amount exceeded the total bitcoin supply.
87     */
88    LDKBolt12SemanticError_InvalidAmount,
89    /**
90     * An amount was provided but was not sufficient in value.
91     */
92    LDKBolt12SemanticError_InsufficientAmount,
93    /**
94     * An amount was provided but was not expected.
95     */
96    LDKBolt12SemanticError_UnexpectedAmount,
97    /**
98     * A currency was provided that is not supported.
99     */
100    LDKBolt12SemanticError_UnsupportedCurrency,
101    /**
102     * A feature was required but is unknown.
103     */
104    LDKBolt12SemanticError_UnknownRequiredFeatures,
105    /**
106     * Features were provided but were not expected.
107     */
108    LDKBolt12SemanticError_UnexpectedFeatures,
109    /**
110     * A required description was not provided.
111     */
112    LDKBolt12SemanticError_MissingDescription,
113    /**
114     * A signing pubkey was not provided.
115     */
116    LDKBolt12SemanticError_MissingSigningPubkey,
117    /**
118     * A signing pubkey was provided but a different one was expected.
119     */
120    LDKBolt12SemanticError_InvalidSigningPubkey,
121    /**
122     * A signing pubkey was provided but was not expected.
123     */
124    LDKBolt12SemanticError_UnexpectedSigningPubkey,
125    /**
126     * A quantity was expected but was missing.
127     */
128    LDKBolt12SemanticError_MissingQuantity,
129    /**
130     * An unsupported quantity was provided.
131     */
132    LDKBolt12SemanticError_InvalidQuantity,
133    /**
134     * A quantity or quantity bounds was provided but was not expected.
135     */
136    LDKBolt12SemanticError_UnexpectedQuantity,
137    /**
138     * Metadata could not be used to verify the offers message.
139     */
140    LDKBolt12SemanticError_InvalidMetadata,
141    /**
142     * Metadata was provided but was not expected.
143     */
144    LDKBolt12SemanticError_UnexpectedMetadata,
145    /**
146     * Payer metadata was expected but was missing.
147     */
148    LDKBolt12SemanticError_MissingPayerMetadata,
149    /**
150     * A payer id was expected but was missing.
151     */
152    LDKBolt12SemanticError_MissingPayerId,
153    /**
154     * The payment id for a refund or request is already in use.
155     */
156    LDKBolt12SemanticError_DuplicatePaymentId,
157    /**
158     * Blinded paths were expected but were missing.
159     */
160    LDKBolt12SemanticError_MissingPaths,
161    /**
162     * The blinded payinfo given does not match the number of blinded path hops.
163     */
164    LDKBolt12SemanticError_InvalidPayInfo,
165    /**
166     * An invoice creation time was expected but was missing.
167     */
168    LDKBolt12SemanticError_MissingCreationTime,
169    /**
170     * An invoice payment hash was expected but was missing.
171     */
172    LDKBolt12SemanticError_MissingPaymentHash,
173    /**
174     * A signature was expected but was missing.
175     */
176    LDKBolt12SemanticError_MissingSignature,
177    /**
178     * Must be last for serialization purposes
179     */
180    LDKBolt12SemanticError_Sentinel,
181 } LDKBolt12SemanticError;
182
183 /**
184  * An enum which can either contain a  or not
185  */
186 typedef enum LDKCOption_NoneZ {
187    /**
188     * When we're in this state, this COption_NoneZ contains a
189     */
190    LDKCOption_NoneZ_Some,
191    /**
192     * When we're in this state, this COption_NoneZ contains nothing
193     */
194    LDKCOption_NoneZ_None,
195    /**
196     * Must be last for serialization purposes
197     */
198    LDKCOption_NoneZ_Sentinel,
199 } LDKCOption_NoneZ;
200
201 /**
202  * An enum representing the status of a channel monitor update persistence.
203  *
204  * These are generally used as the return value for an implementation of [`Persist`] which is used
205  * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
206  * explanation of how to handle different cases.
207  *
208  * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
209  * calling side, and generally results in an immediate panic. For those who prefer to avoid
210  * panics, `InProgress` can be used and you can retry the update operation in the background or
211  * shut down cleanly.
212  *
213  * Note that channels should generally *not* be force-closed after a persistence failure.
214  * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
215  * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
216  * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
217  * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
218  *
219  * [`Persist`]: chainmonitor::Persist
220  * [`ChainMonitor`]: chainmonitor::ChainMonitor
221  * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
222  */
223 typedef enum LDKChannelMonitorUpdateStatus {
224    /**
225     * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
226     * have been updated.
227     *
228     * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
229     * be available on restart even if the application crashes.
230     */
231    LDKChannelMonitorUpdateStatus_Completed,
232    /**
233     * Indicates that the update will happen asynchronously in the background or that a transient
234     * failure occurred which is being retried in the background and will eventually complete.
235     *
236     * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
237     * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
238     * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
239     * operational state.
240     *
241     * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
242     * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
243     * attempting to claim it on this channel) and those updates must still be persisted.
244     *
245     * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
246     * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
247     * monitor update for the same channel.
248     *
249     * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
250     * a remote location (with local copies persisted immediately), it is anticipated that all
251     * updates will return [`InProgress`] until the remote copies could be updated.
252     *
253     * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
254     * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
255     * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
256     *
257     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
258     */
259    LDKChannelMonitorUpdateStatus_InProgress,
260    /**
261     * Indicates that an update has failed and will not complete at any point in the future.
262     *
263     * Currently returning this variant will cause LDK to immediately panic to encourage immediate
264     * shutdown. In the future this may be updated to disconnect peers and refuse to continue
265     * normal operation without a panic.
266     *
267     * Applications which wish to perform an orderly shutdown after failure should consider
268     * returning [`InProgress`] instead and simply shut down without ever marking the update
269     * complete.
270     *
271     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
272     */
273    LDKChannelMonitorUpdateStatus_UnrecoverableError,
274    /**
275     * Must be last for serialization purposes
276     */
277    LDKChannelMonitorUpdateStatus_Sentinel,
278 } LDKChannelMonitorUpdateStatus;
279
280 /**
281  * Further information on the details of the channel shutdown.
282  * Upon channels being forced closed (i.e. commitment transaction confirmation detected
283  * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
284  * the channel will be removed shortly.
285  * Also note, that in normal operation, peers could disconnect at any of these states
286  * and require peer re-connection before making progress onto other states
287  */
288 typedef enum LDKChannelShutdownState {
289    /**
290     * Channel has not sent or received a shutdown message.
291     */
292    LDKChannelShutdownState_NotShuttingDown,
293    /**
294     * Local node has sent a shutdown message for this channel.
295     */
296    LDKChannelShutdownState_ShutdownInitiated,
297    /**
298     * Shutdown message exchanges have concluded and the channels are in the midst of
299     * resolving all existing open HTLCs before closing can continue.
300     */
301    LDKChannelShutdownState_ResolvingHTLCs,
302    /**
303     * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
304     */
305    LDKChannelShutdownState_NegotiatingClosingFee,
306    /**
307     * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
308     * to drop the channel.
309     */
310    LDKChannelShutdownState_ShutdownComplete,
311    /**
312     * Must be last for serialization purposes
313     */
314    LDKChannelShutdownState_Sentinel,
315 } LDKChannelShutdownState;
316
317 /**
318  * An enum that represents the priority at which we want a transaction to confirm used for feerate
319  * estimation.
320  */
321 typedef enum LDKConfirmationTarget {
322    /**
323     * We have some funds available on chain which we need to spend prior to some expiry time at
324     * which point our counterparty may be able to steal them. Generally we have in the high tens
325     * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a
326     * fee - this should be a relatively high priority feerate.
327     */
328    LDKConfirmationTarget_OnChainSweep,
329    /**
330     * The highest feerate we will allow our channel counterparty to have in a non-anchor channel.
331     *
332     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
333     * order to close the channel unilaterally. Because our counterparty must ensure they can
334     * always broadcast the latest state, this value being too low will cause immediate
335     * force-closures.
336     *
337     * Allowing this value to be too high can allow our counterparty to burn our HTLC outputs to
338     * dust, which can result in HTLCs failing or force-closures (when the dust HTLCs exceed
339     * [`ChannelConfig::max_dust_htlc_exposure`]).
340     *
341     * Because most nodes use a feerate estimate which is based on a relatively high priority
342     * transaction entering the current mempool, setting this to a small multiple of your current
343     * high priority feerate estimate should suffice.
344     *
345     * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
346     */
347    LDKConfirmationTarget_MaxAllowedNonAnchorChannelRemoteFee,
348    /**
349     * This is the lowest feerate we will allow our channel counterparty to have in an anchor
350     * channel in order to close the channel if a channel party goes away.
351     *
352     * This needs to be sufficient to get into the mempool when the channel needs to
353     * be force-closed. Setting too high may result in force-closures if our counterparty attempts
354     * to use a lower feerate. Because this is for anchor channels, we can always bump the feerate
355     * later; the feerate here only needs to be sufficient to enter the mempool.
356     *
357     * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
358     * is not an estimate which is very easy to calculate because we do not know the future. Using
359     * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
360     * ensure you can always close the channel. A future change to Bitcoin's P2P network
361     * (package relay) may obviate the need for this entirely.
362     */
363    LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee,
364    /**
365     * The lowest feerate we will allow our channel counterparty to have in a non-anchor channel.
366     *
367     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
368     * order to close the channel if a channel party goes away. Setting this value too high will
369     * cause immediate force-closures in order to avoid having an unbroadcastable state.
370     *
371     * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
372     * arbitrary time in the future. Obviously this is not an estimate which is very easy to
373     * calculate. This can leave channels subject to being unable to close if feerates rise, and in
374     * general you should prefer anchor channels to ensure you can increase the feerate when the
375     * transactions need broadcasting.
376     *
377     * Do note some fee estimators round up to the next full sat/vbyte (ie 250 sats per kw),
378     * causing occasional issues with feerate disagreements between an initiator that wants a
379     * feerate of 1.1 sat/vbyte and a receiver that wants 1.1 rounded up to 2. If your fee
380     * estimator rounds subtracting 250 to your desired feerate here can help avoid this issue.
381     *
382     * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
383     */
384    LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee,
385    /**
386     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
387     * order to close the channel if a channel party goes away.
388     *
389     * This needs to be sufficient to get into the mempool when the channel needs to
390     * be force-closed. Setting too low may result in force-closures. Because this is for anchor
391     * channels, it can be a low value as we can always bump the feerate later.
392     *
393     * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
394     * is not an estimate which is very easy to calculate because we do not know the future. Using
395     * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
396     * ensure you can always close the channel. A future change to Bitcoin's P2P network
397     * (package relay) may obviate the need for this entirely.
398     */
399    LDKConfirmationTarget_AnchorChannelFee,
400    /**
401     * Lightning is built around the ability to broadcast a transaction in the future to close our
402     * channel and claim all pending funds. In order to do so, non-anchor channels are built with
403     * transactions which we need to be able to broadcast at some point in the future.
404     *
405     * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
406     * arbitrary time in the future. Obviously this is not an estimate which is very easy to
407     * calculate, so most lightning nodes use some relatively high-priority feerate using the
408     * current mempool. This leaves channels subject to being unable to close if feerates rise, and
409     * in general you should prefer anchor channels to ensure you can increase the feerate when the
410     * transactions need broadcasting.
411     *
412     * Since this should represent the feerate of a channel close that does not need fee
413     * bumping, this is also used as an upper bound for our attempted feerate when doing cooperative
414     * closure of any channel.
415     */
416    LDKConfirmationTarget_NonAnchorChannelFee,
417    /**
418     * When cooperatively closing a channel, this is the minimum feerate we will accept.
419     * Recommended at least within a day or so worth of blocks.
420     *
421     * This will also be used when initiating a cooperative close of a channel. When closing a
422     * channel you can override this fee by using
423     * [`ChannelManager::close_channel_with_feerate_and_script`].
424     *
425     * [`ChannelManager::close_channel_with_feerate_and_script`]: crate::ln::channelmanager::ChannelManager::close_channel_with_feerate_and_script
426     */
427    LDKConfirmationTarget_ChannelCloseMinimum,
428    /**
429     * Must be last for serialization purposes
430     */
431    LDKConfirmationTarget_Sentinel,
432 } LDKConfirmationTarget;
433
434 /**
435  * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
436  */
437 typedef enum LDKCreationError {
438    /**
439     * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
440     */
441    LDKCreationError_DescriptionTooLong,
442    /**
443     * The specified route has too many hops and can't be encoded
444     */
445    LDKCreationError_RouteTooLong,
446    /**
447     * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
448     */
449    LDKCreationError_TimestampOutOfBounds,
450    /**
451     * The supplied millisatoshi amount was greater than the total bitcoin supply.
452     */
453    LDKCreationError_InvalidAmount,
454    /**
455     * Route hints were required for this invoice and were missing. Applies to
456     * [phantom invoices].
457     *
458     * [phantom invoices]: crate::utils::create_phantom_invoice
459     */
460    LDKCreationError_MissingRouteHints,
461    /**
462     * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
463     *
464     * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
465     */
466    LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
467    /**
468     * Must be last for serialization purposes
469     */
470    LDKCreationError_Sentinel,
471 } LDKCreationError;
472
473 /**
474  * Enum representing the crypto currencies (or networks) supported by this library
475  */
476 typedef enum LDKCurrency {
477    /**
478     * Bitcoin mainnet
479     */
480    LDKCurrency_Bitcoin,
481    /**
482     * Bitcoin testnet
483     */
484    LDKCurrency_BitcoinTestnet,
485    /**
486     * Bitcoin regtest
487     */
488    LDKCurrency_Regtest,
489    /**
490     * Bitcoin simnet
491     */
492    LDKCurrency_Simnet,
493    /**
494     * Bitcoin signet
495     */
496    LDKCurrency_Signet,
497    /**
498     * Must be last for serialization purposes
499     */
500    LDKCurrency_Sentinel,
501 } LDKCurrency;
502
503 /**
504  * Describes the type of HTLC claim as determined by analyzing the witness.
505  */
506 typedef enum LDKHTLCClaim {
507    /**
508     * Claims an offered output on a commitment transaction through the timeout path.
509     */
510    LDKHTLCClaim_OfferedTimeout,
511    /**
512     * Claims an offered output on a commitment transaction through the success path.
513     */
514    LDKHTLCClaim_OfferedPreimage,
515    /**
516     * Claims an accepted output on a commitment transaction through the timeout path.
517     */
518    LDKHTLCClaim_AcceptedTimeout,
519    /**
520     * Claims an accepted output on a commitment transaction through the success path.
521     */
522    LDKHTLCClaim_AcceptedPreimage,
523    /**
524     * Claims an offered/accepted output on a commitment transaction through the revocation path.
525     */
526    LDKHTLCClaim_Revocation,
527    /**
528     * Must be last for serialization purposes
529     */
530    LDKHTLCClaim_Sentinel,
531 } LDKHTLCClaim;
532
533 /**
534  * Represents an IO Error. Note that some information is lost in the conversion from Rust.
535  */
536 typedef enum LDKIOError {
537    LDKIOError_NotFound,
538    LDKIOError_PermissionDenied,
539    LDKIOError_ConnectionRefused,
540    LDKIOError_ConnectionReset,
541    LDKIOError_ConnectionAborted,
542    LDKIOError_NotConnected,
543    LDKIOError_AddrInUse,
544    LDKIOError_AddrNotAvailable,
545    LDKIOError_BrokenPipe,
546    LDKIOError_AlreadyExists,
547    LDKIOError_WouldBlock,
548    LDKIOError_InvalidInput,
549    LDKIOError_InvalidData,
550    LDKIOError_TimedOut,
551    LDKIOError_WriteZero,
552    LDKIOError_Interrupted,
553    LDKIOError_Other,
554    LDKIOError_UnexpectedEof,
555    /**
556     * Must be last for serialization purposes
557     */
558    LDKIOError_Sentinel,
559 } LDKIOError;
560
561 /**
562  * An enum representing the available verbosity levels of the logger.
563  */
564 typedef enum LDKLevel {
565    /**
566     * Designates extremely verbose information, including gossip-induced messages
567     */
568    LDKLevel_Gossip,
569    /**
570     * Designates very low priority, often extremely verbose, information
571     */
572    LDKLevel_Trace,
573    /**
574     * Designates lower priority information
575     */
576    LDKLevel_Debug,
577    /**
578     * Designates useful information
579     */
580    LDKLevel_Info,
581    /**
582     * Designates hazardous situations
583     */
584    LDKLevel_Warn,
585    /**
586     * Designates very serious errors
587     */
588    LDKLevel_Error,
589    /**
590     * Must be last for serialization purposes
591     */
592    LDKLevel_Sentinel,
593 } LDKLevel;
594
595 /**
596  * An enum representing the possible Bitcoin or test networks which we can run on
597  */
598 typedef enum LDKNetwork {
599    /**
600     * The main Bitcoin blockchain.
601     */
602    LDKNetwork_Bitcoin,
603    /**
604     * The testnet3 blockchain.
605     */
606    LDKNetwork_Testnet,
607    /**
608     * A local test blockchain.
609     */
610    LDKNetwork_Regtest,
611    /**
612     * A blockchain on which blocks are signed instead of mined.
613     */
614    LDKNetwork_Signet,
615    /**
616     * Must be last for serialization purposes
617     */
618    LDKNetwork_Sentinel,
619 } LDKNetwork;
620
621 /**
622  * The reason the payment failed. Used in [`Event::PaymentFailed`].
623  */
624 typedef enum LDKPaymentFailureReason {
625    /**
626     * The intended recipient rejected our payment.
627     */
628    LDKPaymentFailureReason_RecipientRejected,
629    /**
630     * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
631     *
632     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
633     */
634    LDKPaymentFailureReason_UserAbandoned,
635    /**
636     * We exhausted all of our retry attempts while trying to send the payment, or we
637     * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
638     * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
639     * have come before this.
640     *
641     * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
642     */
643    LDKPaymentFailureReason_RetriesExhausted,
644    /**
645     * The payment expired while retrying, based on the provided
646     * [`PaymentParameters::expiry_time`].
647     *
648     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
649     */
650    LDKPaymentFailureReason_PaymentExpired,
651    /**
652     * We failed to find a route while retrying the payment.
653     */
654    LDKPaymentFailureReason_RouteNotFound,
655    /**
656     * This error should generally never happen. This likely means that there is a problem with
657     * your router.
658     */
659    LDKPaymentFailureReason_UnexpectedError,
660    /**
661     * Must be last for serialization purposes
662     */
663    LDKPaymentFailureReason_Sentinel,
664 } LDKPaymentFailureReason;
665
666 /**
667  * Specifies the recipient of an invoice.
668  *
669  * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
670  * the invoice.
671  */
672 typedef enum LDKRecipient {
673    /**
674     * The invoice should be signed with the local node secret key.
675     */
676    LDKRecipient_Node,
677    /**
678     * The invoice should be signed with the phantom node secret key. This secret key must be the
679     * same for all nodes participating in the [phantom node payment].
680     *
681     * [phantom node payment]: PhantomKeysManager
682     */
683    LDKRecipient_PhantomNode,
684    /**
685     * Must be last for serialization purposes
686     */
687    LDKRecipient_Sentinel,
688 } LDKRecipient;
689
690 /**
691  * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
692  * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
693  *
694  * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
695  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
696  * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
697  */
698 typedef enum LDKRetryableSendFailure {
699    /**
700     * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
701     * that this error is *not* caused by [`Retry::Timeout`].
702     *
703     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
704     */
705    LDKRetryableSendFailure_PaymentExpired,
706    /**
707     * We were unable to find a route to the destination.
708     */
709    LDKRetryableSendFailure_RouteNotFound,
710    /**
711     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
712     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
713     *
714     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
715     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
716     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
717     */
718    LDKRetryableSendFailure_DuplicatePayment,
719    /**
720     * Must be last for serialization purposes
721     */
722    LDKRetryableSendFailure_Sentinel,
723 } LDKRetryableSendFailure;
724
725 /**
726  * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
727  */
728 typedef enum LDKSecp256k1Error {
729    /**
730     * Signature failed verification
731     */
732    LDKSecp256k1Error_IncorrectSignature,
733    /**
734     * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
735     */
736    LDKSecp256k1Error_InvalidMessage,
737    /**
738     * Bad public key
739     */
740    LDKSecp256k1Error_InvalidPublicKey,
741    /**
742     * Bad signature
743     */
744    LDKSecp256k1Error_InvalidSignature,
745    /**
746     * Bad secret key
747     */
748    LDKSecp256k1Error_InvalidSecretKey,
749    /**
750     * Bad shared secret.
751     */
752    LDKSecp256k1Error_InvalidSharedSecret,
753    /**
754     * Bad recovery id
755     */
756    LDKSecp256k1Error_InvalidRecoveryId,
757    /**
758     * Invalid tweak for add_assign or mul_assign
759     */
760    LDKSecp256k1Error_InvalidTweak,
761    /**
762     * Didn't pass enough memory to context creation with preallocated memory
763     */
764    LDKSecp256k1Error_NotEnoughMemory,
765    /**
766     * Bad set of public keys.
767     */
768    LDKSecp256k1Error_InvalidPublicKeySum,
769    /**
770     * The only valid parity values are 0 or 1.
771     */
772    LDKSecp256k1Error_InvalidParityValue,
773    /**
774     * Must be last for serialization purposes
775     */
776    LDKSecp256k1Error_Sentinel,
777 } LDKSecp256k1Error;
778
779 /**
780  * SI prefixes for the human readable part
781  */
782 typedef enum LDKSiPrefix {
783    /**
784     * 10^-3
785     */
786    LDKSiPrefix_Milli,
787    /**
788     * 10^-6
789     */
790    LDKSiPrefix_Micro,
791    /**
792     * 10^-9
793     */
794    LDKSiPrefix_Nano,
795    /**
796     * 10^-12
797     */
798    LDKSiPrefix_Pico,
799    /**
800     * Must be last for serialization purposes
801     */
802    LDKSiPrefix_Sentinel,
803 } LDKSiPrefix;
804
805 /**
806  * [`SocketAddress`] error variants
807  */
808 typedef enum LDKSocketAddressParseError {
809    /**
810     * Socket address (IPv4/IPv6) parsing error
811     */
812    LDKSocketAddressParseError_SocketAddrParse,
813    /**
814     * Invalid input format
815     */
816    LDKSocketAddressParseError_InvalidInput,
817    /**
818     * Invalid port
819     */
820    LDKSocketAddressParseError_InvalidPort,
821    /**
822     * Invalid onion v3 address
823     */
824    LDKSocketAddressParseError_InvalidOnionV3,
825    /**
826     * Must be last for serialization purposes
827     */
828    LDKSocketAddressParseError_Sentinel,
829 } LDKSocketAddressParseError;
830
831 /**
832  * An error when accessing the chain via [`UtxoLookup`].
833  */
834 typedef enum LDKUtxoLookupError {
835    /**
836     * The requested chain is unknown.
837     */
838    LDKUtxoLookupError_UnknownChain,
839    /**
840     * The requested transaction doesn't exist or hasn't confirmed.
841     */
842    LDKUtxoLookupError_UnknownTx,
843    /**
844     * Must be last for serialization purposes
845     */
846    LDKUtxoLookupError_Sentinel,
847 } LDKUtxoLookupError;
848
849 /**
850  * A Rust str object, ie a reference to a UTF8-valid string.
851  * This is *not* null-terminated so cannot be used directly as a C string!
852  */
853 typedef struct LDKStr {
854    /**
855     * A pointer to the string's bytes, in UTF8 encoding
856     */
857    const uint8_t *chars;
858    /**
859     * The number of bytes (not characters!) pointed to by `chars`
860     */
861    uintptr_t len;
862    /**
863     * Whether the data pointed to by `chars` should be freed or not.
864     */
865    bool chars_is_owned;
866 } LDKStr;
867
868 /**
869  * A 16-byte byte array.
870  */
871 typedef struct LDKSixteenBytes {
872    /**
873     * The sixteen bytes
874     */
875    uint8_t data[16];
876 } LDKSixteenBytes;
877
878 /**
879  * Unsigned, 128-bit integer.
880  *
881  * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
882  * See https://github.com/rust-lang/rust/issues/54341 for more details.
883  */
884 typedef struct LDKU128 {
885    /**
886     * The 128-bit integer, as 16 little-endian bytes
887     */
888    uint8_t le_bytes[16];
889 } LDKU128;
890
891 /**
892  * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
893  */
894 typedef struct LDKBigEndianScalar {
895    /**
896     * The bytes of the scalar value.
897     */
898    uint8_t big_endian_bytes[32];
899 } LDKBigEndianScalar;
900
901 /**
902  * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
903  * look up the corresponding function in rust-lightning's docs.
904  */
905 typedef struct LDKThirtyTwoBytes {
906    /**
907     * The thirty-two bytes
908     */
909    uint8_t data[32];
910 } LDKThirtyTwoBytes;
911
912 /**
913  * Represents an error returned from the bech32 library during validation of some bech32 data
914  */
915 typedef enum LDKBech32Error_Tag {
916    /**
917     * String does not contain the separator character
918     */
919    LDKBech32Error_MissingSeparator,
920    /**
921     * The checksum does not match the rest of the data
922     */
923    LDKBech32Error_InvalidChecksum,
924    /**
925     * The data or human-readable part is too long or too short
926     */
927    LDKBech32Error_InvalidLength,
928    /**
929     * Some part of the string contains an invalid character
930     */
931    LDKBech32Error_InvalidChar,
932    /**
933     * Some part of the data has an invalid value
934     */
935    LDKBech32Error_InvalidData,
936    /**
937     * The bit conversion failed due to a padding issue
938     */
939    LDKBech32Error_InvalidPadding,
940    /**
941     * The whole string must be of one case
942     */
943    LDKBech32Error_MixedCase,
944    /**
945     * Must be last for serialization purposes
946     */
947    LDKBech32Error_Sentinel,
948 } LDKBech32Error_Tag;
949
950 typedef struct LDKBech32Error {
951    LDKBech32Error_Tag tag;
952    union {
953       struct {
954          uint32_t invalid_char;
955       };
956       struct {
957          uint8_t invalid_data;
958       };
959    };
960 } LDKBech32Error;
961
962 /**
963  * A serialized transaction, in (pointer, length) form.
964  *
965  * This type optionally owns its own memory, and thus the semantics around access change based on
966  * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
967  * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
968  * access to the buffer after the scope in which the object was provided to you is invalid. eg,
969  * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
970  * you would be invalid.
971  *
972  * Note that, while it may change in the future, because transactions on the Rust side are stored
973  * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
974  * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
975  * `data_is_owned` either set or unset at your discretion.
976  */
977 typedef struct LDKTransaction {
978    /**
979     * The serialized transaction data.
980     *
981     * This is non-const for your convenience, an object passed to Rust is never written to.
982     */
983    uint8_t *data;
984    /**
985     * The length of the serialized transaction
986     */
987    uintptr_t datalen;
988    /**
989     * Whether the data pointed to by `data` should be freed or not.
990     */
991    bool data_is_owned;
992 } LDKTransaction;
993
994 /**
995  * A serialized witness.
996  */
997 typedef struct LDKWitness {
998    /**
999     * The serialized transaction data.
1000     *
1001     * This is non-const for your convenience, an object passed to Rust is never written to.
1002     */
1003    uint8_t *data;
1004    /**
1005     * The length of the serialized transaction
1006     */
1007    uintptr_t datalen;
1008    /**
1009     * Whether the data pointed to by `data` should be freed or not.
1010     */
1011    bool data_is_owned;
1012 } LDKWitness;
1013
1014 /**
1015  * A dynamically-allocated array of u8s of arbitrary size.
1016  * This corresponds to std::vector in C++
1017  */
1018 typedef struct LDKCVec_u8Z {
1019    /**
1020     * The elements in the array.
1021     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1022     */
1023    uint8_t *data;
1024    /**
1025     * The number of elements pointed to by `data`.
1026     */
1027    uintptr_t datalen;
1028 } LDKCVec_u8Z;
1029
1030 /**
1031  * An input to a transaction.
1032  *
1033  * This contains the witness, the scriptSig and the previous outpoint and represents a single
1034  * input to a transaction
1035  */
1036 typedef struct LDKTxIn {
1037    /**
1038     * The witness which includes any signatures required to spend a segwit output.
1039     */
1040    struct LDKWitness witness;
1041    /**
1042     * The script_sig which includes signatures requires to spend a pre-segwit output (or a
1043     * P2SH-wrapped segwit output).
1044     */
1045    struct LDKCVec_u8Z script_sig;
1046    /**
1047     * The sequence number of the transaction input
1048     */
1049    uint32_t sequence;
1050    /**
1051     * The txid of the transaction being spent.
1052     */
1053    struct LDKThirtyTwoBytes previous_txid;
1054    /**
1055     * The output index of the transaction being spent.
1056     */
1057    uint32_t previous_vout;
1058 } LDKTxIn;
1059
1060 /**
1061  * A transaction output including a scriptPubKey and value.
1062  * This type *does* own its own memory, so must be free'd appropriately.
1063  */
1064 typedef struct LDKTxOut {
1065    /**
1066     * The script_pubkey in this output
1067     */
1068    struct LDKCVec_u8Z script_pubkey;
1069    /**
1070     * The value, in satoshis, of this output
1071     */
1072    uint64_t value;
1073 } LDKTxOut;
1074
1075 /**
1076  * An enum which can either contain a u64 or not
1077  */
1078 typedef enum LDKCOption_u64Z_Tag {
1079    /**
1080     * When we're in this state, this COption_u64Z contains a u64
1081     */
1082    LDKCOption_u64Z_Some,
1083    /**
1084     * When we're in this state, this COption_u64Z contains nothing
1085     */
1086    LDKCOption_u64Z_None,
1087    /**
1088     * Must be last for serialization purposes
1089     */
1090    LDKCOption_u64Z_Sentinel,
1091 } LDKCOption_u64Z_Tag;
1092
1093 typedef struct LDKCOption_u64Z {
1094    LDKCOption_u64Z_Tag tag;
1095    union {
1096       struct {
1097          uint64_t some;
1098       };
1099    };
1100 } LDKCOption_u64Z;
1101
1102
1103
1104 /**
1105  * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1106  * identity of the recipient.
1107  */
1108 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1109    /**
1110     * A pointer to the opaque Rust object.
1111     * Nearly everywhere, inner must be non-null, however in places where
1112     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1113     */
1114    LDKnativeBlindedPath *inner;
1115    /**
1116     * Indicates that this is the only struct which contains the same pointer.
1117     * Rust functions which take ownership of an object provided via an argument require
1118     * this to be true and invalidate the object pointed to by inner.
1119     */
1120    bool is_owned;
1121 } LDKBlindedPath;
1122
1123 /**
1124  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1125  * This corresponds to std::vector in C++
1126  */
1127 typedef struct LDKCVec_BlindedPathZ {
1128    /**
1129     * The elements in the array.
1130     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1131     */
1132    struct LDKBlindedPath *data;
1133    /**
1134     * The number of elements pointed to by `data`.
1135     */
1136    uintptr_t datalen;
1137 } LDKCVec_BlindedPathZ;
1138
1139
1140
1141 /**
1142  * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1143  *
1144  * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1145  * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1146  * bitcoin ATM.
1147  *
1148  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1149  * [`Offer`]: crate::offers::offer::Offer
1150  */
1151 typedef struct MUST_USE_STRUCT LDKRefund {
1152    /**
1153     * A pointer to the opaque Rust object.
1154     * Nearly everywhere, inner must be non-null, however in places where
1155     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1156     */
1157    LDKnativeRefund *inner;
1158    /**
1159     * Indicates that this is the only struct which contains the same pointer.
1160     * Rust functions which take ownership of an object provided via an argument require
1161     * this to be true and invalidate the object pointed to by inner.
1162     */
1163    bool is_owned;
1164 } LDKRefund;
1165
1166
1167
1168 /**
1169  * Error when parsing a bech32 encoded message using [`str::parse`].
1170  */
1171 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1172    /**
1173     * A pointer to the opaque Rust object.
1174     * Nearly everywhere, inner must be non-null, however in places where
1175     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1176     */
1177    LDKnativeBolt12ParseError *inner;
1178    /**
1179     * Indicates that this is the only struct which contains the same pointer.
1180     * Rust functions which take ownership of an object provided via an argument require
1181     * this to be true and invalidate the object pointed to by inner.
1182     */
1183    bool is_owned;
1184 } LDKBolt12ParseError;
1185
1186 /**
1187  * The contents of CResult_RefundBolt12ParseErrorZ
1188  */
1189 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1190    /**
1191     * A pointer to the contents in the success state.
1192     * Reading from this pointer when `result_ok` is not set is undefined.
1193     */
1194    struct LDKRefund *result;
1195    /**
1196     * A pointer to the contents in the error state.
1197     * Reading from this pointer when `result_ok` is set is undefined.
1198     */
1199    struct LDKBolt12ParseError *err;
1200 } LDKCResult_RefundBolt12ParseErrorZPtr;
1201
1202 /**
1203  * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1204  * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1205  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1206  */
1207 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1208    /**
1209     * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1210     * `err` or `result` depending on the state of `result_ok`.
1211     */
1212    union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1213    /**
1214     * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1215     */
1216    bool result_ok;
1217 } LDKCResult_RefundBolt12ParseErrorZ;
1218
1219 /**
1220  * Strategies available to retry payment path failures.
1221  */
1222 typedef enum LDKRetry_Tag {
1223    /**
1224     * Max number of attempts to retry payment.
1225     *
1226     * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1227     * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1228     * were retried along a route from a single call to [`Router::find_route_with_id`].
1229     */
1230    LDKRetry_Attempts,
1231    /**
1232     * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1233     * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1234     *
1235     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1236     */
1237    LDKRetry_Timeout,
1238    /**
1239     * Must be last for serialization purposes
1240     */
1241    LDKRetry_Sentinel,
1242 } LDKRetry_Tag;
1243
1244 typedef struct MUST_USE_STRUCT LDKRetry {
1245    LDKRetry_Tag tag;
1246    union {
1247       struct {
1248          uint32_t attempts;
1249       };
1250       struct {
1251          uint64_t timeout;
1252       };
1253    };
1254 } LDKRetry;
1255
1256 /**
1257  * An error in decoding a message or struct.
1258  */
1259 typedef enum LDKDecodeError_Tag {
1260    /**
1261     * A version byte specified something we don't know how to handle.
1262     *
1263     * Includes unknown realm byte in an onion hop data packet.
1264     */
1265    LDKDecodeError_UnknownVersion,
1266    /**
1267     * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1268     */
1269    LDKDecodeError_UnknownRequiredFeature,
1270    /**
1271     * Value was invalid.
1272     *
1273     * For example, a byte which was supposed to be a bool was something other than a 0
1274     * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1275     * syntactically incorrect, etc.
1276     */
1277    LDKDecodeError_InvalidValue,
1278    /**
1279     * The buffer to be read was too short.
1280     */
1281    LDKDecodeError_ShortRead,
1282    /**
1283     * A length descriptor in the packet didn't describe the later data correctly.
1284     */
1285    LDKDecodeError_BadLengthDescriptor,
1286    /**
1287     * Error from [`std::io`].
1288     */
1289    LDKDecodeError_Io,
1290    /**
1291     * The message included zlib-compressed values, which we don't support.
1292     */
1293    LDKDecodeError_UnsupportedCompression,
1294    /**
1295     * Must be last for serialization purposes
1296     */
1297    LDKDecodeError_Sentinel,
1298 } LDKDecodeError_Tag;
1299
1300 typedef struct MUST_USE_STRUCT LDKDecodeError {
1301    LDKDecodeError_Tag tag;
1302    union {
1303       struct {
1304          enum LDKIOError io;
1305       };
1306    };
1307 } LDKDecodeError;
1308
1309 /**
1310  * The contents of CResult_RetryDecodeErrorZ
1311  */
1312 typedef union LDKCResult_RetryDecodeErrorZPtr {
1313    /**
1314     * A pointer to the contents in the success state.
1315     * Reading from this pointer when `result_ok` is not set is undefined.
1316     */
1317    struct LDKRetry *result;
1318    /**
1319     * A pointer to the contents in the error state.
1320     * Reading from this pointer when `result_ok` is set is undefined.
1321     */
1322    struct LDKDecodeError *err;
1323 } LDKCResult_RetryDecodeErrorZPtr;
1324
1325 /**
1326  * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1327  * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1328  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1329  */
1330 typedef struct LDKCResult_RetryDecodeErrorZ {
1331    /**
1332     * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1333     * `err` or `result` depending on the state of `result_ok`.
1334     */
1335    union LDKCResult_RetryDecodeErrorZPtr contents;
1336    /**
1337     * Whether this CResult_RetryDecodeErrorZ represents a success state.
1338     */
1339    bool result_ok;
1340 } LDKCResult_RetryDecodeErrorZ;
1341
1342
1343
1344 /**
1345  * A script pubkey for shutting down a channel as defined by [BOLT #2].
1346  *
1347  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1348  */
1349 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1350    /**
1351     * A pointer to the opaque Rust object.
1352     * Nearly everywhere, inner must be non-null, however in places where
1353     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1354     */
1355    LDKnativeShutdownScript *inner;
1356    /**
1357     * Indicates that this is the only struct which contains the same pointer.
1358     * Rust functions which take ownership of an object provided via an argument require
1359     * this to be true and invalidate the object pointed to by inner.
1360     */
1361    bool is_owned;
1362 } LDKShutdownScript;
1363
1364 /**
1365  * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1366  * too-high values)
1367  */
1368 typedef enum LDKAPIError_Tag {
1369    /**
1370     * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1371     * are documented, but generally indicates some precondition of a function was violated.
1372     */
1373    LDKAPIError_APIMisuseError,
1374    /**
1375     * Due to a high feerate, we were unable to complete the request.
1376     * For example, this may be returned if the feerate implies we cannot open a channel at the
1377     * requested value, but opening a larger channel would succeed.
1378     */
1379    LDKAPIError_FeeRateTooHigh,
1380    /**
1381     * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1382     * too-many-hops, etc).
1383     */
1384    LDKAPIError_InvalidRoute,
1385    /**
1386     * We were unable to complete the request as the Channel required to do so is unable to
1387     * complete the request (or was not found). This can take many forms, including disconnected
1388     * peer, channel at capacity, channel shutting down, etc.
1389     */
1390    LDKAPIError_ChannelUnavailable,
1391    /**
1392     * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1393     * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1394     * monitor update is awaiting async resolution. Once it resolves the attempted action should
1395     * complete automatically.
1396     *
1397     * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1398     * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1399     * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1400     */
1401    LDKAPIError_MonitorUpdateInProgress,
1402    /**
1403     * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1404     * with the channel counterparty as negotiated in [`InitFeatures`].
1405     *
1406     * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1407     * a channel or cooperatively close one with this peer (and will have to force-close instead).
1408     *
1409     * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1410     * [`InitFeatures`]: crate::ln::features::InitFeatures
1411     */
1412    LDKAPIError_IncompatibleShutdownScript,
1413    /**
1414     * Must be last for serialization purposes
1415     */
1416    LDKAPIError_Sentinel,
1417 } LDKAPIError_Tag;
1418
1419 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1420    /**
1421     * A human-readable error message
1422     */
1423    struct LDKStr err;
1424 } LDKAPIError_LDKAPIMisuseError_Body;
1425
1426 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1427    /**
1428     * A human-readable error message
1429     */
1430    struct LDKStr err;
1431    /**
1432     * The feerate which was too high.
1433     */
1434    uint32_t feerate;
1435 } LDKAPIError_LDKFeeRateTooHigh_Body;
1436
1437 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1438    /**
1439     * A human-readable error message
1440     */
1441    struct LDKStr err;
1442 } LDKAPIError_LDKInvalidRoute_Body;
1443
1444 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1445    /**
1446     * A human-readable error message
1447     */
1448    struct LDKStr err;
1449 } LDKAPIError_LDKChannelUnavailable_Body;
1450
1451 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1452    /**
1453     * The incompatible shutdown script.
1454     */
1455    struct LDKShutdownScript script;
1456 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1457
1458 typedef struct MUST_USE_STRUCT LDKAPIError {
1459    LDKAPIError_Tag tag;
1460    union {
1461       LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1462       LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1463       LDKAPIError_LDKInvalidRoute_Body invalid_route;
1464       LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1465       LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1466    };
1467 } LDKAPIError;
1468
1469 /**
1470  * The contents of CResult_NoneAPIErrorZ
1471  */
1472 typedef union LDKCResult_NoneAPIErrorZPtr {
1473    /**
1474     * Note that this value is always NULL, as there are no contents in the OK variant
1475     */
1476    void *result;
1477    /**
1478     * A pointer to the contents in the error state.
1479     * Reading from this pointer when `result_ok` is set is undefined.
1480     */
1481    struct LDKAPIError *err;
1482 } LDKCResult_NoneAPIErrorZPtr;
1483
1484 /**
1485  * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1486  * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1487  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1488  */
1489 typedef struct LDKCResult_NoneAPIErrorZ {
1490    /**
1491     * The contents of this CResult_NoneAPIErrorZ, accessible via either
1492     * `err` or `result` depending on the state of `result_ok`.
1493     */
1494    union LDKCResult_NoneAPIErrorZPtr contents;
1495    /**
1496     * Whether this CResult_NoneAPIErrorZ represents a success state.
1497     */
1498    bool result_ok;
1499 } LDKCResult_NoneAPIErrorZ;
1500
1501 /**
1502  * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1503  * This corresponds to std::vector in C++
1504  */
1505 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1506    /**
1507     * The elements in the array.
1508     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1509     */
1510    struct LDKCResult_NoneAPIErrorZ *data;
1511    /**
1512     * The number of elements pointed to by `data`.
1513     */
1514    uintptr_t datalen;
1515 } LDKCVec_CResult_NoneAPIErrorZZ;
1516
1517 /**
1518  * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1519  * This corresponds to std::vector in C++
1520  */
1521 typedef struct LDKCVec_APIErrorZ {
1522    /**
1523     * The elements in the array.
1524     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1525     */
1526    struct LDKAPIError *data;
1527    /**
1528     * The number of elements pointed to by `data`.
1529     */
1530    uintptr_t datalen;
1531 } LDKCVec_APIErrorZ;
1532
1533 /**
1534  * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1535  */
1536 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1537    /**
1538     * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1539     */
1540    LDKCOption_ThirtyTwoBytesZ_Some,
1541    /**
1542     * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1543     */
1544    LDKCOption_ThirtyTwoBytesZ_None,
1545    /**
1546     * Must be last for serialization purposes
1547     */
1548    LDKCOption_ThirtyTwoBytesZ_Sentinel,
1549 } LDKCOption_ThirtyTwoBytesZ_Tag;
1550
1551 typedef struct LDKCOption_ThirtyTwoBytesZ {
1552    LDKCOption_ThirtyTwoBytesZ_Tag tag;
1553    union {
1554       struct {
1555          struct LDKThirtyTwoBytes some;
1556       };
1557    };
1558 } LDKCOption_ThirtyTwoBytesZ;
1559
1560 /**
1561  * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1562  */
1563 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1564    /**
1565     * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1566     */
1567    LDKCOption_CVec_u8ZZ_Some,
1568    /**
1569     * When we're in this state, this COption_CVec_u8ZZ contains nothing
1570     */
1571    LDKCOption_CVec_u8ZZ_None,
1572    /**
1573     * Must be last for serialization purposes
1574     */
1575    LDKCOption_CVec_u8ZZ_Sentinel,
1576 } LDKCOption_CVec_u8ZZ_Tag;
1577
1578 typedef struct LDKCOption_CVec_u8ZZ {
1579    LDKCOption_CVec_u8ZZ_Tag tag;
1580    union {
1581       struct {
1582          struct LDKCVec_u8Z some;
1583       };
1584    };
1585 } LDKCOption_CVec_u8ZZ;
1586
1587
1588
1589 /**
1590  * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1591  *
1592  * This should generally be constructed with data communicated to us from the recipient (via a
1593  * BOLT11 or BOLT12 invoice).
1594  */
1595 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1596    /**
1597     * A pointer to the opaque Rust object.
1598     * Nearly everywhere, inner must be non-null, however in places where
1599     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1600     */
1601    LDKnativeRecipientOnionFields *inner;
1602    /**
1603     * Indicates that this is the only struct which contains the same pointer.
1604     * Rust functions which take ownership of an object provided via an argument require
1605     * this to be true and invalidate the object pointed to by inner.
1606     */
1607    bool is_owned;
1608 } LDKRecipientOnionFields;
1609
1610 /**
1611  * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1612  */
1613 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1614    /**
1615     * A pointer to the contents in the success state.
1616     * Reading from this pointer when `result_ok` is not set is undefined.
1617     */
1618    struct LDKRecipientOnionFields *result;
1619    /**
1620     * A pointer to the contents in the error state.
1621     * Reading from this pointer when `result_ok` is set is undefined.
1622     */
1623    struct LDKDecodeError *err;
1624 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1625
1626 /**
1627  * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1628  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1629  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1630  */
1631 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1632    /**
1633     * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1634     * `err` or `result` depending on the state of `result_ok`.
1635     */
1636    union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1637    /**
1638     * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1639     */
1640    bool result_ok;
1641 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1642
1643 /**
1644  * A tuple of 2 elements. See the individual fields for the types contained.
1645  */
1646 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1647    /**
1648     * The element at position 0
1649     */
1650    uint64_t a;
1651    /**
1652     * The element at position 1
1653     */
1654    struct LDKCVec_u8Z b;
1655 } LDKC2Tuple_u64CVec_u8ZZ;
1656
1657 /**
1658  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1659  * This corresponds to std::vector in C++
1660  */
1661 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1662    /**
1663     * The elements in the array.
1664     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1665     */
1666    struct LDKC2Tuple_u64CVec_u8ZZ *data;
1667    /**
1668     * The number of elements pointed to by `data`.
1669     */
1670    uintptr_t datalen;
1671 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1672
1673 /**
1674  * The contents of CResult_RecipientOnionFieldsNoneZ
1675  */
1676 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1677    /**
1678     * A pointer to the contents in the success state.
1679     * Reading from this pointer when `result_ok` is not set is undefined.
1680     */
1681    struct LDKRecipientOnionFields *result;
1682    /**
1683     * Note that this value is always NULL, as there are no contents in the Err variant
1684     */
1685    void *err;
1686 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1687
1688 /**
1689  * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1690  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1691  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1692  */
1693 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1694    /**
1695     * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1696     * `err` or `result` depending on the state of `result_ok`.
1697     */
1698    union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1699    /**
1700     * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
1701     */
1702    bool result_ok;
1703 } LDKCResult_RecipientOnionFieldsNoneZ;
1704
1705 /**
1706  * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1707  * This corresponds to std::vector in C++
1708  */
1709 typedef struct LDKCVec_ThirtyTwoBytesZ {
1710    /**
1711     * The elements in the array.
1712     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1713     */
1714    struct LDKThirtyTwoBytes *data;
1715    /**
1716     * The number of elements pointed to by `data`.
1717     */
1718    uintptr_t datalen;
1719 } LDKCVec_ThirtyTwoBytesZ;
1720
1721 /**
1722  * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
1723  */
1724 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
1725    /**
1726     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
1727     */
1728    LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
1729    /**
1730     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
1731     */
1732    LDKCOption_CVec_ThirtyTwoBytesZZ_None,
1733    /**
1734     * Must be last for serialization purposes
1735     */
1736    LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
1737 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
1738
1739 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
1740    LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
1741    union {
1742       struct {
1743          struct LDKCVec_ThirtyTwoBytesZ some;
1744       };
1745    };
1746 } LDKCOption_CVec_ThirtyTwoBytesZZ;
1747
1748 /**
1749  * The contents of CResult_ThirtyTwoBytesNoneZ
1750  */
1751 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
1752    /**
1753     * A pointer to the contents in the success state.
1754     * Reading from this pointer when `result_ok` is not set is undefined.
1755     */
1756    struct LDKThirtyTwoBytes *result;
1757    /**
1758     * Note that this value is always NULL, as there are no contents in the Err variant
1759     */
1760    void *err;
1761 } LDKCResult_ThirtyTwoBytesNoneZPtr;
1762
1763 /**
1764  * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
1765  * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
1766  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1767  */
1768 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
1769    /**
1770     * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
1771     * `err` or `result` depending on the state of `result_ok`.
1772     */
1773    union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
1774    /**
1775     * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
1776     */
1777    bool result_ok;
1778 } LDKCResult_ThirtyTwoBytesNoneZ;
1779
1780
1781
1782 /**
1783  * Information needed to route a payment across a [`BlindedPath`].
1784  */
1785 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
1786    /**
1787     * A pointer to the opaque Rust object.
1788     * Nearly everywhere, inner must be non-null, however in places where
1789     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1790     */
1791    LDKnativeBlindedPayInfo *inner;
1792    /**
1793     * Indicates that this is the only struct which contains the same pointer.
1794     * Rust functions which take ownership of an object provided via an argument require
1795     * this to be true and invalidate the object pointed to by inner.
1796     */
1797    bool is_owned;
1798 } LDKBlindedPayInfo;
1799
1800 /**
1801  * The contents of CResult_BlindedPayInfoDecodeErrorZ
1802  */
1803 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
1804    /**
1805     * A pointer to the contents in the success state.
1806     * Reading from this pointer when `result_ok` is not set is undefined.
1807     */
1808    struct LDKBlindedPayInfo *result;
1809    /**
1810     * A pointer to the contents in the error state.
1811     * Reading from this pointer when `result_ok` is set is undefined.
1812     */
1813    struct LDKDecodeError *err;
1814 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
1815
1816 /**
1817  * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
1818  * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
1819  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1820  */
1821 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
1822    /**
1823     * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
1824     * `err` or `result` depending on the state of `result_ok`.
1825     */
1826    union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
1827    /**
1828     * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
1829     */
1830    bool result_ok;
1831 } LDKCResult_BlindedPayInfoDecodeErrorZ;
1832
1833
1834
1835 /**
1836  * Information about a spendable output to a P2WSH script.
1837  *
1838  * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
1839  */
1840 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1841    /**
1842     * A pointer to the opaque Rust object.
1843     * Nearly everywhere, inner must be non-null, however in places where
1844     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1845     */
1846    LDKnativeDelayedPaymentOutputDescriptor *inner;
1847    /**
1848     * Indicates that this is the only struct which contains the same pointer.
1849     * Rust functions which take ownership of an object provided via an argument require
1850     * this to be true and invalidate the object pointed to by inner.
1851     */
1852    bool is_owned;
1853 } LDKDelayedPaymentOutputDescriptor;
1854
1855 /**
1856  * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
1857  */
1858 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
1859    /**
1860     * A pointer to the contents in the success state.
1861     * Reading from this pointer when `result_ok` is not set is undefined.
1862     */
1863    struct LDKDelayedPaymentOutputDescriptor *result;
1864    /**
1865     * A pointer to the contents in the error state.
1866     * Reading from this pointer when `result_ok` is set is undefined.
1867     */
1868    struct LDKDecodeError *err;
1869 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
1870
1871 /**
1872  * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1873  * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1874  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1875  */
1876 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
1877    /**
1878     * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
1879     * `err` or `result` depending on the state of `result_ok`.
1880     */
1881    union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
1882    /**
1883     * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
1884     */
1885    bool result_ok;
1886 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
1887
1888
1889
1890 /**
1891  * Information about a spendable output to our \"payment key\".
1892  *
1893  * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
1894  */
1895 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1896    /**
1897     * A pointer to the opaque Rust object.
1898     * Nearly everywhere, inner must be non-null, however in places where
1899     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1900     */
1901    LDKnativeStaticPaymentOutputDescriptor *inner;
1902    /**
1903     * Indicates that this is the only struct which contains the same pointer.
1904     * Rust functions which take ownership of an object provided via an argument require
1905     * this to be true and invalidate the object pointed to by inner.
1906     */
1907    bool is_owned;
1908 } LDKStaticPaymentOutputDescriptor;
1909
1910 /**
1911  * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
1912  */
1913 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
1914    /**
1915     * A pointer to the contents in the success state.
1916     * Reading from this pointer when `result_ok` is not set is undefined.
1917     */
1918    struct LDKStaticPaymentOutputDescriptor *result;
1919    /**
1920     * A pointer to the contents in the error state.
1921     * Reading from this pointer when `result_ok` is set is undefined.
1922     */
1923    struct LDKDecodeError *err;
1924 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
1925
1926 /**
1927  * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1928  * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1929  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1930  */
1931 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
1932    /**
1933     * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
1934     * `err` or `result` depending on the state of `result_ok`.
1935     */
1936    union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
1937    /**
1938     * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
1939     */
1940    bool result_ok;
1941 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
1942
1943
1944
1945 /**
1946  * A reference to a transaction output.
1947  *
1948  * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1949  * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1950  */
1951 typedef struct MUST_USE_STRUCT LDKOutPoint {
1952    /**
1953     * A pointer to the opaque Rust object.
1954     * Nearly everywhere, inner must be non-null, however in places where
1955     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1956     */
1957    LDKnativeOutPoint *inner;
1958    /**
1959     * Indicates that this is the only struct which contains the same pointer.
1960     * Rust functions which take ownership of an object provided via an argument require
1961     * this to be true and invalidate the object pointed to by inner.
1962     */
1963    bool is_owned;
1964 } LDKOutPoint;
1965
1966 /**
1967  * Describes the necessary information to spend a spendable output.
1968  *
1969  * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
1970  * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
1971  * to spend on-chain. The information needed to do this is provided in this enum, including the
1972  * outpoint describing which `txid` and output `index` is available, the full output which exists
1973  * at that `txid`/`index`, and any keys or other information required to sign.
1974  *
1975  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
1976  */
1977 typedef enum LDKSpendableOutputDescriptor_Tag {
1978    /**
1979     * An output to a script which was provided via [`SignerProvider`] directly, either from
1980     * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
1981     * know how to spend it. No secret keys are provided as LDK was never given any key.
1982     * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1983     * on-chain using the payment preimage or after it has timed out.
1984     *
1985     * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
1986     * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
1987     */
1988    LDKSpendableOutputDescriptor_StaticOutput,
1989    /**
1990     * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
1991     * delay.
1992     *
1993     * The witness in the spending input should be:
1994     * ```bitcoin
1995     * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1996     * ```
1997     *
1998     * Note that the `nSequence` field in the spending input must be set to
1999     * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
2000     * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
2001     * the outpoint confirms, see [BIP
2002     * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
2003     * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
2004     * is reached.
2005     *
2006     * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2007     * it is an output from an old state which we broadcast (which should never happen).
2008     *
2009     * To derive the delayed payment key which is used to sign this input, you must pass the
2010     * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
2011     * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
2012     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
2013     * generated without the secret key using [`chan_utils::derive_public_key`] and only the
2014     * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
2015     *
2016     * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
2017     * used in the witness script generation), you must pass the counterparty
2018     * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
2019     * [`ChannelSigner::provide_channel_parameters`]) and the provided
2020     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
2021     * [`chan_utils::derive_public_revocation_key`].
2022     *
2023     * The witness script which is hashed and included in the output `script_pubkey` may be
2024     * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
2025     * as explained above), our delayed payment pubkey (derived as explained above), and the
2026     * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
2027     * [`chan_utils::get_revokeable_redeemscript`].
2028     */
2029    LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2030    /**
2031     * An output spendable exclusively by our payment key (i.e., the private key that corresponds
2032     * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
2033     * channel type negotiated.
2034     *
2035     * On an anchor outputs channel, the witness in the spending input is:
2036     * ```bitcoin
2037     * <BIP 143 signature> <witness script>
2038     * ```
2039     *
2040     * Otherwise, it is:
2041     * ```bitcoin
2042     * <BIP 143 signature> <payment key>
2043     * ```
2044     *
2045     * These are generally the result of our counterparty having broadcast the current state,
2046     * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
2047     * in the case of anchor outputs channels.
2048     */
2049    LDKSpendableOutputDescriptor_StaticPaymentOutput,
2050    /**
2051     * Must be last for serialization purposes
2052     */
2053    LDKSpendableOutputDescriptor_Sentinel,
2054 } LDKSpendableOutputDescriptor_Tag;
2055
2056 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2057    /**
2058     * The outpoint which is spendable.
2059     */
2060    struct LDKOutPoint outpoint;
2061    /**
2062     * The output which is referenced by the given outpoint.
2063     */
2064    struct LDKTxOut output;
2065 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2066
2067 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2068    LDKSpendableOutputDescriptor_Tag tag;
2069    union {
2070       LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2071       struct {
2072          struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2073       };
2074       struct {
2075          struct LDKStaticPaymentOutputDescriptor static_payment_output;
2076       };
2077    };
2078 } LDKSpendableOutputDescriptor;
2079
2080 /**
2081  * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
2082  */
2083 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2084    /**
2085     * A pointer to the contents in the success state.
2086     * Reading from this pointer when `result_ok` is not set is undefined.
2087     */
2088    struct LDKSpendableOutputDescriptor *result;
2089    /**
2090     * A pointer to the contents in the error state.
2091     * Reading from this pointer when `result_ok` is set is undefined.
2092     */
2093    struct LDKDecodeError *err;
2094 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2095
2096 /**
2097  * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2098  * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2099  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2100  */
2101 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2102    /**
2103     * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2104     * `err` or `result` depending on the state of `result_ok`.
2105     */
2106    union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2107    /**
2108     * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2109     */
2110    bool result_ok;
2111 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2112
2113 /**
2114  * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2115  * This corresponds to std::vector in C++
2116  */
2117 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2118    /**
2119     * The elements in the array.
2120     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2121     */
2122    struct LDKSpendableOutputDescriptor *data;
2123    /**
2124     * The number of elements pointed to by `data`.
2125     */
2126    uintptr_t datalen;
2127 } LDKCVec_SpendableOutputDescriptorZ;
2128
2129 /**
2130  * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2131  * This corresponds to std::vector in C++
2132  */
2133 typedef struct LDKCVec_TxOutZ {
2134    /**
2135     * The elements in the array.
2136     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2137     */
2138    struct LDKTxOut *data;
2139    /**
2140     * The number of elements pointed to by `data`.
2141     */
2142    uintptr_t datalen;
2143 } LDKCVec_TxOutZ;
2144
2145 /**
2146  * An enum which can either contain a u32 or not
2147  */
2148 typedef enum LDKCOption_u32Z_Tag {
2149    /**
2150     * When we're in this state, this COption_u32Z contains a u32
2151     */
2152    LDKCOption_u32Z_Some,
2153    /**
2154     * When we're in this state, this COption_u32Z contains nothing
2155     */
2156    LDKCOption_u32Z_None,
2157    /**
2158     * Must be last for serialization purposes
2159     */
2160    LDKCOption_u32Z_Sentinel,
2161 } LDKCOption_u32Z_Tag;
2162
2163 typedef struct LDKCOption_u32Z {
2164    LDKCOption_u32Z_Tag tag;
2165    union {
2166       struct {
2167          uint32_t some;
2168       };
2169    };
2170 } LDKCOption_u32Z;
2171
2172 /**
2173  * A tuple of 2 elements. See the individual fields for the types contained.
2174  */
2175 typedef struct LDKC2Tuple_CVec_u8ZusizeZ {
2176    /**
2177     * The element at position 0
2178     */
2179    struct LDKCVec_u8Z a;
2180    /**
2181     * The element at position 1
2182     */
2183    uintptr_t b;
2184 } LDKC2Tuple_CVec_u8ZusizeZ;
2185
2186 /**
2187  * The contents of CResult_C2Tuple_CVec_u8ZusizeZNoneZ
2188  */
2189 typedef union LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr {
2190    /**
2191     * A pointer to the contents in the success state.
2192     * Reading from this pointer when `result_ok` is not set is undefined.
2193     */
2194    struct LDKC2Tuple_CVec_u8ZusizeZ *result;
2195    /**
2196     * Note that this value is always NULL, as there are no contents in the Err variant
2197     */
2198    void *err;
2199 } LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr;
2200
2201 /**
2202  * A CResult_C2Tuple_CVec_u8ZusizeZNoneZ represents the result of a fallible operation,
2203  * containing a crate::c_types::derived::C2Tuple_CVec_u8ZusizeZ on success and a () on failure.
2204  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2205  */
2206 typedef struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ {
2207    /**
2208     * The contents of this CResult_C2Tuple_CVec_u8ZusizeZNoneZ, accessible via either
2209     * `err` or `result` depending on the state of `result_ok`.
2210     */
2211    union LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr contents;
2212    /**
2213     * Whether this CResult_C2Tuple_CVec_u8ZusizeZNoneZ represents a success state.
2214     */
2215    bool result_ok;
2216 } LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ;
2217
2218
2219
2220 /**
2221  * The parameters required to derive a channel signer via [`SignerProvider`].
2222  */
2223 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
2224    /**
2225     * A pointer to the opaque Rust object.
2226     * Nearly everywhere, inner must be non-null, however in places where
2227     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2228     */
2229    LDKnativeChannelDerivationParameters *inner;
2230    /**
2231     * Indicates that this is the only struct which contains the same pointer.
2232     * Rust functions which take ownership of an object provided via an argument require
2233     * this to be true and invalidate the object pointed to by inner.
2234     */
2235    bool is_owned;
2236 } LDKChannelDerivationParameters;
2237
2238 /**
2239  * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
2240  */
2241 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
2242    /**
2243     * A pointer to the contents in the success state.
2244     * Reading from this pointer when `result_ok` is not set is undefined.
2245     */
2246    struct LDKChannelDerivationParameters *result;
2247    /**
2248     * A pointer to the contents in the error state.
2249     * Reading from this pointer when `result_ok` is set is undefined.
2250     */
2251    struct LDKDecodeError *err;
2252 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
2253
2254 /**
2255  * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
2256  * containing a crate::lightning::sign::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2257  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2258  */
2259 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
2260    /**
2261     * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
2262     * `err` or `result` depending on the state of `result_ok`.
2263     */
2264    union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
2265    /**
2266     * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
2267     */
2268    bool result_ok;
2269 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
2270
2271
2272
2273 /**
2274  * A descriptor used to sign for a commitment transaction's HTLC output.
2275  */
2276 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2277    /**
2278     * A pointer to the opaque Rust object.
2279     * Nearly everywhere, inner must be non-null, however in places where
2280     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2281     */
2282    LDKnativeHTLCDescriptor *inner;
2283    /**
2284     * Indicates that this is the only struct which contains the same pointer.
2285     * Rust functions which take ownership of an object provided via an argument require
2286     * this to be true and invalidate the object pointed to by inner.
2287     */
2288    bool is_owned;
2289 } LDKHTLCDescriptor;
2290
2291 /**
2292  * The contents of CResult_HTLCDescriptorDecodeErrorZ
2293  */
2294 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
2295    /**
2296     * A pointer to the contents in the success state.
2297     * Reading from this pointer when `result_ok` is not set is undefined.
2298     */
2299    struct LDKHTLCDescriptor *result;
2300    /**
2301     * A pointer to the contents in the error state.
2302     * Reading from this pointer when `result_ok` is set is undefined.
2303     */
2304    struct LDKDecodeError *err;
2305 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
2306
2307 /**
2308  * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
2309  * containing a crate::lightning::sign::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2310  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2311  */
2312 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
2313    /**
2314     * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
2315     * `err` or `result` depending on the state of `result_ok`.
2316     */
2317    union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
2318    /**
2319     * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
2320     */
2321    bool result_ok;
2322 } LDKCResult_HTLCDescriptorDecodeErrorZ;
2323
2324 /**
2325  * The contents of CResult_NoneNoneZ
2326  */
2327 typedef union LDKCResult_NoneNoneZPtr {
2328    /**
2329     * Note that this value is always NULL, as there are no contents in the OK variant
2330     */
2331    void *result;
2332    /**
2333     * Note that this value is always NULL, as there are no contents in the Err variant
2334     */
2335    void *err;
2336 } LDKCResult_NoneNoneZPtr;
2337
2338 /**
2339  * A CResult_NoneNoneZ represents the result of a fallible operation,
2340  * containing a () on success and a () on failure.
2341  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2342  */
2343 typedef struct LDKCResult_NoneNoneZ {
2344    /**
2345     * The contents of this CResult_NoneNoneZ, accessible via either
2346     * `err` or `result` depending on the state of `result_ok`.
2347     */
2348    union LDKCResult_NoneNoneZPtr contents;
2349    /**
2350     * Whether this CResult_NoneNoneZ represents a success state.
2351     */
2352    bool result_ok;
2353 } LDKCResult_NoneNoneZ;
2354
2355 /**
2356  * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
2357  */
2358 typedef struct LDKECDSASignature {
2359    /**
2360     * The bytes of the signature in "compact" form
2361     */
2362    uint8_t compact_form[64];
2363 } LDKECDSASignature;
2364
2365 /**
2366  * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
2367  * This corresponds to std::vector in C++
2368  */
2369 typedef struct LDKCVec_ECDSASignatureZ {
2370    /**
2371     * The elements in the array.
2372     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2373     */
2374    struct LDKECDSASignature *data;
2375    /**
2376     * The number of elements pointed to by `data`.
2377     */
2378    uintptr_t datalen;
2379 } LDKCVec_ECDSASignatureZ;
2380
2381 /**
2382  * A tuple of 2 elements. See the individual fields for the types contained.
2383  */
2384 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
2385    /**
2386     * The element at position 0
2387     */
2388    struct LDKECDSASignature a;
2389    /**
2390     * The element at position 1
2391     */
2392    struct LDKCVec_ECDSASignatureZ b;
2393 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
2394
2395 /**
2396  * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
2397  */
2398 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
2399    /**
2400     * A pointer to the contents in the success state.
2401     * Reading from this pointer when `result_ok` is not set is undefined.
2402     */
2403    struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
2404    /**
2405     * Note that this value is always NULL, as there are no contents in the Err variant
2406     */
2407    void *err;
2408 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
2409
2410 /**
2411  * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
2412  * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
2413  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2414  */
2415 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
2416    /**
2417     * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
2418     * `err` or `result` depending on the state of `result_ok`.
2419     */
2420    union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
2421    /**
2422     * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
2423     */
2424    bool result_ok;
2425 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
2426
2427 /**
2428  * The contents of CResult_ECDSASignatureNoneZ
2429  */
2430 typedef union LDKCResult_ECDSASignatureNoneZPtr {
2431    /**
2432     * A pointer to the contents in the success state.
2433     * Reading from this pointer when `result_ok` is not set is undefined.
2434     */
2435    struct LDKECDSASignature *result;
2436    /**
2437     * Note that this value is always NULL, as there are no contents in the Err variant
2438     */
2439    void *err;
2440 } LDKCResult_ECDSASignatureNoneZPtr;
2441
2442 /**
2443  * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
2444  * containing a crate::c_types::ECDSASignature on success and a () on failure.
2445  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2446  */
2447 typedef struct LDKCResult_ECDSASignatureNoneZ {
2448    /**
2449     * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
2450     * `err` or `result` depending on the state of `result_ok`.
2451     */
2452    union LDKCResult_ECDSASignatureNoneZPtr contents;
2453    /**
2454     * Whether this CResult_ECDSASignatureNoneZ represents a success state.
2455     */
2456    bool result_ok;
2457 } LDKCResult_ECDSASignatureNoneZ;
2458
2459 /**
2460  * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2461  */
2462 typedef struct LDKPublicKey {
2463    /**
2464     * The bytes of the public key
2465     */
2466    uint8_t compressed_form[33];
2467 } LDKPublicKey;
2468
2469 /**
2470  * The contents of CResult_PublicKeyNoneZ
2471  */
2472 typedef union LDKCResult_PublicKeyNoneZPtr {
2473    /**
2474     * A pointer to the contents in the success state.
2475     * Reading from this pointer when `result_ok` is not set is undefined.
2476     */
2477    struct LDKPublicKey *result;
2478    /**
2479     * Note that this value is always NULL, as there are no contents in the Err variant
2480     */
2481    void *err;
2482 } LDKCResult_PublicKeyNoneZPtr;
2483
2484 /**
2485  * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2486  * containing a crate::c_types::PublicKey on success and a () on failure.
2487  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2488  */
2489 typedef struct LDKCResult_PublicKeyNoneZ {
2490    /**
2491     * The contents of this CResult_PublicKeyNoneZ, accessible via either
2492     * `err` or `result` depending on the state of `result_ok`.
2493     */
2494    union LDKCResult_PublicKeyNoneZPtr contents;
2495    /**
2496     * Whether this CResult_PublicKeyNoneZ represents a success state.
2497     */
2498    bool result_ok;
2499 } LDKCResult_PublicKeyNoneZ;
2500
2501 /**
2502  * An enum which can either contain a crate::c_types::BigEndianScalar or not
2503  */
2504 typedef enum LDKCOption_BigEndianScalarZ_Tag {
2505    /**
2506     * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
2507     */
2508    LDKCOption_BigEndianScalarZ_Some,
2509    /**
2510     * When we're in this state, this COption_BigEndianScalarZ contains nothing
2511     */
2512    LDKCOption_BigEndianScalarZ_None,
2513    /**
2514     * Must be last for serialization purposes
2515     */
2516    LDKCOption_BigEndianScalarZ_Sentinel,
2517 } LDKCOption_BigEndianScalarZ_Tag;
2518
2519 typedef struct LDKCOption_BigEndianScalarZ {
2520    LDKCOption_BigEndianScalarZ_Tag tag;
2521    union {
2522       struct {
2523          struct LDKBigEndianScalar some;
2524       };
2525    };
2526 } LDKCOption_BigEndianScalarZ;
2527
2528 /**
2529  * Integer in the range `0..32`
2530  */
2531 typedef struct LDKU5 {
2532    uint8_t _0;
2533 } LDKU5;
2534
2535 /**
2536  * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2537  * This corresponds to std::vector in C++
2538  */
2539 typedef struct LDKCVec_U5Z {
2540    /**
2541     * The elements in the array.
2542     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2543     */
2544    struct LDKU5 *data;
2545    /**
2546     * The number of elements pointed to by `data`.
2547     */
2548    uintptr_t datalen;
2549 } LDKCVec_U5Z;
2550
2551 /**
2552  * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2553  * allows recovering the exact public key which created the signature given the message.
2554  */
2555 typedef struct LDKRecoverableSignature {
2556    /**
2557     * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2558     * recovery.
2559     */
2560    uint8_t serialized_form[68];
2561 } LDKRecoverableSignature;
2562
2563 /**
2564  * The contents of CResult_RecoverableSignatureNoneZ
2565  */
2566 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2567    /**
2568     * A pointer to the contents in the success state.
2569     * Reading from this pointer when `result_ok` is not set is undefined.
2570     */
2571    struct LDKRecoverableSignature *result;
2572    /**
2573     * Note that this value is always NULL, as there are no contents in the Err variant
2574     */
2575    void *err;
2576 } LDKCResult_RecoverableSignatureNoneZPtr;
2577
2578 /**
2579  * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2580  * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2581  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2582  */
2583 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2584    /**
2585     * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2586     * `err` or `result` depending on the state of `result_ok`.
2587     */
2588    union LDKCResult_RecoverableSignatureNoneZPtr contents;
2589    /**
2590     * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
2591     */
2592    bool result_ok;
2593 } LDKCResult_RecoverableSignatureNoneZ;
2594
2595 /**
2596  * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2597  */
2598 typedef struct LDKSchnorrSignature {
2599    /**
2600     * The bytes of the signature as two 32-byte numbers
2601     */
2602    uint8_t compact_form[64];
2603 } LDKSchnorrSignature;
2604
2605 /**
2606  * The contents of CResult_SchnorrSignatureNoneZ
2607  */
2608 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2609    /**
2610     * A pointer to the contents in the success state.
2611     * Reading from this pointer when `result_ok` is not set is undefined.
2612     */
2613    struct LDKSchnorrSignature *result;
2614    /**
2615     * Note that this value is always NULL, as there are no contents in the Err variant
2616     */
2617    void *err;
2618 } LDKCResult_SchnorrSignatureNoneZPtr;
2619
2620 /**
2621  * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2622  * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2623  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2624  */
2625 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2626    /**
2627     * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2628     * `err` or `result` depending on the state of `result_ok`.
2629     */
2630    union LDKCResult_SchnorrSignatureNoneZPtr contents;
2631    /**
2632     * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2633     */
2634    bool result_ok;
2635 } LDKCResult_SchnorrSignatureNoneZ;
2636
2637
2638
2639 /**
2640  * This class tracks the per-transaction information needed to build a commitment transaction and will
2641  * actually build it and sign.  It is used for holder transactions that we sign only when needed
2642  * and for transactions we sign for the counterparty.
2643  *
2644  * This class can be used inside a signer implementation to generate a signature given the relevant
2645  * secret key.
2646  */
2647 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
2648    /**
2649     * A pointer to the opaque Rust object.
2650     * Nearly everywhere, inner must be non-null, however in places where
2651     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2652     */
2653    LDKnativeCommitmentTransaction *inner;
2654    /**
2655     * Indicates that this is the only struct which contains the same pointer.
2656     * Rust functions which take ownership of an object provided via an argument require
2657     * this to be true and invalidate the object pointed to by inner.
2658     */
2659    bool is_owned;
2660 } LDKCommitmentTransaction;
2661
2662
2663
2664 /**
2665  * Information needed to build and sign a holder's commitment transaction.
2666  *
2667  * The transaction is only signed once we are ready to broadcast.
2668  */
2669 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
2670    /**
2671     * A pointer to the opaque Rust object.
2672     * Nearly everywhere, inner must be non-null, however in places where
2673     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2674     */
2675    LDKnativeHolderCommitmentTransaction *inner;
2676    /**
2677     * Indicates that this is the only struct which contains the same pointer.
2678     * Rust functions which take ownership of an object provided via an argument require
2679     * this to be true and invalidate the object pointed to by inner.
2680     */
2681    bool is_owned;
2682 } LDKHolderCommitmentTransaction;
2683
2684
2685
2686 /**
2687  * Information about an HTLC as it appears in a commitment transaction
2688  */
2689 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
2690    /**
2691     * A pointer to the opaque Rust object.
2692     * Nearly everywhere, inner must be non-null, however in places where
2693     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2694     */
2695    LDKnativeHTLCOutputInCommitment *inner;
2696    /**
2697     * Indicates that this is the only struct which contains the same pointer.
2698     * Rust functions which take ownership of an object provided via an argument require
2699     * this to be true and invalidate the object pointed to by inner.
2700     */
2701    bool is_owned;
2702 } LDKHTLCOutputInCommitment;
2703
2704
2705
2706 /**
2707  * This class tracks the per-transaction information needed to build a closing transaction and will
2708  * actually build it and sign.
2709  *
2710  * This class can be used inside a signer implementation to generate a signature given the relevant
2711  * secret key.
2712  */
2713 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
2714    /**
2715     * A pointer to the opaque Rust object.
2716     * Nearly everywhere, inner must be non-null, however in places where
2717     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2718     */
2719    LDKnativeClosingTransaction *inner;
2720    /**
2721     * Indicates that this is the only struct which contains the same pointer.
2722     * Rust functions which take ownership of an object provided via an argument require
2723     * this to be true and invalidate the object pointed to by inner.
2724     */
2725    bool is_owned;
2726 } LDKClosingTransaction;
2727
2728
2729
2730 /**
2731  * The unsigned part of a [`channel_announcement`] message.
2732  *
2733  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
2734  */
2735 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2736    /**
2737     * A pointer to the opaque Rust object.
2738     * Nearly everywhere, inner must be non-null, however in places where
2739     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2740     */
2741    LDKnativeUnsignedChannelAnnouncement *inner;
2742    /**
2743     * Indicates that this is the only struct which contains the same pointer.
2744     * Rust functions which take ownership of an object provided via an argument require
2745     * this to be true and invalidate the object pointed to by inner.
2746     */
2747    bool is_owned;
2748 } LDKUnsignedChannelAnnouncement;
2749
2750
2751
2752 /**
2753  * One counterparty's public keys which do not change over the life of a channel.
2754  */
2755 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
2756    /**
2757     * A pointer to the opaque Rust object.
2758     * Nearly everywhere, inner must be non-null, however in places where
2759     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2760     */
2761    LDKnativeChannelPublicKeys *inner;
2762    /**
2763     * Indicates that this is the only struct which contains the same pointer.
2764     * Rust functions which take ownership of an object provided via an argument require
2765     * this to be true and invalidate the object pointed to by inner.
2766     */
2767    bool is_owned;
2768 } LDKChannelPublicKeys;
2769
2770
2771
2772 /**
2773  * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
2774  * The fields are organized by holder/counterparty.
2775  *
2776  * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
2777  * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
2778  */
2779 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
2780    /**
2781     * A pointer to the opaque Rust object.
2782     * Nearly everywhere, inner must be non-null, however in places where
2783     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2784     */
2785    LDKnativeChannelTransactionParameters *inner;
2786    /**
2787     * Indicates that this is the only struct which contains the same pointer.
2788     * Rust functions which take ownership of an object provided via an argument require
2789     * this to be true and invalidate the object pointed to by inner.
2790     */
2791    bool is_owned;
2792 } LDKChannelTransactionParameters;
2793
2794 /**
2795  * A trait to handle Lightning channel key material without concretizing the channel type or
2796  * the signature mechanism.
2797  */
2798 typedef struct LDKChannelSigner {
2799    /**
2800     * An opaque pointer which is passed to your function implementations as an argument.
2801     * This has no meaning in the LDK, and can be NULL or any other value.
2802     */
2803    void *this_arg;
2804    /**
2805     * Gets the per-commitment point for a specific commitment number
2806     *
2807     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2808     */
2809    struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2810    /**
2811     * Gets the commitment secret for a specific commitment number as part of the revocation process
2812     *
2813     * An external signer implementation should error here if the commitment was already signed
2814     * and should refuse to sign it in the future.
2815     *
2816     * May be called more than once for the same index.
2817     *
2818     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2819     */
2820    struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2821    /**
2822     * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
2823     *
2824     * This is required in order for the signer to make sure that releasing a commitment
2825     * secret won't leave us without a broadcastable holder transaction.
2826     * Policy checks should be implemented in this function, including checking the amount
2827     * sent to us and checking the HTLCs.
2828     *
2829     * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2830     * A validating signer should ensure that an HTLC output is removed only when the matching
2831     * preimage is provided, or when the value to holder is restored.
2832     *
2833     * Note that all the relevant preimages will be provided, but there may also be additional
2834     * irrelevant or duplicate preimages.
2835     */
2836    struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ preimages);
2837    /**
2838     * Returns the holder's channel public keys and basepoints.
2839     */
2840    struct LDKChannelPublicKeys pubkeys;
2841    /**
2842     * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2843     * Note that this takes a pointer to this object, not the this_ptr like other methods do
2844     * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2845     */
2846    void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
2847    /**
2848     * Returns an arbitrary identifier describing the set of keys which are provided back to you in
2849     * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
2850     * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
2851     */
2852    struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2853    /**
2854     * Set the counterparty static channel data, including basepoints,
2855     * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
2856     *
2857     * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
2858     * instance, LDK will call this method exactly once - either immediately after construction
2859     * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
2860     * information has been generated.
2861     *
2862     * channel_parameters.is_populated() MUST be true.
2863     */
2864    void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2865    /**
2866     * Frees any resources associated with this object given its this_arg pointer.
2867     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2868     */
2869    void (*free)(void *this_arg);
2870 } LDKChannelSigner;
2871
2872 /**
2873  * A trait to sign Lightning channel transactions as described in
2874  * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
2875  *
2876  * Signing services could be implemented on a hardware wallet and should implement signing
2877  * policies in order to be secure. Please refer to the [VLS Policy
2878  * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
2879  * for an example of such policies.
2880  */
2881 typedef struct LDKEcdsaChannelSigner {
2882    /**
2883     * An opaque pointer which is passed to your function implementations as an argument.
2884     * This has no meaning in the LDK, and can be NULL or any other value.
2885     */
2886    void *this_arg;
2887    /**
2888     * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2889     *
2890     * Note that if signing fails or is rejected, the channel will be force-closed.
2891     *
2892     * Policy checks should be implemented in this function, including checking the amount
2893     * sent to us and checking the HTLCs.
2894     *
2895     * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2896     * A validating signer should ensure that an HTLC output is removed only when the matching
2897     * preimage is provided, or when the value to holder is restored.
2898     *
2899     * Note that all the relevant preimages will be provided, but there may also be additional
2900     * irrelevant or duplicate preimages.
2901     */
2902    struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ preimages);
2903    /**
2904     * Validate the counterparty's revocation.
2905     *
2906     * This is required in order for the signer to make sure that the state has moved
2907     * forward and it is safe to sign the next counterparty commitment.
2908     */
2909    struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
2910    /**
2911     * Creates a signature for a holder's commitment transaction.
2912     *
2913     * This will be called
2914     * - with a non-revoked `commitment_tx`.
2915     * - with the latest `commitment_tx` when we initiate a force-close.
2916     *
2917     * This may be called multiple times for the same transaction.
2918     *
2919     * An external signer implementation should check that the commitment has not been revoked.
2920     */
2921    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2922    /**
2923     * Create a signature for the given input in a transaction spending an HTLC transaction output
2924     * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
2925     *
2926     * A justice transaction may claim multiple outputs at the same time if timelocks are
2927     * similar, but only a signature for the input at index `input` should be signed for here.
2928     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2929     * to an upcoming timelock expiration.
2930     *
2931     * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2932     *
2933     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2934     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2935     * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
2936     * so).
2937     */
2938    struct LDKCResult_ECDSASignatureNoneZ (*sign_justice_revoked_output)(const void *this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32]);
2939    /**
2940     * Create a signature for the given input in a transaction spending a commitment transaction
2941     * HTLC output when our counterparty broadcasts an old state.
2942     *
2943     * A justice transaction may claim multiple outputs at the same time if timelocks are
2944     * similar, but only a signature for the input at index `input` should be signed for here.
2945     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2946     * to an upcoming timelock expiration.
2947     *
2948     * `amount` is the value of the output spent by this input, committed to in the BIP 143
2949     * signature.
2950     *
2951     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2952     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2953     * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2954     * so).
2955     *
2956     * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
2957     * (which is committed to in the BIP 143 signatures).
2958     */
2959    struct LDKCResult_ECDSASignatureNoneZ (*sign_justice_revoked_htlc)(const void *this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
2960    /**
2961     * Computes the signature for a commitment transaction's HTLC output used as an input within
2962     * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
2963     * must be be computed using [`EcdsaSighashType::All`].
2964     *
2965     * Note that this may be called for HTLCs in the penultimate commitment transaction if a
2966     * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
2967     * broadcasts it before receiving the update for the latest commitment transaction.
2968     *
2969     * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
2970     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2971     */
2972    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_htlc_transaction)(const void *this_arg, struct LDKTransaction htlc_tx, uintptr_t input, const struct LDKHTLCDescriptor *NONNULL_PTR htlc_descriptor);
2973    /**
2974     * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2975     * transaction, either offered or received.
2976     *
2977     * Such a transaction may claim multiples offered outputs at same time if we know the
2978     * preimage for each when we create it, but only the input at index `input` should be
2979     * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2980     * needed with regards to an upcoming timelock expiration.
2981     *
2982     * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
2983     * outputs.
2984     *
2985     * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
2986     *
2987     * `per_commitment_point` is the dynamic point corresponding to the channel state
2988     * detected onchain. It has been generated by our counterparty and is used to derive
2989     * channel state keys, which are then included in the witness script and committed to in the
2990     * BIP 143 signature.
2991     */
2992    struct LDKCResult_ECDSASignatureNoneZ (*sign_counterparty_htlc_transaction)(const void *this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
2993    /**
2994     * Create a signature for a (proposed) closing transaction.
2995     *
2996     * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2997     * chosen to forgo their output as dust.
2998     */
2999    struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
3000    /**
3001     * Computes the signature for a commitment transaction's anchor output used as an
3002     * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
3003     */
3004    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
3005    /**
3006     * Signs a channel announcement message with our funding key proving it comes from one of the
3007     * channel participants.
3008     *
3009     * Channel announcements also require a signature from each node's network key. Our node
3010     * signature is computed through [`NodeSigner::sign_gossip_message`].
3011     *
3012     * Note that if this fails or is rejected, the channel will not be publicly announced and
3013     * our counterparty may (though likely will not) close the channel on us for violating the
3014     * protocol.
3015     */
3016    struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3017    /**
3018     * Implementation of ChannelSigner for this object.
3019     */
3020    struct LDKChannelSigner ChannelSigner;
3021    /**
3022     * Frees any resources associated with this object given its this_arg pointer.
3023     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3024     */
3025    void (*free)(void *this_arg);
3026 } LDKEcdsaChannelSigner;
3027
3028 /**
3029  * A writeable signer.
3030  *
3031  * There will always be two instances of a signer per channel, one occupied by the
3032  * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
3033  *
3034  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3035  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3036  */
3037 typedef struct LDKWriteableEcdsaChannelSigner {
3038    /**
3039     * An opaque pointer which is passed to your function implementations as an argument.
3040     * This has no meaning in the LDK, and can be NULL or any other value.
3041     */
3042    void *this_arg;
3043    /**
3044     * Implementation of EcdsaChannelSigner for this object.
3045     */
3046    struct LDKEcdsaChannelSigner EcdsaChannelSigner;
3047    /**
3048     * Serialize the object into a byte array
3049     */
3050    struct LDKCVec_u8Z (*write)(const void *this_arg);
3051    /**
3052     * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
3053     * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
3054     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3055     */
3056    void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
3057    /**
3058     * Frees any resources associated with this object given its this_arg pointer.
3059     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3060     */
3061    void (*free)(void *this_arg);
3062 } LDKWriteableEcdsaChannelSigner;
3063
3064 /**
3065  * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
3066  */
3067 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
3068    /**
3069     * A pointer to the contents in the success state.
3070     * Reading from this pointer when `result_ok` is not set is undefined.
3071     */
3072    struct LDKWriteableEcdsaChannelSigner *result;
3073    /**
3074     * A pointer to the contents in the error state.
3075     * Reading from this pointer when `result_ok` is set is undefined.
3076     */
3077    struct LDKDecodeError *err;
3078 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
3079
3080 /**
3081  * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
3082  * containing a crate::lightning::sign::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3083  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3084  */
3085 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
3086    /**
3087     * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
3088     * `err` or `result` depending on the state of `result_ok`.
3089     */
3090    union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
3091    /**
3092     * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
3093     */
3094    bool result_ok;
3095 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
3096
3097 /**
3098  * The contents of CResult_CVec_u8ZNoneZ
3099  */
3100 typedef union LDKCResult_CVec_u8ZNoneZPtr {
3101    /**
3102     * A pointer to the contents in the success state.
3103     * Reading from this pointer when `result_ok` is not set is undefined.
3104     */
3105    struct LDKCVec_u8Z *result;
3106    /**
3107     * Note that this value is always NULL, as there are no contents in the Err variant
3108     */
3109    void *err;
3110 } LDKCResult_CVec_u8ZNoneZPtr;
3111
3112 /**
3113  * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
3114  * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
3115  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3116  */
3117 typedef struct LDKCResult_CVec_u8ZNoneZ {
3118    /**
3119     * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
3120     * `err` or `result` depending on the state of `result_ok`.
3121     */
3122    union LDKCResult_CVec_u8ZNoneZPtr contents;
3123    /**
3124     * Whether this CResult_CVec_u8ZNoneZ represents a success state.
3125     */
3126    bool result_ok;
3127 } LDKCResult_CVec_u8ZNoneZ;
3128
3129 /**
3130  * The contents of CResult_ShutdownScriptNoneZ
3131  */
3132 typedef union LDKCResult_ShutdownScriptNoneZPtr {
3133    /**
3134     * A pointer to the contents in the success state.
3135     * Reading from this pointer when `result_ok` is not set is undefined.
3136     */
3137    struct LDKShutdownScript *result;
3138    /**
3139     * Note that this value is always NULL, as there are no contents in the Err variant
3140     */
3141    void *err;
3142 } LDKCResult_ShutdownScriptNoneZPtr;
3143
3144 /**
3145  * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
3146  * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
3147  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3148  */
3149 typedef struct LDKCResult_ShutdownScriptNoneZ {
3150    /**
3151     * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
3152     * `err` or `result` depending on the state of `result_ok`.
3153     */
3154    union LDKCResult_ShutdownScriptNoneZPtr contents;
3155    /**
3156     * Whether this CResult_ShutdownScriptNoneZ represents a success state.
3157     */
3158    bool result_ok;
3159 } LDKCResult_ShutdownScriptNoneZ;
3160
3161 /**
3162  * An enum which can either contain a u16 or not
3163  */
3164 typedef enum LDKCOption_u16Z_Tag {
3165    /**
3166     * When we're in this state, this COption_u16Z contains a u16
3167     */
3168    LDKCOption_u16Z_Some,
3169    /**
3170     * When we're in this state, this COption_u16Z contains nothing
3171     */
3172    LDKCOption_u16Z_None,
3173    /**
3174     * Must be last for serialization purposes
3175     */
3176    LDKCOption_u16Z_Sentinel,
3177 } LDKCOption_u16Z_Tag;
3178
3179 typedef struct LDKCOption_u16Z {
3180    LDKCOption_u16Z_Tag tag;
3181    union {
3182       struct {
3183          uint16_t some;
3184       };
3185    };
3186 } LDKCOption_u16Z;
3187
3188 /**
3189  * An enum which can either contain a bool or not
3190  */
3191 typedef enum LDKCOption_boolZ_Tag {
3192    /**
3193     * When we're in this state, this COption_boolZ contains a bool
3194     */
3195    LDKCOption_boolZ_Some,
3196    /**
3197     * When we're in this state, this COption_boolZ contains nothing
3198     */
3199    LDKCOption_boolZ_None,
3200    /**
3201     * Must be last for serialization purposes
3202     */
3203    LDKCOption_boolZ_Sentinel,
3204 } LDKCOption_boolZ_Tag;
3205
3206 typedef struct LDKCOption_boolZ {
3207    LDKCOption_boolZ_Tag tag;
3208    union {
3209       struct {
3210          bool some;
3211       };
3212    };
3213 } LDKCOption_boolZ;
3214
3215 /**
3216  * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
3217  * This corresponds to std::vector in C++
3218  */
3219 typedef struct LDKCVec_CVec_u8ZZ {
3220    /**
3221     * The elements in the array.
3222     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3223     */
3224    struct LDKCVec_u8Z *data;
3225    /**
3226     * The number of elements pointed to by `data`.
3227     */
3228    uintptr_t datalen;
3229 } LDKCVec_CVec_u8ZZ;
3230
3231 /**
3232  * The contents of CResult_CVec_CVec_u8ZZNoneZ
3233  */
3234 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3235    /**
3236     * A pointer to the contents in the success state.
3237     * Reading from this pointer when `result_ok` is not set is undefined.
3238     */
3239    struct LDKCVec_CVec_u8ZZ *result;
3240    /**
3241     * Note that this value is always NULL, as there are no contents in the Err variant
3242     */
3243    void *err;
3244 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3245
3246 /**
3247  * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
3248  * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
3249  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3250  */
3251 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3252    /**
3253     * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
3254     * `err` or `result` depending on the state of `result_ok`.
3255     */
3256    union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3257    /**
3258     * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
3259     */
3260    bool result_ok;
3261 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3262
3263
3264
3265 /**
3266  * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3267  *
3268  * This implementation performs no policy checks and is insufficient by itself as
3269  * a secure external signer.
3270  */
3271 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3272    /**
3273     * A pointer to the opaque Rust object.
3274     * Nearly everywhere, inner must be non-null, however in places where
3275     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3276     */
3277    LDKnativeInMemorySigner *inner;
3278    /**
3279     * Indicates that this is the only struct which contains the same pointer.
3280     * Rust functions which take ownership of an object provided via an argument require
3281     * this to be true and invalidate the object pointed to by inner.
3282     */
3283    bool is_owned;
3284 } LDKInMemorySigner;
3285
3286 /**
3287  * The contents of CResult_InMemorySignerDecodeErrorZ
3288  */
3289 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3290    /**
3291     * A pointer to the contents in the success state.
3292     * Reading from this pointer when `result_ok` is not set is undefined.
3293     */
3294    struct LDKInMemorySigner *result;
3295    /**
3296     * A pointer to the contents in the error state.
3297     * Reading from this pointer when `result_ok` is set is undefined.
3298     */
3299    struct LDKDecodeError *err;
3300 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3301
3302 /**
3303  * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3304  * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3305  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3306  */
3307 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3308    /**
3309     * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3310     * `err` or `result` depending on the state of `result_ok`.
3311     */
3312    union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3313    /**
3314     * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3315     */
3316    bool result_ok;
3317 } LDKCResult_InMemorySignerDecodeErrorZ;
3318
3319 /**
3320  * The contents of CResult_TransactionNoneZ
3321  */
3322 typedef union LDKCResult_TransactionNoneZPtr {
3323    /**
3324     * A pointer to the contents in the success state.
3325     * Reading from this pointer when `result_ok` is not set is undefined.
3326     */
3327    struct LDKTransaction *result;
3328    /**
3329     * Note that this value is always NULL, as there are no contents in the Err variant
3330     */
3331    void *err;
3332 } LDKCResult_TransactionNoneZPtr;
3333
3334 /**
3335  * A CResult_TransactionNoneZ represents the result of a fallible operation,
3336  * containing a crate::c_types::Transaction on success and a () on failure.
3337  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3338  */
3339 typedef struct LDKCResult_TransactionNoneZ {
3340    /**
3341     * The contents of this CResult_TransactionNoneZ, accessible via either
3342     * `err` or `result` depending on the state of `result_ok`.
3343     */
3344    union LDKCResult_TransactionNoneZPtr contents;
3345    /**
3346     * Whether this CResult_TransactionNoneZ represents a success state.
3347     */
3348    bool result_ok;
3349 } LDKCResult_TransactionNoneZ;
3350
3351
3352
3353 /**
3354  * Represents the compressed public key of a node
3355  */
3356 typedef struct MUST_USE_STRUCT LDKNodeId {
3357    /**
3358     * A pointer to the opaque Rust object.
3359     * Nearly everywhere, inner must be non-null, however in places where
3360     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3361     */
3362    LDKnativeNodeId *inner;
3363    /**
3364     * Indicates that this is the only struct which contains the same pointer.
3365     * Rust functions which take ownership of an object provided via an argument require
3366     * this to be true and invalidate the object pointed to by inner.
3367     */
3368    bool is_owned;
3369 } LDKNodeId;
3370
3371
3372
3373 /**
3374  * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
3375  */
3376 typedef struct MUST_USE_STRUCT LDKChannelUsage {
3377    /**
3378     * A pointer to the opaque Rust object.
3379     * Nearly everywhere, inner must be non-null, however in places where
3380     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3381     */
3382    LDKnativeChannelUsage *inner;
3383    /**
3384     * Indicates that this is the only struct which contains the same pointer.
3385     * Rust functions which take ownership of an object provided via an argument require
3386     * this to be true and invalidate the object pointed to by inner.
3387     */
3388    bool is_owned;
3389 } LDKChannelUsage;
3390
3391
3392
3393 /**
3394  * Parameters for configuring [`ProbabilisticScorer`].
3395  *
3396  * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
3397  * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
3398  *
3399  * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
3400  * parameters here.
3401  */
3402 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
3403    /**
3404     * A pointer to the opaque Rust object.
3405     * Nearly everywhere, inner must be non-null, however in places where
3406     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3407     */
3408    LDKnativeProbabilisticScoringFeeParameters *inner;
3409    /**
3410     * Indicates that this is the only struct which contains the same pointer.
3411     * Rust functions which take ownership of an object provided via an argument require
3412     * this to be true and invalidate the object pointed to by inner.
3413     */
3414    bool is_owned;
3415 } LDKProbabilisticScoringFeeParameters;
3416
3417 /**
3418  * An interface used to score payment channels for path finding.
3419  *
3420  * `ScoreLookUp` is used to determine the penalty for a given channel.
3421  *
3422  * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
3423  */
3424 typedef struct LDKScoreLookUp {
3425    /**
3426     * An opaque pointer which is passed to your function implementations as an argument.
3427     * This has no meaning in the LDK, and can be NULL or any other value.
3428     */
3429    void *this_arg;
3430    /**
3431     * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
3432     * given channel in the direction from `source` to `target`.
3433     *
3434     * The channel's capacity (less any other MPP parts that are also being considered for use in
3435     * the same payment) is given by `capacity_msat`. It may be determined from various sources
3436     * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
3437     * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
3438     * Thus, implementations should be overflow-safe.
3439     */
3440    uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
3441    /**
3442     * Frees any resources associated with this object given its this_arg pointer.
3443     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3444     */
3445    void (*free)(void *this_arg);
3446 } LDKScoreLookUp;
3447
3448
3449
3450 /**
3451  * A path in a [`Route`] to the payment recipient. Must always be at least length one.
3452  * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
3453  */
3454 typedef struct MUST_USE_STRUCT LDKPath {
3455    /**
3456     * A pointer to the opaque Rust object.
3457     * Nearly everywhere, inner must be non-null, however in places where
3458     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3459     */
3460    LDKnativePath *inner;
3461    /**
3462     * Indicates that this is the only struct which contains the same pointer.
3463     * Rust functions which take ownership of an object provided via an argument require
3464     * this to be true and invalidate the object pointed to by inner.
3465     */
3466    bool is_owned;
3467 } LDKPath;
3468
3469 /**
3470  * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
3471  */
3472 typedef struct LDKScoreUpdate {
3473    /**
3474     * An opaque pointer which is passed to your function implementations as an argument.
3475     * This has no meaning in the LDK, and can be NULL or any other value.
3476     */
3477    void *this_arg;
3478    /**
3479     * Handles updating channel penalties after failing to route through a channel.
3480     */
3481    void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3482    /**
3483     * Handles updating channel penalties after successfully routing along a path.
3484     */
3485    void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3486    /**
3487     * Handles updating channel penalties after a probe over the given path failed.
3488     */
3489    void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3490    /**
3491     * Handles updating channel penalties after a probe over the given path succeeded.
3492     */
3493    void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3494    /**
3495     * Frees any resources associated with this object given its this_arg pointer.
3496     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3497     */
3498    void (*free)(void *this_arg);
3499 } LDKScoreUpdate;
3500
3501 /**
3502  * A scorer that is accessed under a lock.
3503  *
3504  * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
3505  * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
3506  * implementations. Internal locking would be detrimental to route finding performance and could
3507  * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
3508  *
3509  * [`find_route`]: crate::routing::router::find_route
3510  */
3511 typedef struct LDKLockableScore {
3512    /**
3513     * An opaque pointer which is passed to your function implementations as an argument.
3514     * This has no meaning in the LDK, and can be NULL or any other value.
3515     */
3516    void *this_arg;
3517    /**
3518     * Returns read locked scorer.
3519     */
3520    struct LDKScoreLookUp (*read_lock)(const void *this_arg);
3521    /**
3522     * Returns write locked scorer.
3523     */
3524    struct LDKScoreUpdate (*write_lock)(const void *this_arg);
3525    /**
3526     * Frees any resources associated with this object given its this_arg pointer.
3527     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3528     */
3529    void (*free)(void *this_arg);
3530 } LDKLockableScore;
3531
3532 /**
3533  * Refers to a scorer that is accessible under lock and also writeable to disk
3534  *
3535  * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
3536  * use the Persister to persist it.
3537  */
3538 typedef struct LDKWriteableScore {
3539    /**
3540     * An opaque pointer which is passed to your function implementations as an argument.
3541     * This has no meaning in the LDK, and can be NULL or any other value.
3542     */
3543    void *this_arg;
3544    /**
3545     * Implementation of LockableScore for this object.
3546     */
3547    struct LDKLockableScore LockableScore;
3548    /**
3549     * Serialize the object into a byte array
3550     */
3551    struct LDKCVec_u8Z (*write)(const void *this_arg);
3552    /**
3553     * Frees any resources associated with this object given its this_arg pointer.
3554     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3555     */
3556    void (*free)(void *this_arg);
3557 } LDKWriteableScore;
3558
3559 /**
3560  * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
3561  */
3562 typedef enum LDKCOption_WriteableScoreZ_Tag {
3563    /**
3564     * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
3565     */
3566    LDKCOption_WriteableScoreZ_Some,
3567    /**
3568     * When we're in this state, this COption_WriteableScoreZ contains nothing
3569     */
3570    LDKCOption_WriteableScoreZ_None,
3571    /**
3572     * Must be last for serialization purposes
3573     */
3574    LDKCOption_WriteableScoreZ_Sentinel,
3575 } LDKCOption_WriteableScoreZ_Tag;
3576
3577 typedef struct LDKCOption_WriteableScoreZ {
3578    LDKCOption_WriteableScoreZ_Tag tag;
3579    union {
3580       struct {
3581          struct LDKWriteableScore some;
3582       };
3583    };
3584 } LDKCOption_WriteableScoreZ;
3585
3586 /**
3587  * The contents of CResult_NoneIOErrorZ
3588  */
3589 typedef union LDKCResult_NoneIOErrorZPtr {
3590    /**
3591     * Note that this value is always NULL, as there are no contents in the OK variant
3592     */
3593    void *result;
3594    /**
3595     * A pointer to the contents in the error state.
3596     * Reading from this pointer when `result_ok` is set is undefined.
3597     */
3598    enum LDKIOError *err;
3599 } LDKCResult_NoneIOErrorZPtr;
3600
3601 /**
3602  * A CResult_NoneIOErrorZ represents the result of a fallible operation,
3603  * containing a () on success and a crate::c_types::IOError on failure.
3604  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3605  */
3606 typedef struct LDKCResult_NoneIOErrorZ {
3607    /**
3608     * The contents of this CResult_NoneIOErrorZ, accessible via either
3609     * `err` or `result` depending on the state of `result_ok`.
3610     */
3611    union LDKCResult_NoneIOErrorZPtr contents;
3612    /**
3613     * Whether this CResult_NoneIOErrorZ represents a success state.
3614     */
3615    bool result_ok;
3616 } LDKCResult_NoneIOErrorZ;
3617
3618
3619
3620 /**
3621  * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
3622  */
3623 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3624    /**
3625     * A pointer to the opaque Rust object.
3626     * Nearly everywhere, inner must be non-null, however in places where
3627     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3628     */
3629    LDKnativeChannelDetails *inner;
3630    /**
3631     * Indicates that this is the only struct which contains the same pointer.
3632     * Rust functions which take ownership of an object provided via an argument require
3633     * this to be true and invalidate the object pointed to by inner.
3634     */
3635    bool is_owned;
3636 } LDKChannelDetails;
3637
3638 /**
3639  * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3640  * This corresponds to std::vector in C++
3641  */
3642 typedef struct LDKCVec_ChannelDetailsZ {
3643    /**
3644     * The elements in the array.
3645     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3646     */
3647    struct LDKChannelDetails *data;
3648    /**
3649     * The number of elements pointed to by `data`.
3650     */
3651    uintptr_t datalen;
3652 } LDKCVec_ChannelDetailsZ;
3653
3654
3655
3656 /**
3657  * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3658  * it can take multiple paths. Each path is composed of one or more hops through the network.
3659  */
3660 typedef struct MUST_USE_STRUCT LDKRoute {
3661    /**
3662     * A pointer to the opaque Rust object.
3663     * Nearly everywhere, inner must be non-null, however in places where
3664     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3665     */
3666    LDKnativeRoute *inner;
3667    /**
3668     * Indicates that this is the only struct which contains the same pointer.
3669     * Rust functions which take ownership of an object provided via an argument require
3670     * this to be true and invalidate the object pointed to by inner.
3671     */
3672    bool is_owned;
3673 } LDKRoute;
3674
3675
3676
3677 /**
3678  * An Err type for failure to process messages.
3679  */
3680 typedef struct MUST_USE_STRUCT LDKLightningError {
3681    /**
3682     * A pointer to the opaque Rust object.
3683     * Nearly everywhere, inner must be non-null, however in places where
3684     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3685     */
3686    LDKnativeLightningError *inner;
3687    /**
3688     * Indicates that this is the only struct which contains the same pointer.
3689     * Rust functions which take ownership of an object provided via an argument require
3690     * this to be true and invalidate the object pointed to by inner.
3691     */
3692    bool is_owned;
3693 } LDKLightningError;
3694
3695 /**
3696  * The contents of CResult_RouteLightningErrorZ
3697  */
3698 typedef union LDKCResult_RouteLightningErrorZPtr {
3699    /**
3700     * A pointer to the contents in the success state.
3701     * Reading from this pointer when `result_ok` is not set is undefined.
3702     */
3703    struct LDKRoute *result;
3704    /**
3705     * A pointer to the contents in the error state.
3706     * Reading from this pointer when `result_ok` is set is undefined.
3707     */
3708    struct LDKLightningError *err;
3709 } LDKCResult_RouteLightningErrorZPtr;
3710
3711 /**
3712  * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3713  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3714  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3715  */
3716 typedef struct LDKCResult_RouteLightningErrorZ {
3717    /**
3718     * The contents of this CResult_RouteLightningErrorZ, accessible via either
3719     * `err` or `result` depending on the state of `result_ok`.
3720     */
3721    union LDKCResult_RouteLightningErrorZPtr contents;
3722    /**
3723     * Whether this CResult_RouteLightningErrorZ represents a success state.
3724     */
3725    bool result_ok;
3726 } LDKCResult_RouteLightningErrorZ;
3727
3728
3729
3730 /**
3731  * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
3732  * in-use channel liquidity.
3733  */
3734 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
3735    /**
3736     * A pointer to the opaque Rust object.
3737     * Nearly everywhere, inner must be non-null, however in places where
3738     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3739     */
3740    LDKnativeInFlightHtlcs *inner;
3741    /**
3742     * Indicates that this is the only struct which contains the same pointer.
3743     * Rust functions which take ownership of an object provided via an argument require
3744     * this to be true and invalidate the object pointed to by inner.
3745     */
3746    bool is_owned;
3747 } LDKInFlightHtlcs;
3748
3749 /**
3750  * The contents of CResult_InFlightHtlcsDecodeErrorZ
3751  */
3752 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
3753    /**
3754     * A pointer to the contents in the success state.
3755     * Reading from this pointer when `result_ok` is not set is undefined.
3756     */
3757    struct LDKInFlightHtlcs *result;
3758    /**
3759     * A pointer to the contents in the error state.
3760     * Reading from this pointer when `result_ok` is set is undefined.
3761     */
3762    struct LDKDecodeError *err;
3763 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
3764
3765 /**
3766  * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
3767  * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
3768  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3769  */
3770 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
3771    /**
3772     * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
3773     * `err` or `result` depending on the state of `result_ok`.
3774     */
3775    union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
3776    /**
3777     * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
3778     */
3779    bool result_ok;
3780 } LDKCResult_InFlightHtlcsDecodeErrorZ;
3781
3782
3783
3784 /**
3785  * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
3786  * that leads to it.
3787  */
3788 typedef struct MUST_USE_STRUCT LDKRouteHop {
3789    /**
3790     * A pointer to the opaque Rust object.
3791     * Nearly everywhere, inner must be non-null, however in places where
3792     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3793     */
3794    LDKnativeRouteHop *inner;
3795    /**
3796     * Indicates that this is the only struct which contains the same pointer.
3797     * Rust functions which take ownership of an object provided via an argument require
3798     * this to be true and invalidate the object pointed to by inner.
3799     */
3800    bool is_owned;
3801 } LDKRouteHop;
3802
3803 /**
3804  * The contents of CResult_RouteHopDecodeErrorZ
3805  */
3806 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
3807    /**
3808     * A pointer to the contents in the success state.
3809     * Reading from this pointer when `result_ok` is not set is undefined.
3810     */
3811    struct LDKRouteHop *result;
3812    /**
3813     * A pointer to the contents in the error state.
3814     * Reading from this pointer when `result_ok` is set is undefined.
3815     */
3816    struct LDKDecodeError *err;
3817 } LDKCResult_RouteHopDecodeErrorZPtr;
3818
3819 /**
3820  * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
3821  * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
3822  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3823  */
3824 typedef struct LDKCResult_RouteHopDecodeErrorZ {
3825    /**
3826     * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
3827     * `err` or `result` depending on the state of `result_ok`.
3828     */
3829    union LDKCResult_RouteHopDecodeErrorZPtr contents;
3830    /**
3831     * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
3832     */
3833    bool result_ok;
3834 } LDKCResult_RouteHopDecodeErrorZ;
3835
3836
3837
3838 /**
3839  * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
3840  * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
3841  * and thus can be used to hide the identity of the recipient.
3842  */
3843 typedef struct MUST_USE_STRUCT LDKBlindedHop {
3844    /**
3845     * A pointer to the opaque Rust object.
3846     * Nearly everywhere, inner must be non-null, however in places where
3847     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3848     */
3849    LDKnativeBlindedHop *inner;
3850    /**
3851     * Indicates that this is the only struct which contains the same pointer.
3852     * Rust functions which take ownership of an object provided via an argument require
3853     * this to be true and invalidate the object pointed to by inner.
3854     */
3855    bool is_owned;
3856 } LDKBlindedHop;
3857
3858 /**
3859  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
3860  * This corresponds to std::vector in C++
3861  */
3862 typedef struct LDKCVec_BlindedHopZ {
3863    /**
3864     * The elements in the array.
3865     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3866     */
3867    struct LDKBlindedHop *data;
3868    /**
3869     * The number of elements pointed to by `data`.
3870     */
3871    uintptr_t datalen;
3872 } LDKCVec_BlindedHopZ;
3873
3874
3875
3876 /**
3877  * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
3878  * their [`Bolt12Invoice`].
3879  *
3880  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
3881  */
3882 typedef struct MUST_USE_STRUCT LDKBlindedTail {
3883    /**
3884     * A pointer to the opaque Rust object.
3885     * Nearly everywhere, inner must be non-null, however in places where
3886     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3887     */
3888    LDKnativeBlindedTail *inner;
3889    /**
3890     * Indicates that this is the only struct which contains the same pointer.
3891     * Rust functions which take ownership of an object provided via an argument require
3892     * this to be true and invalidate the object pointed to by inner.
3893     */
3894    bool is_owned;
3895 } LDKBlindedTail;
3896
3897 /**
3898  * The contents of CResult_BlindedTailDecodeErrorZ
3899  */
3900 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
3901    /**
3902     * A pointer to the contents in the success state.
3903     * Reading from this pointer when `result_ok` is not set is undefined.
3904     */
3905    struct LDKBlindedTail *result;
3906    /**
3907     * A pointer to the contents in the error state.
3908     * Reading from this pointer when `result_ok` is set is undefined.
3909     */
3910    struct LDKDecodeError *err;
3911 } LDKCResult_BlindedTailDecodeErrorZPtr;
3912
3913 /**
3914  * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
3915  * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
3916  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3917  */
3918 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
3919    /**
3920     * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
3921     * `err` or `result` depending on the state of `result_ok`.
3922     */
3923    union LDKCResult_BlindedTailDecodeErrorZPtr contents;
3924    /**
3925     * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
3926     */
3927    bool result_ok;
3928 } LDKCResult_BlindedTailDecodeErrorZ;
3929
3930 /**
3931  * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3932  * This corresponds to std::vector in C++
3933  */
3934 typedef struct LDKCVec_RouteHopZ {
3935    /**
3936     * The elements in the array.
3937     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3938     */
3939    struct LDKRouteHop *data;
3940    /**
3941     * The number of elements pointed to by `data`.
3942     */
3943    uintptr_t datalen;
3944 } LDKCVec_RouteHopZ;
3945
3946 /**
3947  * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
3948  * This corresponds to std::vector in C++
3949  */
3950 typedef struct LDKCVec_PathZ {
3951    /**
3952     * The elements in the array.
3953     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3954     */
3955    struct LDKPath *data;
3956    /**
3957     * The number of elements pointed to by `data`.
3958     */
3959    uintptr_t datalen;
3960 } LDKCVec_PathZ;
3961
3962 /**
3963  * The contents of CResult_RouteDecodeErrorZ
3964  */
3965 typedef union LDKCResult_RouteDecodeErrorZPtr {
3966    /**
3967     * A pointer to the contents in the success state.
3968     * Reading from this pointer when `result_ok` is not set is undefined.
3969     */
3970    struct LDKRoute *result;
3971    /**
3972     * A pointer to the contents in the error state.
3973     * Reading from this pointer when `result_ok` is set is undefined.
3974     */
3975    struct LDKDecodeError *err;
3976 } LDKCResult_RouteDecodeErrorZPtr;
3977
3978 /**
3979  * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3980  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3981  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3982  */
3983 typedef struct LDKCResult_RouteDecodeErrorZ {
3984    /**
3985     * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3986     * `err` or `result` depending on the state of `result_ok`.
3987     */
3988    union LDKCResult_RouteDecodeErrorZPtr contents;
3989    /**
3990     * Whether this CResult_RouteDecodeErrorZ represents a success state.
3991     */
3992    bool result_ok;
3993 } LDKCResult_RouteDecodeErrorZ;
3994
3995
3996
3997 /**
3998  * Parameters needed to find a [`Route`].
3999  *
4000  * Passed to [`find_route`] and [`build_route_from_hops`].
4001  */
4002 typedef struct MUST_USE_STRUCT LDKRouteParameters {
4003    /**
4004     * A pointer to the opaque Rust object.
4005     * Nearly everywhere, inner must be non-null, however in places where
4006     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4007     */
4008    LDKnativeRouteParameters *inner;
4009    /**
4010     * Indicates that this is the only struct which contains the same pointer.
4011     * Rust functions which take ownership of an object provided via an argument require
4012     * this to be true and invalidate the object pointed to by inner.
4013     */
4014    bool is_owned;
4015 } LDKRouteParameters;
4016
4017 /**
4018  * The contents of CResult_RouteParametersDecodeErrorZ
4019  */
4020 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
4021    /**
4022     * A pointer to the contents in the success state.
4023     * Reading from this pointer when `result_ok` is not set is undefined.
4024     */
4025    struct LDKRouteParameters *result;
4026    /**
4027     * A pointer to the contents in the error state.
4028     * Reading from this pointer when `result_ok` is set is undefined.
4029     */
4030    struct LDKDecodeError *err;
4031 } LDKCResult_RouteParametersDecodeErrorZPtr;
4032
4033 /**
4034  * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
4035  * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4036  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4037  */
4038 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
4039    /**
4040     * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
4041     * `err` or `result` depending on the state of `result_ok`.
4042     */
4043    union LDKCResult_RouteParametersDecodeErrorZPtr contents;
4044    /**
4045     * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
4046     */
4047    bool result_ok;
4048 } LDKCResult_RouteParametersDecodeErrorZ;
4049
4050 /**
4051  * A dynamically-allocated array of u64s of arbitrary size.
4052  * This corresponds to std::vector in C++
4053  */
4054 typedef struct LDKCVec_u64Z {
4055    /**
4056     * The elements in the array.
4057     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4058     */
4059    uint64_t *data;
4060    /**
4061     * The number of elements pointed to by `data`.
4062     */
4063    uintptr_t datalen;
4064 } LDKCVec_u64Z;
4065
4066
4067
4068 /**
4069  * Information used to route a payment.
4070  */
4071 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
4072    /**
4073     * A pointer to the opaque Rust object.
4074     * Nearly everywhere, inner must be non-null, however in places where
4075     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4076     */
4077    LDKnativePaymentParameters *inner;
4078    /**
4079     * Indicates that this is the only struct which contains the same pointer.
4080     * Rust functions which take ownership of an object provided via an argument require
4081     * this to be true and invalidate the object pointed to by inner.
4082     */
4083    bool is_owned;
4084 } LDKPaymentParameters;
4085
4086 /**
4087  * The contents of CResult_PaymentParametersDecodeErrorZ
4088  */
4089 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
4090    /**
4091     * A pointer to the contents in the success state.
4092     * Reading from this pointer when `result_ok` is not set is undefined.
4093     */
4094    struct LDKPaymentParameters *result;
4095    /**
4096     * A pointer to the contents in the error state.
4097     * Reading from this pointer when `result_ok` is set is undefined.
4098     */
4099    struct LDKDecodeError *err;
4100 } LDKCResult_PaymentParametersDecodeErrorZPtr;
4101
4102 /**
4103  * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
4104  * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4105  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4106  */
4107 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
4108    /**
4109     * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
4110     * `err` or `result` depending on the state of `result_ok`.
4111     */
4112    union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
4113    /**
4114     * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
4115     */
4116    bool result_ok;
4117 } LDKCResult_PaymentParametersDecodeErrorZ;
4118
4119 /**
4120  * A tuple of 2 elements. See the individual fields for the types contained.
4121  */
4122 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
4123    /**
4124     * The element at position 0
4125     */
4126    struct LDKBlindedPayInfo a;
4127    /**
4128     * The element at position 1
4129     */
4130    struct LDKBlindedPath b;
4131 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
4132
4133 /**
4134  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
4135  * This corresponds to std::vector in C++
4136  */
4137 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
4138    /**
4139     * The elements in the array.
4140     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4141     */
4142    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
4143    /**
4144     * The number of elements pointed to by `data`.
4145     */
4146    uintptr_t datalen;
4147 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
4148
4149
4150
4151 /**
4152  * A list of hops along a payment path terminating with a channel to the recipient.
4153  */
4154 typedef struct MUST_USE_STRUCT LDKRouteHint {
4155    /**
4156     * A pointer to the opaque Rust object.
4157     * Nearly everywhere, inner must be non-null, however in places where
4158     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4159     */
4160    LDKnativeRouteHint *inner;
4161    /**
4162     * Indicates that this is the only struct which contains the same pointer.
4163     * Rust functions which take ownership of an object provided via an argument require
4164     * this to be true and invalidate the object pointed to by inner.
4165     */
4166    bool is_owned;
4167 } LDKRouteHint;
4168
4169 /**
4170  * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
4171  * This corresponds to std::vector in C++
4172  */
4173 typedef struct LDKCVec_RouteHintZ {
4174    /**
4175     * The elements in the array.
4176     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4177     */
4178    struct LDKRouteHint *data;
4179    /**
4180     * The number of elements pointed to by `data`.
4181     */
4182    uintptr_t datalen;
4183 } LDKCVec_RouteHintZ;
4184
4185
4186
4187 /**
4188  * A channel descriptor for a hop along a payment path.
4189  */
4190 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
4191    /**
4192     * A pointer to the opaque Rust object.
4193     * Nearly everywhere, inner must be non-null, however in places where
4194     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4195     */
4196    LDKnativeRouteHintHop *inner;
4197    /**
4198     * Indicates that this is the only struct which contains the same pointer.
4199     * Rust functions which take ownership of an object provided via an argument require
4200     * this to be true and invalidate the object pointed to by inner.
4201     */
4202    bool is_owned;
4203 } LDKRouteHintHop;
4204
4205 /**
4206  * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
4207  * This corresponds to std::vector in C++
4208  */
4209 typedef struct LDKCVec_RouteHintHopZ {
4210    /**
4211     * The elements in the array.
4212     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4213     */
4214    struct LDKRouteHintHop *data;
4215    /**
4216     * The number of elements pointed to by `data`.
4217     */
4218    uintptr_t datalen;
4219 } LDKCVec_RouteHintHopZ;
4220
4221 /**
4222  * The contents of CResult_RouteHintDecodeErrorZ
4223  */
4224 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
4225    /**
4226     * A pointer to the contents in the success state.
4227     * Reading from this pointer when `result_ok` is not set is undefined.
4228     */
4229    struct LDKRouteHint *result;
4230    /**
4231     * A pointer to the contents in the error state.
4232     * Reading from this pointer when `result_ok` is set is undefined.
4233     */
4234    struct LDKDecodeError *err;
4235 } LDKCResult_RouteHintDecodeErrorZPtr;
4236
4237 /**
4238  * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
4239  * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4240  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4241  */
4242 typedef struct LDKCResult_RouteHintDecodeErrorZ {
4243    /**
4244     * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
4245     * `err` or `result` depending on the state of `result_ok`.
4246     */
4247    union LDKCResult_RouteHintDecodeErrorZPtr contents;
4248    /**
4249     * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
4250     */
4251    bool result_ok;
4252 } LDKCResult_RouteHintDecodeErrorZ;
4253
4254 /**
4255  * The contents of CResult_RouteHintHopDecodeErrorZ
4256  */
4257 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
4258    /**
4259     * A pointer to the contents in the success state.
4260     * Reading from this pointer when `result_ok` is not set is undefined.
4261     */
4262    struct LDKRouteHintHop *result;
4263    /**
4264     * A pointer to the contents in the error state.
4265     * Reading from this pointer when `result_ok` is set is undefined.
4266     */
4267    struct LDKDecodeError *err;
4268 } LDKCResult_RouteHintHopDecodeErrorZPtr;
4269
4270 /**
4271  * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
4272  * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4273  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4274  */
4275 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
4276    /**
4277     * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
4278     * `err` or `result` depending on the state of `result_ok`.
4279     */
4280    union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
4281    /**
4282     * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
4283     */
4284    bool result_ok;
4285 } LDKCResult_RouteHintHopDecodeErrorZ;
4286
4287 /**
4288  * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4289  * This corresponds to std::vector in C++
4290  */
4291 typedef struct LDKCVec_PublicKeyZ {
4292    /**
4293     * The elements in the array.
4294     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4295     */
4296    struct LDKPublicKey *data;
4297    /**
4298     * The number of elements pointed to by `data`.
4299     */
4300    uintptr_t datalen;
4301 } LDKCVec_PublicKeyZ;
4302
4303
4304
4305 /**
4306  * [`ScoreLookUp`] implementation that uses a fixed penalty.
4307  */
4308 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4309    /**
4310     * A pointer to the opaque Rust object.
4311     * Nearly everywhere, inner must be non-null, however in places where
4312     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4313     */
4314    LDKnativeFixedPenaltyScorer *inner;
4315    /**
4316     * Indicates that this is the only struct which contains the same pointer.
4317     * Rust functions which take ownership of an object provided via an argument require
4318     * this to be true and invalidate the object pointed to by inner.
4319     */
4320    bool is_owned;
4321 } LDKFixedPenaltyScorer;
4322
4323 /**
4324  * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4325  */
4326 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4327    /**
4328     * A pointer to the contents in the success state.
4329     * Reading from this pointer when `result_ok` is not set is undefined.
4330     */
4331    struct LDKFixedPenaltyScorer *result;
4332    /**
4333     * A pointer to the contents in the error state.
4334     * Reading from this pointer when `result_ok` is set is undefined.
4335     */
4336    struct LDKDecodeError *err;
4337 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4338
4339 /**
4340  * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4341  * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4342  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4343  */
4344 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4345    /**
4346     * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4347     * `err` or `result` depending on the state of `result_ok`.
4348     */
4349    union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4350    /**
4351     * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4352     */
4353    bool result_ok;
4354 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4355
4356 /**
4357  * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4358  * This corresponds to std::vector in C++
4359  */
4360 typedef struct LDKCVec_NodeIdZ {
4361    /**
4362     * The elements in the array.
4363     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4364     */
4365    struct LDKNodeId *data;
4366    /**
4367     * The number of elements pointed to by `data`.
4368     */
4369    uintptr_t datalen;
4370 } LDKCVec_NodeIdZ;
4371
4372 /**
4373  * A tuple of 2 elements. See the individual fields for the types contained.
4374  */
4375 typedef struct LDKC2Tuple_u64u64Z {
4376    /**
4377     * The element at position 0
4378     */
4379    uint64_t a;
4380    /**
4381     * The element at position 1
4382     */
4383    uint64_t b;
4384 } LDKC2Tuple_u64u64Z;
4385
4386 /**
4387  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4388  */
4389 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4390    /**
4391     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4392     */
4393    LDKCOption_C2Tuple_u64u64ZZ_Some,
4394    /**
4395     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4396     */
4397    LDKCOption_C2Tuple_u64u64ZZ_None,
4398    /**
4399     * Must be last for serialization purposes
4400     */
4401    LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4402 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4403
4404 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4405    LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4406    union {
4407       struct {
4408          struct LDKC2Tuple_u64u64Z some;
4409       };
4410    };
4411 } LDKCOption_C2Tuple_u64u64ZZ;
4412
4413 /**
4414  * 32 u16s
4415  */
4416 typedef struct LDKThirtyTwoU16s {
4417    /**
4418     * The thirty-two 16-bit integers
4419     */
4420    uint16_t data[32];
4421 } LDKThirtyTwoU16s;
4422
4423 /**
4424  * A tuple of 2 elements. See the individual fields for the types contained.
4425  */
4426 typedef struct LDKC2Tuple_Z {
4427    /**
4428     * The element at position 0
4429     */
4430    struct LDKThirtyTwoU16s a;
4431    /**
4432     * The element at position 1
4433     */
4434    struct LDKThirtyTwoU16s b;
4435 } LDKC2Tuple_Z;
4436
4437 /**
4438  * A tuple of 2 elements. See the individual fields for the types contained.
4439  */
4440 typedef struct LDKC2Tuple__u1632_u1632Z {
4441    /**
4442     * The element at position 0
4443     */
4444    struct LDKThirtyTwoU16s a;
4445    /**
4446     * The element at position 1
4447     */
4448    struct LDKThirtyTwoU16s b;
4449 } LDKC2Tuple__u1632_u1632Z;
4450
4451 /**
4452  * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
4453  */
4454 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
4455    /**
4456     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
4457     */
4458    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
4459    /**
4460     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
4461     */
4462    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
4463    /**
4464     * Must be last for serialization purposes
4465     */
4466    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
4467 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
4468
4469 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
4470    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
4471    union {
4472       struct {
4473          struct LDKC2Tuple__u1632_u1632Z some;
4474       };
4475    };
4476 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
4477
4478 /**
4479  * An enum which can either contain a f64 or not
4480  */
4481 typedef enum LDKCOption_f64Z_Tag {
4482    /**
4483     * When we're in this state, this COption_f64Z contains a f64
4484     */
4485    LDKCOption_f64Z_Some,
4486    /**
4487     * When we're in this state, this COption_f64Z contains nothing
4488     */
4489    LDKCOption_f64Z_None,
4490    /**
4491     * Must be last for serialization purposes
4492     */
4493    LDKCOption_f64Z_Sentinel,
4494 } LDKCOption_f64Z_Tag;
4495
4496 typedef struct LDKCOption_f64Z {
4497    LDKCOption_f64Z_Tag tag;
4498    union {
4499       struct {
4500          double some;
4501       };
4502    };
4503 } LDKCOption_f64Z;
4504
4505
4506
4507 /**
4508  * A Record, unit of logging output with Metadata to enable filtering
4509  * Module_path, file, line to inform on log's source
4510  */
4511 typedef struct MUST_USE_STRUCT LDKRecord {
4512    /**
4513     * A pointer to the opaque Rust object.
4514     * Nearly everywhere, inner must be non-null, however in places where
4515     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4516     */
4517    LDKnativeRecord *inner;
4518    /**
4519     * Indicates that this is the only struct which contains the same pointer.
4520     * Rust functions which take ownership of an object provided via an argument require
4521     * this to be true and invalidate the object pointed to by inner.
4522     */
4523    bool is_owned;
4524 } LDKRecord;
4525
4526 /**
4527  * A trait encapsulating the operations required of a logger
4528  */
4529 typedef struct LDKLogger {
4530    /**
4531     * An opaque pointer which is passed to your function implementations as an argument.
4532     * This has no meaning in the LDK, and can be NULL or any other value.
4533     */
4534    void *this_arg;
4535    /**
4536     * Logs the `Record`
4537     */
4538    void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4539    /**
4540     * Frees any resources associated with this object given its this_arg pointer.
4541     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4542     */
4543    void (*free)(void *this_arg);
4544 } LDKLogger;
4545
4546
4547
4548 /**
4549  * Represents the network as nodes and channels between them
4550  */
4551 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4552    /**
4553     * A pointer to the opaque Rust object.
4554     * Nearly everywhere, inner must be non-null, however in places where
4555     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4556     */
4557    LDKnativeNetworkGraph *inner;
4558    /**
4559     * Indicates that this is the only struct which contains the same pointer.
4560     * Rust functions which take ownership of an object provided via an argument require
4561     * this to be true and invalidate the object pointed to by inner.
4562     */
4563    bool is_owned;
4564 } LDKNetworkGraph;
4565
4566
4567
4568 /**
4569  * [`ScoreLookUp`] implementation using channel success probability distributions.
4570  *
4571  * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
4572  * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
4573  * When a payment is forwarded through a channel (but fails later in the route), we learn the
4574  * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
4575  *
4576  * These bounds are then used to determine a success probability using the formula from
4577  * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4578  * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
4579  *6762, 1070
4580  * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
4581  * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
4582  * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
4583  * terms of the entire path's success probability. This allows the router to directly compare
4584  * penalties for different paths. See the documentation of those parameters for the exact formulas.
4585  *
4586  * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
4587  *
4588  * Further, we track the history of our upper and lower liquidity bounds for each channel,
4589  * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
4590  * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
4591  * formula, but using the history of a channel rather than our latest estimates for the liquidity
4592  * bounds.
4593  *
4594  * # Note
4595  *
4596  * Mixing the `no-std` feature between serialization and deserialization results in undefined
4597  * behavior.
4598  *
4599  * [1]: https://arxiv.org/abs/2107.05322
4600  * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
4601  * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
4602  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
4603  * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
4604  * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
4605  */
4606 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4607    /**
4608     * A pointer to the opaque Rust object.
4609     * Nearly everywhere, inner must be non-null, however in places where
4610     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4611     */
4612    LDKnativeProbabilisticScorer *inner;
4613    /**
4614     * Indicates that this is the only struct which contains the same pointer.
4615     * Rust functions which take ownership of an object provided via an argument require
4616     * this to be true and invalidate the object pointed to by inner.
4617     */
4618    bool is_owned;
4619 } LDKProbabilisticScorer;
4620
4621 /**
4622  * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4623  */
4624 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4625    /**
4626     * A pointer to the contents in the success state.
4627     * Reading from this pointer when `result_ok` is not set is undefined.
4628     */
4629    struct LDKProbabilisticScorer *result;
4630    /**
4631     * A pointer to the contents in the error state.
4632     * Reading from this pointer when `result_ok` is set is undefined.
4633     */
4634    struct LDKDecodeError *err;
4635 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4636
4637 /**
4638  * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4639  * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4640  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4641  */
4642 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4643    /**
4644     * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4645     * `err` or `result` depending on the state of `result_ok`.
4646     */
4647    union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4648    /**
4649     * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4650     */
4651    bool result_ok;
4652 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4653
4654 /**
4655  * A tuple of 2 elements. See the individual fields for the types contained.
4656  */
4657 typedef struct LDKC2Tuple_usizeTransactionZ {
4658    /**
4659     * The element at position 0
4660     */
4661    uintptr_t a;
4662    /**
4663     * The element at position 1
4664     */
4665    struct LDKTransaction b;
4666 } LDKC2Tuple_usizeTransactionZ;
4667
4668 /**
4669  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4670  * This corresponds to std::vector in C++
4671  */
4672 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4673    /**
4674     * The elements in the array.
4675     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4676     */
4677    struct LDKC2Tuple_usizeTransactionZ *data;
4678    /**
4679     * The number of elements pointed to by `data`.
4680     */
4681    uintptr_t datalen;
4682 } LDKCVec_C2Tuple_usizeTransactionZZ;
4683
4684 /**
4685  * A tuple of 2 elements. See the individual fields for the types contained.
4686  */
4687 typedef struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ {
4688    /**
4689     * The element at position 0
4690     */
4691    struct LDKThirtyTwoBytes a;
4692    /**
4693     * The element at position 1
4694     */
4695    struct LDKCOption_ThirtyTwoBytesZ b;
4696 } LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ;
4697
4698 /**
4699  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZs of arbitrary size.
4700  * This corresponds to std::vector in C++
4701  */
4702 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ {
4703    /**
4704     * The elements in the array.
4705     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4706     */
4707    struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *data;
4708    /**
4709     * The number of elements pointed to by `data`.
4710     */
4711    uintptr_t datalen;
4712 } LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ;
4713
4714 /**
4715  * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
4716  */
4717 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
4718    /**
4719     * A pointer to the contents in the success state.
4720     * Reading from this pointer when `result_ok` is not set is undefined.
4721     */
4722    enum LDKChannelMonitorUpdateStatus *result;
4723    /**
4724     * Note that this value is always NULL, as there are no contents in the Err variant
4725     */
4726    void *err;
4727 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
4728
4729 /**
4730  * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
4731  * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
4732  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4733  */
4734 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
4735    /**
4736     * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
4737     * `err` or `result` depending on the state of `result_ok`.
4738     */
4739    union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
4740    /**
4741     * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
4742     */
4743    bool result_ok;
4744 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
4745
4746
4747
4748 /**
4749  * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4750  * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4751  * preimage claim backward will lead to loss of funds.
4752  */
4753 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4754    /**
4755     * A pointer to the opaque Rust object.
4756     * Nearly everywhere, inner must be non-null, however in places where
4757     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4758     */
4759    LDKnativeHTLCUpdate *inner;
4760    /**
4761     * Indicates that this is the only struct which contains the same pointer.
4762     * Rust functions which take ownership of an object provided via an argument require
4763     * this to be true and invalidate the object pointed to by inner.
4764     */
4765    bool is_owned;
4766 } LDKHTLCUpdate;
4767
4768 /**
4769  * An event to be processed by the ChannelManager.
4770  */
4771 typedef enum LDKMonitorEvent_Tag {
4772    /**
4773     * A monitor event containing an HTLCUpdate.
4774     */
4775    LDKMonitorEvent_HTLCEvent,
4776    /**
4777     * A monitor event that the Channel's commitment transaction was confirmed.
4778     */
4779    LDKMonitorEvent_HolderForceClosed,
4780    /**
4781     * Indicates a [`ChannelMonitor`] update has completed. See
4782     * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
4783     *
4784     * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
4785     */
4786    LDKMonitorEvent_Completed,
4787    /**
4788     * Must be last for serialization purposes
4789     */
4790    LDKMonitorEvent_Sentinel,
4791 } LDKMonitorEvent_Tag;
4792
4793 typedef struct LDKMonitorEvent_LDKCompleted_Body {
4794    /**
4795     * The funding outpoint of the [`ChannelMonitor`] that was updated
4796     */
4797    struct LDKOutPoint funding_txo;
4798    /**
4799     * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4800     * [`ChannelMonitor::get_latest_update_id`].
4801     *
4802     * Note that this should only be set to a given update's ID if all previous updates for the
4803     * same [`ChannelMonitor`] have been applied and persisted.
4804     */
4805    uint64_t monitor_update_id;
4806 } LDKMonitorEvent_LDKCompleted_Body;
4807
4808 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4809    LDKMonitorEvent_Tag tag;
4810    union {
4811       struct {
4812          struct LDKHTLCUpdate htlc_event;
4813       };
4814       struct {
4815          struct LDKOutPoint holder_force_closed;
4816       };
4817       LDKMonitorEvent_LDKCompleted_Body completed;
4818    };
4819 } LDKMonitorEvent;
4820
4821 /**
4822  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4823  * This corresponds to std::vector in C++
4824  */
4825 typedef struct LDKCVec_MonitorEventZ {
4826    /**
4827     * The elements in the array.
4828     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4829     */
4830    struct LDKMonitorEvent *data;
4831    /**
4832     * The number of elements pointed to by `data`.
4833     */
4834    uintptr_t datalen;
4835 } LDKCVec_MonitorEventZ;
4836
4837 /**
4838  * A tuple of 3 elements. See the individual fields for the types contained.
4839  */
4840 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4841    /**
4842     * The element at position 0
4843     */
4844    struct LDKOutPoint a;
4845    /**
4846     * The element at position 1
4847     */
4848    struct LDKCVec_MonitorEventZ b;
4849    /**
4850     * The element at position 2
4851     */
4852    struct LDKPublicKey c;
4853 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4854
4855 /**
4856  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4857  * This corresponds to std::vector in C++
4858  */
4859 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4860    /**
4861     * The elements in the array.
4862     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4863     */
4864    struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4865    /**
4866     * The number of elements pointed to by `data`.
4867     */
4868    uintptr_t datalen;
4869 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4870
4871
4872
4873 /**
4874  * Features used within an `init` message.
4875  */
4876 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4877    /**
4878     * A pointer to the opaque Rust object.
4879     * Nearly everywhere, inner must be non-null, however in places where
4880     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4881     */
4882    LDKnativeInitFeatures *inner;
4883    /**
4884     * Indicates that this is the only struct which contains the same pointer.
4885     * Rust functions which take ownership of an object provided via an argument require
4886     * this to be true and invalidate the object pointed to by inner.
4887     */
4888    bool is_owned;
4889 } LDKInitFeatures;
4890
4891 /**
4892  * The contents of CResult_InitFeaturesDecodeErrorZ
4893  */
4894 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4895    /**
4896     * A pointer to the contents in the success state.
4897     * Reading from this pointer when `result_ok` is not set is undefined.
4898     */
4899    struct LDKInitFeatures *result;
4900    /**
4901     * A pointer to the contents in the error state.
4902     * Reading from this pointer when `result_ok` is set is undefined.
4903     */
4904    struct LDKDecodeError *err;
4905 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4906
4907 /**
4908  * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4909  * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4910  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4911  */
4912 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4913    /**
4914     * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4915     * `err` or `result` depending on the state of `result_ok`.
4916     */
4917    union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4918    /**
4919     * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4920     */
4921    bool result_ok;
4922 } LDKCResult_InitFeaturesDecodeErrorZ;
4923
4924
4925
4926 /**
4927  * Features used within a `channel_announcement` message.
4928  */
4929 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4930    /**
4931     * A pointer to the opaque Rust object.
4932     * Nearly everywhere, inner must be non-null, however in places where
4933     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4934     */
4935    LDKnativeChannelFeatures *inner;
4936    /**
4937     * Indicates that this is the only struct which contains the same pointer.
4938     * Rust functions which take ownership of an object provided via an argument require
4939     * this to be true and invalidate the object pointed to by inner.
4940     */
4941    bool is_owned;
4942 } LDKChannelFeatures;
4943
4944 /**
4945  * The contents of CResult_ChannelFeaturesDecodeErrorZ
4946  */
4947 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4948    /**
4949     * A pointer to the contents in the success state.
4950     * Reading from this pointer when `result_ok` is not set is undefined.
4951     */
4952    struct LDKChannelFeatures *result;
4953    /**
4954     * A pointer to the contents in the error state.
4955     * Reading from this pointer when `result_ok` is set is undefined.
4956     */
4957    struct LDKDecodeError *err;
4958 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4959
4960 /**
4961  * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4962  * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4963  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4964  */
4965 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4966    /**
4967     * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4968     * `err` or `result` depending on the state of `result_ok`.
4969     */
4970    union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4971    /**
4972     * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4973     */
4974    bool result_ok;
4975 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4976
4977
4978
4979 /**
4980  * Features used within a `node_announcement` message.
4981  */
4982 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4983    /**
4984     * A pointer to the opaque Rust object.
4985     * Nearly everywhere, inner must be non-null, however in places where
4986     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4987     */
4988    LDKnativeNodeFeatures *inner;
4989    /**
4990     * Indicates that this is the only struct which contains the same pointer.
4991     * Rust functions which take ownership of an object provided via an argument require
4992     * this to be true and invalidate the object pointed to by inner.
4993     */
4994    bool is_owned;
4995 } LDKNodeFeatures;
4996
4997 /**
4998  * The contents of CResult_NodeFeaturesDecodeErrorZ
4999  */
5000 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5001    /**
5002     * A pointer to the contents in the success state.
5003     * Reading from this pointer when `result_ok` is not set is undefined.
5004     */
5005    struct LDKNodeFeatures *result;
5006    /**
5007     * A pointer to the contents in the error state.
5008     * Reading from this pointer when `result_ok` is set is undefined.
5009     */
5010    struct LDKDecodeError *err;
5011 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5012
5013 /**
5014  * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5015  * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5016  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5017  */
5018 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5019    /**
5020     * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5021     * `err` or `result` depending on the state of `result_ok`.
5022     */
5023    union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5024    /**
5025     * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5026     */
5027    bool result_ok;
5028 } LDKCResult_NodeFeaturesDecodeErrorZ;
5029
5030
5031
5032 /**
5033  * Features used within an invoice.
5034  */
5035 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
5036    /**
5037     * A pointer to the opaque Rust object.
5038     * Nearly everywhere, inner must be non-null, however in places where
5039     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5040     */
5041    LDKnativeBolt11InvoiceFeatures *inner;
5042    /**
5043     * Indicates that this is the only struct which contains the same pointer.
5044     * Rust functions which take ownership of an object provided via an argument require
5045     * this to be true and invalidate the object pointed to by inner.
5046     */
5047    bool is_owned;
5048 } LDKBolt11InvoiceFeatures;
5049
5050 /**
5051  * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
5052  */
5053 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
5054    /**
5055     * A pointer to the contents in the success state.
5056     * Reading from this pointer when `result_ok` is not set is undefined.
5057     */
5058    struct LDKBolt11InvoiceFeatures *result;
5059    /**
5060     * A pointer to the contents in the error state.
5061     * Reading from this pointer when `result_ok` is set is undefined.
5062     */
5063    struct LDKDecodeError *err;
5064 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
5065
5066 /**
5067  * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5068  * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5069  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5070  */
5071 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
5072    /**
5073     * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
5074     * `err` or `result` depending on the state of `result_ok`.
5075     */
5076    union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
5077    /**
5078     * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
5079     */
5080    bool result_ok;
5081 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
5082
5083
5084
5085 /**
5086  * Features used within an `invoice`.
5087  */
5088 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
5089    /**
5090     * A pointer to the opaque Rust object.
5091     * Nearly everywhere, inner must be non-null, however in places where
5092     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5093     */
5094    LDKnativeBolt12InvoiceFeatures *inner;
5095    /**
5096     * Indicates that this is the only struct which contains the same pointer.
5097     * Rust functions which take ownership of an object provided via an argument require
5098     * this to be true and invalidate the object pointed to by inner.
5099     */
5100    bool is_owned;
5101 } LDKBolt12InvoiceFeatures;
5102
5103 /**
5104  * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
5105  */
5106 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
5107    /**
5108     * A pointer to the contents in the success state.
5109     * Reading from this pointer when `result_ok` is not set is undefined.
5110     */
5111    struct LDKBolt12InvoiceFeatures *result;
5112    /**
5113     * A pointer to the contents in the error state.
5114     * Reading from this pointer when `result_ok` is set is undefined.
5115     */
5116    struct LDKDecodeError *err;
5117 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
5118
5119 /**
5120  * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5121  * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5122  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5123  */
5124 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
5125    /**
5126     * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
5127     * `err` or `result` depending on the state of `result_ok`.
5128     */
5129    union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
5130    /**
5131     * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
5132     */
5133    bool result_ok;
5134 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
5135
5136
5137
5138 /**
5139  * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
5140  */
5141 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
5142    /**
5143     * A pointer to the opaque Rust object.
5144     * Nearly everywhere, inner must be non-null, however in places where
5145     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5146     */
5147    LDKnativeBlindedHopFeatures *inner;
5148    /**
5149     * Indicates that this is the only struct which contains the same pointer.
5150     * Rust functions which take ownership of an object provided via an argument require
5151     * this to be true and invalidate the object pointed to by inner.
5152     */
5153    bool is_owned;
5154 } LDKBlindedHopFeatures;
5155
5156 /**
5157  * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
5158  */
5159 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
5160    /**
5161     * A pointer to the contents in the success state.
5162     * Reading from this pointer when `result_ok` is not set is undefined.
5163     */
5164    struct LDKBlindedHopFeatures *result;
5165    /**
5166     * A pointer to the contents in the error state.
5167     * Reading from this pointer when `result_ok` is set is undefined.
5168     */
5169    struct LDKDecodeError *err;
5170 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
5171
5172 /**
5173  * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
5174  * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5175  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5176  */
5177 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
5178    /**
5179     * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
5180     * `err` or `result` depending on the state of `result_ok`.
5181     */
5182    union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
5183    /**
5184     * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
5185     */
5186    bool result_ok;
5187 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
5188
5189
5190
5191 /**
5192  * Features used within the channel_type field in an OpenChannel message.
5193  *
5194  * A channel is always of some known \"type\", describing the transaction formats used and the exact
5195  * semantics of our interaction with our peer.
5196  *
5197  * Note that because a channel is a specific type which is proposed by the opener and accepted by
5198  * the counterparty, only required features are allowed here.
5199  *
5200  * This is serialized differently from other feature types - it is not prefixed by a length, and
5201  * thus must only appear inside a TLV where its length is known in advance.
5202  */
5203 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
5204    /**
5205     * A pointer to the opaque Rust object.
5206     * Nearly everywhere, inner must be non-null, however in places where
5207     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5208     */
5209    LDKnativeChannelTypeFeatures *inner;
5210    /**
5211     * Indicates that this is the only struct which contains the same pointer.
5212     * Rust functions which take ownership of an object provided via an argument require
5213     * this to be true and invalidate the object pointed to by inner.
5214     */
5215    bool is_owned;
5216 } LDKChannelTypeFeatures;
5217
5218 /**
5219  * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5220  */
5221 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5222    /**
5223     * A pointer to the contents in the success state.
5224     * Reading from this pointer when `result_ok` is not set is undefined.
5225     */
5226    struct LDKChannelTypeFeatures *result;
5227    /**
5228     * A pointer to the contents in the error state.
5229     * Reading from this pointer when `result_ok` is set is undefined.
5230     */
5231    struct LDKDecodeError *err;
5232 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5233
5234 /**
5235  * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5236  * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5237  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5238  */
5239 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5240    /**
5241     * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5242     * `err` or `result` depending on the state of `result_ok`.
5243     */
5244    union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5245    /**
5246     * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5247     */
5248    bool result_ok;
5249 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5250
5251
5252
5253 /**
5254  * An `Offer` is a potentially long-lived proposal for payment of a good or service.
5255  *
5256  * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
5257  * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
5258  * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
5259  *
5260  * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
5261  * latter.
5262  *
5263  * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
5264  *
5265  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
5266  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
5267  */
5268 typedef struct MUST_USE_STRUCT LDKOffer {
5269    /**
5270     * A pointer to the opaque Rust object.
5271     * Nearly everywhere, inner must be non-null, however in places where
5272     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5273     */
5274    LDKnativeOffer *inner;
5275    /**
5276     * Indicates that this is the only struct which contains the same pointer.
5277     * Rust functions which take ownership of an object provided via an argument require
5278     * this to be true and invalidate the object pointed to by inner.
5279     */
5280    bool is_owned;
5281 } LDKOffer;
5282
5283 /**
5284  * The contents of CResult_OfferBolt12ParseErrorZ
5285  */
5286 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
5287    /**
5288     * A pointer to the contents in the success state.
5289     * Reading from this pointer when `result_ok` is not set is undefined.
5290     */
5291    struct LDKOffer *result;
5292    /**
5293     * A pointer to the contents in the error state.
5294     * Reading from this pointer when `result_ok` is set is undefined.
5295     */
5296    struct LDKBolt12ParseError *err;
5297 } LDKCResult_OfferBolt12ParseErrorZPtr;
5298
5299 /**
5300  * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
5301  * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
5302  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5303  */
5304 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
5305    /**
5306     * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
5307     * `err` or `result` depending on the state of `result_ok`.
5308     */
5309    union LDKCResult_OfferBolt12ParseErrorZPtr contents;
5310    /**
5311     * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
5312     */
5313    bool result_ok;
5314 } LDKCResult_OfferBolt12ParseErrorZ;
5315
5316 /**
5317  * The contents of CResult_PublicKeySecp256k1ErrorZ
5318  */
5319 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
5320    /**
5321     * A pointer to the contents in the success state.
5322     * Reading from this pointer when `result_ok` is not set is undefined.
5323     */
5324    struct LDKPublicKey *result;
5325    /**
5326     * A pointer to the contents in the error state.
5327     * Reading from this pointer when `result_ok` is set is undefined.
5328     */
5329    enum LDKSecp256k1Error *err;
5330 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
5331
5332 /**
5333  * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
5334  * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
5335  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5336  */
5337 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
5338    /**
5339     * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
5340     * `err` or `result` depending on the state of `result_ok`.
5341     */
5342    union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
5343    /**
5344     * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
5345     */
5346    bool result_ok;
5347 } LDKCResult_PublicKeySecp256k1ErrorZ;
5348
5349 /**
5350  * The contents of CResult_NodeIdDecodeErrorZ
5351  */
5352 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5353    /**
5354     * A pointer to the contents in the success state.
5355     * Reading from this pointer when `result_ok` is not set is undefined.
5356     */
5357    struct LDKNodeId *result;
5358    /**
5359     * A pointer to the contents in the error state.
5360     * Reading from this pointer when `result_ok` is set is undefined.
5361     */
5362    struct LDKDecodeError *err;
5363 } LDKCResult_NodeIdDecodeErrorZPtr;
5364
5365 /**
5366  * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5367  * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5368  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5369  */
5370 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5371    /**
5372     * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5373     * `err` or `result` depending on the state of `result_ok`.
5374     */
5375    union LDKCResult_NodeIdDecodeErrorZPtr contents;
5376    /**
5377     * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5378     */
5379    bool result_ok;
5380 } LDKCResult_NodeIdDecodeErrorZ;
5381
5382
5383
5384 /**
5385  * A [`channel_update`] message to be sent to or received from a peer.
5386  *
5387  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
5388  */
5389 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
5390    /**
5391     * A pointer to the opaque Rust object.
5392     * Nearly everywhere, inner must be non-null, however in places where
5393     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5394     */
5395    LDKnativeChannelUpdate *inner;
5396    /**
5397     * Indicates that this is the only struct which contains the same pointer.
5398     * Rust functions which take ownership of an object provided via an argument require
5399     * this to be true and invalidate the object pointed to by inner.
5400     */
5401    bool is_owned;
5402 } LDKChannelUpdate;
5403
5404 /**
5405  * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
5406  * return packet by a node along the route. See [BOLT #4] for details.
5407  *
5408  * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
5409  */
5410 typedef enum LDKNetworkUpdate_Tag {
5411    /**
5412     * An error indicating a `channel_update` messages should be applied via
5413     * [`NetworkGraph::update_channel`].
5414     */
5415    LDKNetworkUpdate_ChannelUpdateMessage,
5416    /**
5417     * An error indicating that a channel failed to route a payment, which should be applied via
5418     * [`NetworkGraph::channel_failed_permanent`] if permanent.
5419     */
5420    LDKNetworkUpdate_ChannelFailure,
5421    /**
5422     * An error indicating that a node failed to route a payment, which should be applied via
5423     * [`NetworkGraph::node_failed_permanent`] if permanent.
5424     */
5425    LDKNetworkUpdate_NodeFailure,
5426    /**
5427     * Must be last for serialization purposes
5428     */
5429    LDKNetworkUpdate_Sentinel,
5430 } LDKNetworkUpdate_Tag;
5431
5432 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
5433    /**
5434     * The update to apply via [`NetworkGraph::update_channel`].
5435     */
5436    struct LDKChannelUpdate msg;
5437 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
5438
5439 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
5440    /**
5441     * The short channel id of the closed channel.
5442     */
5443    uint64_t short_channel_id;
5444    /**
5445     * Whether the channel should be permanently removed or temporarily disabled until a new
5446     * `channel_update` message is received.
5447     */
5448    bool is_permanent;
5449 } LDKNetworkUpdate_LDKChannelFailure_Body;
5450
5451 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
5452    /**
5453     * The node id of the failed node.
5454     */
5455    struct LDKPublicKey node_id;
5456    /**
5457     * Whether the node should be permanently removed from consideration or can be restored
5458     * when a new `channel_update` message is received.
5459     */
5460    bool is_permanent;
5461 } LDKNetworkUpdate_LDKNodeFailure_Body;
5462
5463 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
5464    LDKNetworkUpdate_Tag tag;
5465    union {
5466       LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
5467       LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
5468       LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
5469    };
5470 } LDKNetworkUpdate;
5471
5472 /**
5473  * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
5474  */
5475 typedef enum LDKCOption_NetworkUpdateZ_Tag {
5476    /**
5477     * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
5478     */
5479    LDKCOption_NetworkUpdateZ_Some,
5480    /**
5481     * When we're in this state, this COption_NetworkUpdateZ contains nothing
5482     */
5483    LDKCOption_NetworkUpdateZ_None,
5484    /**
5485     * Must be last for serialization purposes
5486     */
5487    LDKCOption_NetworkUpdateZ_Sentinel,
5488 } LDKCOption_NetworkUpdateZ_Tag;
5489
5490 typedef struct LDKCOption_NetworkUpdateZ {
5491    LDKCOption_NetworkUpdateZ_Tag tag;
5492    union {
5493       struct {
5494          struct LDKNetworkUpdate some;
5495       };
5496    };
5497 } LDKCOption_NetworkUpdateZ;
5498
5499 /**
5500  * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5501  */
5502 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5503    /**
5504     * A pointer to the contents in the success state.
5505     * Reading from this pointer when `result_ok` is not set is undefined.
5506     */
5507    struct LDKCOption_NetworkUpdateZ *result;
5508    /**
5509     * A pointer to the contents in the error state.
5510     * Reading from this pointer when `result_ok` is set is undefined.
5511     */
5512    struct LDKDecodeError *err;
5513 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5514
5515 /**
5516  * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5517  * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5518  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5519  */
5520 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5521    /**
5522     * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5523     * `err` or `result` depending on the state of `result_ok`.
5524     */
5525    union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5526    /**
5527     * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5528     */
5529    bool result_ok;
5530 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5531
5532 /**
5533  * The contents of CResult_TxOutUtxoLookupErrorZ
5534  */
5535 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
5536    /**
5537     * A pointer to the contents in the success state.
5538     * Reading from this pointer when `result_ok` is not set is undefined.
5539     */
5540    struct LDKTxOut *result;
5541    /**
5542     * A pointer to the contents in the error state.
5543     * Reading from this pointer when `result_ok` is set is undefined.
5544     */
5545    enum LDKUtxoLookupError *err;
5546 } LDKCResult_TxOutUtxoLookupErrorZPtr;
5547
5548 /**
5549  * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
5550  * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
5551  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5552  */
5553 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
5554    /**
5555     * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
5556     * `err` or `result` depending on the state of `result_ok`.
5557     */
5558    union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
5559    /**
5560     * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
5561     */
5562    bool result_ok;
5563 } LDKCResult_TxOutUtxoLookupErrorZ;
5564
5565
5566
5567 /**
5568  * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
5569  *
5570  * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
5571  */
5572 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
5573    /**
5574     * A pointer to the opaque Rust object.
5575     * Nearly everywhere, inner must be non-null, however in places where
5576     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5577     */
5578    LDKnativeUtxoFuture *inner;
5579    /**
5580     * Indicates that this is the only struct which contains the same pointer.
5581     * Rust functions which take ownership of an object provided via an argument require
5582     * this to be true and invalidate the object pointed to by inner.
5583     */
5584    bool is_owned;
5585 } LDKUtxoFuture;
5586
5587 /**
5588  * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
5589  * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
5590  * variant.
5591  */
5592 typedef enum LDKUtxoResult_Tag {
5593    /**
5594     * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
5595     * requested or a [`UtxoLookupError`].
5596     */
5597    LDKUtxoResult_Sync,
5598    /**
5599     * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
5600     * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
5601     *
5602     * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
5603     * but only fairly loosely. Because a pending checks block all message processing, leaving
5604     * checks pending for an extended time may cause DoS of other functions. It is recommended you
5605     * keep a tight timeout on lookups, on the order of a few seconds.
5606     */
5607    LDKUtxoResult_Async,
5608    /**
5609     * Must be last for serialization purposes
5610     */
5611    LDKUtxoResult_Sentinel,
5612 } LDKUtxoResult_Tag;
5613
5614 typedef struct MUST_USE_STRUCT LDKUtxoResult {
5615    LDKUtxoResult_Tag tag;
5616    union {
5617       struct {
5618          struct LDKCResult_TxOutUtxoLookupErrorZ sync;
5619       };
5620       struct {
5621          struct LDKUtxoFuture async;
5622       };
5623    };
5624 } LDKUtxoResult;
5625
5626 /**
5627  * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
5628  */
5629 typedef struct LDKUtxoLookup {
5630    /**
5631     * An opaque pointer which is passed to your function implementations as an argument.
5632     * This has no meaning in the LDK, and can be NULL or any other value.
5633     */
5634    void *this_arg;
5635    /**
5636     * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5637     * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
5638     * unknown.
5639     *
5640     * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5641     */
5642    struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
5643    /**
5644     * Frees any resources associated with this object given its this_arg pointer.
5645     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5646     */
5647    void (*free)(void *this_arg);
5648 } LDKUtxoLookup;
5649
5650 /**
5651  * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
5652  */
5653 typedef enum LDKCOption_UtxoLookupZ_Tag {
5654    /**
5655     * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
5656     */
5657    LDKCOption_UtxoLookupZ_Some,
5658    /**
5659     * When we're in this state, this COption_UtxoLookupZ contains nothing
5660     */
5661    LDKCOption_UtxoLookupZ_None,
5662    /**
5663     * Must be last for serialization purposes
5664     */
5665    LDKCOption_UtxoLookupZ_Sentinel,
5666 } LDKCOption_UtxoLookupZ_Tag;
5667
5668 typedef struct LDKCOption_UtxoLookupZ {
5669    LDKCOption_UtxoLookupZ_Tag tag;
5670    union {
5671       struct {
5672          struct LDKUtxoLookup some;
5673       };
5674    };
5675 } LDKCOption_UtxoLookupZ;
5676
5677 /**
5678  * The contents of CResult_NoneLightningErrorZ
5679  */
5680 typedef union LDKCResult_NoneLightningErrorZPtr {
5681    /**
5682     * Note that this value is always NULL, as there are no contents in the OK variant
5683     */
5684    void *result;
5685    /**
5686     * A pointer to the contents in the error state.
5687     * Reading from this pointer when `result_ok` is set is undefined.
5688     */
5689    struct LDKLightningError *err;
5690 } LDKCResult_NoneLightningErrorZPtr;
5691
5692 /**
5693  * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5694  * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5695  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5696  */
5697 typedef struct LDKCResult_NoneLightningErrorZ {
5698    /**
5699     * The contents of this CResult_NoneLightningErrorZ, accessible via either
5700     * `err` or `result` depending on the state of `result_ok`.
5701     */
5702    union LDKCResult_NoneLightningErrorZPtr contents;
5703    /**
5704     * Whether this CResult_NoneLightningErrorZ represents a success state.
5705     */
5706    bool result_ok;
5707 } LDKCResult_NoneLightningErrorZ;
5708
5709 /**
5710  * The contents of CResult_boolLightningErrorZ
5711  */
5712 typedef union LDKCResult_boolLightningErrorZPtr {
5713    /**
5714     * A pointer to the contents in the success state.
5715     * Reading from this pointer when `result_ok` is not set is undefined.
5716     */
5717    bool *result;
5718    /**
5719     * A pointer to the contents in the error state.
5720     * Reading from this pointer when `result_ok` is set is undefined.
5721     */
5722    struct LDKLightningError *err;
5723 } LDKCResult_boolLightningErrorZPtr;
5724
5725 /**
5726  * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5727  * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5728  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5729  */
5730 typedef struct LDKCResult_boolLightningErrorZ {
5731    /**
5732     * The contents of this CResult_boolLightningErrorZ, accessible via either
5733     * `err` or `result` depending on the state of `result_ok`.
5734     */
5735    union LDKCResult_boolLightningErrorZPtr contents;
5736    /**
5737     * Whether this CResult_boolLightningErrorZ represents a success state.
5738     */
5739    bool result_ok;
5740 } LDKCResult_boolLightningErrorZ;
5741
5742
5743
5744 /**
5745  * A [`channel_announcement`] message to be sent to or received from a peer.
5746  *
5747  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
5748  */
5749 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
5750    /**
5751     * A pointer to the opaque Rust object.
5752     * Nearly everywhere, inner must be non-null, however in places where
5753     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5754     */
5755    LDKnativeChannelAnnouncement *inner;
5756    /**
5757     * Indicates that this is the only struct which contains the same pointer.
5758     * Rust functions which take ownership of an object provided via an argument require
5759     * this to be true and invalidate the object pointed to by inner.
5760     */
5761    bool is_owned;
5762 } LDKChannelAnnouncement;
5763
5764 /**
5765  * A tuple of 3 elements. See the individual fields for the types contained.
5766  */
5767 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5768    /**
5769     * The element at position 0
5770     */
5771    struct LDKChannelAnnouncement a;
5772    /**
5773     * The element at position 1
5774     */
5775    struct LDKChannelUpdate b;
5776    /**
5777     * The element at position 2
5778     */
5779    struct LDKChannelUpdate c;
5780 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5781
5782 /**
5783  * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
5784  */
5785 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
5786    /**
5787     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
5788     */
5789    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
5790    /**
5791     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
5792     */
5793    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
5794    /**
5795     * Must be last for serialization purposes
5796     */
5797    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
5798 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
5799
5800 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5801    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
5802    union {
5803       struct {
5804          struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
5805       };
5806    };
5807 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5808
5809
5810
5811 /**
5812  * An [`accept_channel`] message to be sent to or received from a peer.
5813  *
5814  * Used in V1 channel establishment
5815  *
5816  * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
5817  */
5818 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
5819    /**
5820     * A pointer to the opaque Rust object.
5821     * Nearly everywhere, inner must be non-null, however in places where
5822     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5823     */
5824    LDKnativeAcceptChannel *inner;
5825    /**
5826     * Indicates that this is the only struct which contains the same pointer.
5827     * Rust functions which take ownership of an object provided via an argument require
5828     * this to be true and invalidate the object pointed to by inner.
5829     */
5830    bool is_owned;
5831 } LDKAcceptChannel;
5832
5833
5834
5835 /**
5836  * An accept_channel2 message to be sent by or received from the channel accepter.
5837  *
5838  * Used in V2 channel establishment
5839  *
5840  */
5841 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
5842    /**
5843     * A pointer to the opaque Rust object.
5844     * Nearly everywhere, inner must be non-null, however in places where
5845     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5846     */
5847    LDKnativeAcceptChannelV2 *inner;
5848    /**
5849     * Indicates that this is the only struct which contains the same pointer.
5850     * Rust functions which take ownership of an object provided via an argument require
5851     * this to be true and invalidate the object pointed to by inner.
5852     */
5853    bool is_owned;
5854 } LDKAcceptChannelV2;
5855
5856
5857
5858 /**
5859  * An [`open_channel`] message to be sent to or received from a peer.
5860  *
5861  * Used in V1 channel establishment
5862  *
5863  * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
5864  */
5865 typedef struct MUST_USE_STRUCT LDKOpenChannel {
5866    /**
5867     * A pointer to the opaque Rust object.
5868     * Nearly everywhere, inner must be non-null, however in places where
5869     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5870     */
5871    LDKnativeOpenChannel *inner;
5872    /**
5873     * Indicates that this is the only struct which contains the same pointer.
5874     * Rust functions which take ownership of an object provided via an argument require
5875     * this to be true and invalidate the object pointed to by inner.
5876     */
5877    bool is_owned;
5878 } LDKOpenChannel;
5879
5880
5881
5882 /**
5883  * An open_channel2 message to be sent by or received from the channel initiator.
5884  *
5885  * Used in V2 channel establishment
5886  *
5887  */
5888 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
5889    /**
5890     * A pointer to the opaque Rust object.
5891     * Nearly everywhere, inner must be non-null, however in places where
5892     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5893     */
5894    LDKnativeOpenChannelV2 *inner;
5895    /**
5896     * Indicates that this is the only struct which contains the same pointer.
5897     * Rust functions which take ownership of an object provided via an argument require
5898     * this to be true and invalidate the object pointed to by inner.
5899     */
5900    bool is_owned;
5901 } LDKOpenChannelV2;
5902
5903
5904
5905 /**
5906  * A [`funding_created`] message to be sent to or received from a peer.
5907  *
5908  * Used in V1 channel establishment
5909  *
5910  * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
5911  */
5912 typedef struct MUST_USE_STRUCT LDKFundingCreated {
5913    /**
5914     * A pointer to the opaque Rust object.
5915     * Nearly everywhere, inner must be non-null, however in places where
5916     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5917     */
5918    LDKnativeFundingCreated *inner;
5919    /**
5920     * Indicates that this is the only struct which contains the same pointer.
5921     * Rust functions which take ownership of an object provided via an argument require
5922     * this to be true and invalidate the object pointed to by inner.
5923     */
5924    bool is_owned;
5925 } LDKFundingCreated;
5926
5927
5928
5929 /**
5930  * A [`funding_signed`] message to be sent to or received from a peer.
5931  *
5932  * Used in V1 channel establishment
5933  *
5934  * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
5935  */
5936 typedef struct MUST_USE_STRUCT LDKFundingSigned {
5937    /**
5938     * A pointer to the opaque Rust object.
5939     * Nearly everywhere, inner must be non-null, however in places where
5940     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5941     */
5942    LDKnativeFundingSigned *inner;
5943    /**
5944     * Indicates that this is the only struct which contains the same pointer.
5945     * Rust functions which take ownership of an object provided via an argument require
5946     * this to be true and invalidate the object pointed to by inner.
5947     */
5948    bool is_owned;
5949 } LDKFundingSigned;
5950
5951
5952
5953 /**
5954  * A tx_add_input message for adding an input during interactive transaction construction
5955  *
5956  */
5957 typedef struct MUST_USE_STRUCT LDKTxAddInput {
5958    /**
5959     * A pointer to the opaque Rust object.
5960     * Nearly everywhere, inner must be non-null, however in places where
5961     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5962     */
5963    LDKnativeTxAddInput *inner;
5964    /**
5965     * Indicates that this is the only struct which contains the same pointer.
5966     * Rust functions which take ownership of an object provided via an argument require
5967     * this to be true and invalidate the object pointed to by inner.
5968     */
5969    bool is_owned;
5970 } LDKTxAddInput;
5971
5972
5973
5974 /**
5975  * A tx_add_output message for adding an output during interactive transaction construction.
5976  *
5977  */
5978 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
5979    /**
5980     * A pointer to the opaque Rust object.
5981     * Nearly everywhere, inner must be non-null, however in places where
5982     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5983     */
5984    LDKnativeTxAddOutput *inner;
5985    /**
5986     * Indicates that this is the only struct which contains the same pointer.
5987     * Rust functions which take ownership of an object provided via an argument require
5988     * this to be true and invalidate the object pointed to by inner.
5989     */
5990    bool is_owned;
5991 } LDKTxAddOutput;
5992
5993
5994
5995 /**
5996  * A tx_remove_input message for removing an input during interactive transaction construction.
5997  *
5998  */
5999 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
6000    /**
6001     * A pointer to the opaque Rust object.
6002     * Nearly everywhere, inner must be non-null, however in places where
6003     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6004     */
6005    LDKnativeTxRemoveInput *inner;
6006    /**
6007     * Indicates that this is the only struct which contains the same pointer.
6008     * Rust functions which take ownership of an object provided via an argument require
6009     * this to be true and invalidate the object pointed to by inner.
6010     */
6011    bool is_owned;
6012 } LDKTxRemoveInput;
6013
6014
6015
6016 /**
6017  * A tx_remove_output message for removing an output during interactive transaction construction.
6018  *
6019  */
6020 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
6021    /**
6022     * A pointer to the opaque Rust object.
6023     * Nearly everywhere, inner must be non-null, however in places where
6024     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6025     */
6026    LDKnativeTxRemoveOutput *inner;
6027    /**
6028     * Indicates that this is the only struct which contains the same pointer.
6029     * Rust functions which take ownership of an object provided via an argument require
6030     * this to be true and invalidate the object pointed to by inner.
6031     */
6032    bool is_owned;
6033 } LDKTxRemoveOutput;
6034
6035
6036
6037 /**
6038  * A tx_complete message signalling the conclusion of a peer's transaction contributions during
6039  * interactive transaction construction.
6040  *
6041  */
6042 typedef struct MUST_USE_STRUCT LDKTxComplete {
6043    /**
6044     * A pointer to the opaque Rust object.
6045     * Nearly everywhere, inner must be non-null, however in places where
6046     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6047     */
6048    LDKnativeTxComplete *inner;
6049    /**
6050     * Indicates that this is the only struct which contains the same pointer.
6051     * Rust functions which take ownership of an object provided via an argument require
6052     * this to be true and invalidate the object pointed to by inner.
6053     */
6054    bool is_owned;
6055 } LDKTxComplete;
6056
6057
6058
6059 /**
6060  * A tx_signatures message containing the sender's signatures for a transaction constructed with
6061  * interactive transaction construction.
6062  *
6063  */
6064 typedef struct MUST_USE_STRUCT LDKTxSignatures {
6065    /**
6066     * A pointer to the opaque Rust object.
6067     * Nearly everywhere, inner must be non-null, however in places where
6068     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6069     */
6070    LDKnativeTxSignatures *inner;
6071    /**
6072     * Indicates that this is the only struct which contains the same pointer.
6073     * Rust functions which take ownership of an object provided via an argument require
6074     * this to be true and invalidate the object pointed to by inner.
6075     */
6076    bool is_owned;
6077 } LDKTxSignatures;
6078
6079
6080
6081 /**
6082  * A tx_init_rbf message which initiates a replacement of the transaction after it's been
6083  * completed.
6084  *
6085  */
6086 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
6087    /**
6088     * A pointer to the opaque Rust object.
6089     * Nearly everywhere, inner must be non-null, however in places where
6090     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6091     */
6092    LDKnativeTxInitRbf *inner;
6093    /**
6094     * Indicates that this is the only struct which contains the same pointer.
6095     * Rust functions which take ownership of an object provided via an argument require
6096     * this to be true and invalidate the object pointed to by inner.
6097     */
6098    bool is_owned;
6099 } LDKTxInitRbf;
6100
6101
6102
6103 /**
6104  * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
6105  * completed.
6106  *
6107  */
6108 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
6109    /**
6110     * A pointer to the opaque Rust object.
6111     * Nearly everywhere, inner must be non-null, however in places where
6112     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6113     */
6114    LDKnativeTxAckRbf *inner;
6115    /**
6116     * Indicates that this is the only struct which contains the same pointer.
6117     * Rust functions which take ownership of an object provided via an argument require
6118     * this to be true and invalidate the object pointed to by inner.
6119     */
6120    bool is_owned;
6121 } LDKTxAckRbf;
6122
6123
6124
6125 /**
6126  * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
6127  *
6128  */
6129 typedef struct MUST_USE_STRUCT LDKTxAbort {
6130    /**
6131     * A pointer to the opaque Rust object.
6132     * Nearly everywhere, inner must be non-null, however in places where
6133     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6134     */
6135    LDKnativeTxAbort *inner;
6136    /**
6137     * Indicates that this is the only struct which contains the same pointer.
6138     * Rust functions which take ownership of an object provided via an argument require
6139     * this to be true and invalidate the object pointed to by inner.
6140     */
6141    bool is_owned;
6142 } LDKTxAbort;
6143
6144
6145
6146 /**
6147  * A [`channel_ready`] message to be sent to or received from a peer.
6148  *
6149  * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
6150  */
6151 typedef struct MUST_USE_STRUCT LDKChannelReady {
6152    /**
6153     * A pointer to the opaque Rust object.
6154     * Nearly everywhere, inner must be non-null, however in places where
6155     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6156     */
6157    LDKnativeChannelReady *inner;
6158    /**
6159     * Indicates that this is the only struct which contains the same pointer.
6160     * Rust functions which take ownership of an object provided via an argument require
6161     * this to be true and invalidate the object pointed to by inner.
6162     */
6163    bool is_owned;
6164 } LDKChannelReady;
6165
6166
6167
6168 /**
6169  * An [`announcement_signatures`] message to be sent to or received from a peer.
6170  *
6171  * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
6172  */
6173 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
6174    /**
6175     * A pointer to the opaque Rust object.
6176     * Nearly everywhere, inner must be non-null, however in places where
6177     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6178     */
6179    LDKnativeAnnouncementSignatures *inner;
6180    /**
6181     * Indicates that this is the only struct which contains the same pointer.
6182     * Rust functions which take ownership of an object provided via an argument require
6183     * this to be true and invalidate the object pointed to by inner.
6184     */
6185    bool is_owned;
6186 } LDKAnnouncementSignatures;
6187
6188
6189
6190 /**
6191  * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
6192  * transaction updates if they were pending.
6193  */
6194 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
6195    /**
6196     * A pointer to the opaque Rust object.
6197     * Nearly everywhere, inner must be non-null, however in places where
6198     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6199     */
6200    LDKnativeCommitmentUpdate *inner;
6201    /**
6202     * Indicates that this is the only struct which contains the same pointer.
6203     * Rust functions which take ownership of an object provided via an argument require
6204     * this to be true and invalidate the object pointed to by inner.
6205     */
6206    bool is_owned;
6207 } LDKCommitmentUpdate;
6208
6209
6210
6211 /**
6212  * A [`revoke_and_ack`] message to be sent to or received from a peer.
6213  *
6214  * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
6215  */
6216 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
6217    /**
6218     * A pointer to the opaque Rust object.
6219     * Nearly everywhere, inner must be non-null, however in places where
6220     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6221     */
6222    LDKnativeRevokeAndACK *inner;
6223    /**
6224     * Indicates that this is the only struct which contains the same pointer.
6225     * Rust functions which take ownership of an object provided via an argument require
6226     * this to be true and invalidate the object pointed to by inner.
6227     */
6228    bool is_owned;
6229 } LDKRevokeAndACK;
6230
6231
6232
6233 /**
6234  * A [`closing_signed`] message to be sent to or received from a peer.
6235  *
6236  * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
6237  */
6238 typedef struct MUST_USE_STRUCT LDKClosingSigned {
6239    /**
6240     * A pointer to the opaque Rust object.
6241     * Nearly everywhere, inner must be non-null, however in places where
6242     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6243     */
6244    LDKnativeClosingSigned *inner;
6245    /**
6246     * Indicates that this is the only struct which contains the same pointer.
6247     * Rust functions which take ownership of an object provided via an argument require
6248     * this to be true and invalidate the object pointed to by inner.
6249     */
6250    bool is_owned;
6251 } LDKClosingSigned;
6252
6253
6254
6255 /**
6256  * A [`shutdown`] message to be sent to or received from a peer.
6257  *
6258  * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
6259  */
6260 typedef struct MUST_USE_STRUCT LDKShutdown {
6261    /**
6262     * A pointer to the opaque Rust object.
6263     * Nearly everywhere, inner must be non-null, however in places where
6264     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6265     */
6266    LDKnativeShutdown *inner;
6267    /**
6268     * Indicates that this is the only struct which contains the same pointer.
6269     * Rust functions which take ownership of an object provided via an argument require
6270     * this to be true and invalidate the object pointed to by inner.
6271     */
6272    bool is_owned;
6273 } LDKShutdown;
6274
6275
6276
6277 /**
6278  * A [`channel_reestablish`] message to be sent to or received from a peer.
6279  *
6280  * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
6281  */
6282 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
6283    /**
6284     * A pointer to the opaque Rust object.
6285     * Nearly everywhere, inner must be non-null, however in places where
6286     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6287     */
6288    LDKnativeChannelReestablish *inner;
6289    /**
6290     * Indicates that this is the only struct which contains the same pointer.
6291     * Rust functions which take ownership of an object provided via an argument require
6292     * this to be true and invalidate the object pointed to by inner.
6293     */
6294    bool is_owned;
6295 } LDKChannelReestablish;
6296
6297
6298
6299 /**
6300  * A [`node_announcement`] message to be sent to or received from a peer.
6301  *
6302  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
6303  */
6304 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
6305    /**
6306     * A pointer to the opaque Rust object.
6307     * Nearly everywhere, inner must be non-null, however in places where
6308     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6309     */
6310    LDKnativeNodeAnnouncement *inner;
6311    /**
6312     * Indicates that this is the only struct which contains the same pointer.
6313     * Rust functions which take ownership of an object provided via an argument require
6314     * this to be true and invalidate the object pointed to by inner.
6315     */
6316    bool is_owned;
6317 } LDKNodeAnnouncement;
6318
6319
6320
6321 /**
6322  * An [`error`] message to be sent to or received from a peer.
6323  *
6324  * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6325  */
6326 typedef struct MUST_USE_STRUCT LDKErrorMessage {
6327    /**
6328     * A pointer to the opaque Rust object.
6329     * Nearly everywhere, inner must be non-null, however in places where
6330     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6331     */
6332    LDKnativeErrorMessage *inner;
6333    /**
6334     * Indicates that this is the only struct which contains the same pointer.
6335     * Rust functions which take ownership of an object provided via an argument require
6336     * this to be true and invalidate the object pointed to by inner.
6337     */
6338    bool is_owned;
6339 } LDKErrorMessage;
6340
6341
6342
6343 /**
6344  * A [`warning`] message to be sent to or received from a peer.
6345  *
6346  * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6347  */
6348 typedef struct MUST_USE_STRUCT LDKWarningMessage {
6349    /**
6350     * A pointer to the opaque Rust object.
6351     * Nearly everywhere, inner must be non-null, however in places where
6352     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6353     */
6354    LDKnativeWarningMessage *inner;
6355    /**
6356     * Indicates that this is the only struct which contains the same pointer.
6357     * Rust functions which take ownership of an object provided via an argument require
6358     * this to be true and invalidate the object pointed to by inner.
6359     */
6360    bool is_owned;
6361 } LDKWarningMessage;
6362
6363 /**
6364  * Used to put an error message in a [`LightningError`].
6365  */
6366 typedef enum LDKErrorAction_Tag {
6367    /**
6368     * The peer took some action which made us think they were useless. Disconnect them.
6369     */
6370    LDKErrorAction_DisconnectPeer,
6371    /**
6372     * The peer did something incorrect. Tell them without closing any channels and disconnect them.
6373     */
6374    LDKErrorAction_DisconnectPeerWithWarning,
6375    /**
6376     * The peer did something harmless that we weren't able to process, just log and ignore
6377     */
6378    LDKErrorAction_IgnoreError,
6379    /**
6380     * The peer did something harmless that we weren't able to meaningfully process.
6381     * If the error is logged, log it at the given level.
6382     */
6383    LDKErrorAction_IgnoreAndLog,
6384    /**
6385     * The peer provided us with a gossip message which we'd already seen. In most cases this
6386     * should be ignored, but it may result in the message being forwarded if it is a duplicate of
6387     * our own channel announcements.
6388     */
6389    LDKErrorAction_IgnoreDuplicateGossip,
6390    /**
6391     * The peer did something incorrect. Tell them.
6392     */
6393    LDKErrorAction_SendErrorMessage,
6394    /**
6395     * The peer did something incorrect. Tell them without closing any channels.
6396     */
6397    LDKErrorAction_SendWarningMessage,
6398    /**
6399     * Must be last for serialization purposes
6400     */
6401    LDKErrorAction_Sentinel,
6402 } LDKErrorAction_Tag;
6403
6404 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
6405    /**
6406     * An error message which we should make an effort to send before we disconnect.
6407     *
6408     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6409     */
6410    struct LDKErrorMessage msg;
6411 } LDKErrorAction_LDKDisconnectPeer_Body;
6412
6413 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
6414    /**
6415     * A warning message which we should make an effort to send before we disconnect.
6416     */
6417    struct LDKWarningMessage msg;
6418 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
6419
6420 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
6421    /**
6422     * The message to send.
6423     */
6424    struct LDKErrorMessage msg;
6425 } LDKErrorAction_LDKSendErrorMessage_Body;
6426
6427 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
6428    /**
6429     * The message to send.
6430     */
6431    struct LDKWarningMessage msg;
6432    /**
6433     * The peer may have done something harmless that we weren't able to meaningfully process,
6434     * though we should still tell them about it.
6435     * If this event is logged, log it at the given level.
6436     */
6437    enum LDKLevel log_level;
6438 } LDKErrorAction_LDKSendWarningMessage_Body;
6439
6440 typedef struct MUST_USE_STRUCT LDKErrorAction {
6441    LDKErrorAction_Tag tag;
6442    union {
6443       LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
6444       LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
6445       struct {
6446          enum LDKLevel ignore_and_log;
6447       };
6448       LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
6449       LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
6450    };
6451 } LDKErrorAction;
6452
6453
6454
6455 /**
6456  * A [`query_channel_range`] message is used to query a peer for channel
6457  * UTXOs in a range of blocks. The recipient of a query makes a best
6458  * effort to reply to the query using one or more [`ReplyChannelRange`]
6459  * messages.
6460  *
6461  * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6462  */
6463 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
6464    /**
6465     * A pointer to the opaque Rust object.
6466     * Nearly everywhere, inner must be non-null, however in places where
6467     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6468     */
6469    LDKnativeQueryChannelRange *inner;
6470    /**
6471     * Indicates that this is the only struct which contains the same pointer.
6472     * Rust functions which take ownership of an object provided via an argument require
6473     * this to be true and invalidate the object pointed to by inner.
6474     */
6475    bool is_owned;
6476 } LDKQueryChannelRange;
6477
6478
6479
6480 /**
6481  * A [`query_short_channel_ids`] message is used to query a peer for
6482  * routing gossip messages related to one or more `short_channel_id`s.
6483  *
6484  * The query recipient will reply with the latest, if available,
6485  * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
6486  * it maintains for the requested `short_channel_id`s followed by a
6487  * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
6488  * this query are encoded. We only support `encoding_type=0` uncompressed
6489  * serialization and do not support `encoding_type=1` zlib serialization.
6490  *
6491  * [`query_short_channel_ids`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
6492  */
6493 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
6494    /**
6495     * A pointer to the opaque Rust object.
6496     * Nearly everywhere, inner must be non-null, however in places where
6497     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6498     */
6499    LDKnativeQueryShortChannelIds *inner;
6500    /**
6501     * Indicates that this is the only struct which contains the same pointer.
6502     * Rust functions which take ownership of an object provided via an argument require
6503     * this to be true and invalidate the object pointed to by inner.
6504     */
6505    bool is_owned;
6506 } LDKQueryShortChannelIds;
6507
6508
6509
6510 /**
6511  * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
6512  * message.
6513  *
6514  * Multiple `reply_channel_range` messages can be sent in reply
6515  * to a single [`QueryChannelRange`] message. The query recipient makes a
6516  * best effort to respond based on their local network view which may
6517  * not be a perfect view of the network. The `short_channel_id`s in the
6518  * reply are encoded. We only support `encoding_type=0` uncompressed
6519  * serialization and do not support `encoding_type=1` zlib serialization.
6520  *
6521  * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6522  */
6523 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
6524    /**
6525     * A pointer to the opaque Rust object.
6526     * Nearly everywhere, inner must be non-null, however in places where
6527     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6528     */
6529    LDKnativeReplyChannelRange *inner;
6530    /**
6531     * Indicates that this is the only struct which contains the same pointer.
6532     * Rust functions which take ownership of an object provided via an argument require
6533     * this to be true and invalidate the object pointed to by inner.
6534     */
6535    bool is_owned;
6536 } LDKReplyChannelRange;
6537
6538
6539
6540 /**
6541  * A [`gossip_timestamp_filter`] message is used by a node to request
6542  * gossip relay for messages in the requested time range when the
6543  * `gossip_queries` feature has been negotiated.
6544  *
6545  * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
6546  */
6547 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6548    /**
6549     * A pointer to the opaque Rust object.
6550     * Nearly everywhere, inner must be non-null, however in places where
6551     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6552     */
6553    LDKnativeGossipTimestampFilter *inner;
6554    /**
6555     * Indicates that this is the only struct which contains the same pointer.
6556     * Rust functions which take ownership of an object provided via an argument require
6557     * this to be true and invalidate the object pointed to by inner.
6558     */
6559    bool is_owned;
6560 } LDKGossipTimestampFilter;
6561
6562 /**
6563  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
6564  * broadcast to most peers).
6565  * These events are handled by PeerManager::process_events if you are using a PeerManager.
6566  */
6567 typedef enum LDKMessageSendEvent_Tag {
6568    /**
6569     * Used to indicate that we've accepted a channel open and should send the accept_channel
6570     * message provided to the given peer.
6571     */
6572    LDKMessageSendEvent_SendAcceptChannel,
6573    /**
6574     * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
6575     * message provided to the given peer.
6576     */
6577    LDKMessageSendEvent_SendAcceptChannelV2,
6578    /**
6579     * Used to indicate that we've initiated a channel open and should send the open_channel
6580     * message provided to the given peer.
6581     */
6582    LDKMessageSendEvent_SendOpenChannel,
6583    /**
6584     * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
6585     * message provided to the given peer.
6586     */
6587    LDKMessageSendEvent_SendOpenChannelV2,
6588    /**
6589     * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
6590     */
6591    LDKMessageSendEvent_SendFundingCreated,
6592    /**
6593     * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
6594     */
6595    LDKMessageSendEvent_SendFundingSigned,
6596    /**
6597     * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
6598     */
6599    LDKMessageSendEvent_SendTxAddInput,
6600    /**
6601     * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
6602     */
6603    LDKMessageSendEvent_SendTxAddOutput,
6604    /**
6605     * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
6606     */
6607    LDKMessageSendEvent_SendTxRemoveInput,
6608    /**
6609     * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
6610     */
6611    LDKMessageSendEvent_SendTxRemoveOutput,
6612    /**
6613     * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
6614     */
6615    LDKMessageSendEvent_SendTxComplete,
6616    /**
6617     * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
6618     */
6619    LDKMessageSendEvent_SendTxSignatures,
6620    /**
6621     * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
6622     */
6623    LDKMessageSendEvent_SendTxInitRbf,
6624    /**
6625     * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
6626     */
6627    LDKMessageSendEvent_SendTxAckRbf,
6628    /**
6629     * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
6630     */
6631    LDKMessageSendEvent_SendTxAbort,
6632    /**
6633     * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
6634     */
6635    LDKMessageSendEvent_SendChannelReady,
6636    /**
6637     * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
6638     */
6639    LDKMessageSendEvent_SendAnnouncementSignatures,
6640    /**
6641     * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
6642     * message should be sent to the peer with the given node_id.
6643     */
6644    LDKMessageSendEvent_UpdateHTLCs,
6645    /**
6646     * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
6647     */
6648    LDKMessageSendEvent_SendRevokeAndACK,
6649    /**
6650     * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
6651     */
6652    LDKMessageSendEvent_SendClosingSigned,
6653    /**
6654     * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
6655     */
6656    LDKMessageSendEvent_SendShutdown,
6657    /**
6658     * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
6659     */
6660    LDKMessageSendEvent_SendChannelReestablish,
6661    /**
6662     * Used to send a channel_announcement and channel_update to a specific peer, likely on
6663     * initial connection to ensure our peers know about our channels.
6664     */
6665    LDKMessageSendEvent_SendChannelAnnouncement,
6666    /**
6667     * Used to indicate that a channel_announcement and channel_update should be broadcast to all
6668     * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
6669     *
6670     * Note that after doing so, you very likely (unless you did so very recently) want to
6671     * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
6672     * ensures that any nodes which see our channel_announcement also have a relevant
6673     * node_announcement, including relevant feature flags which may be important for routing
6674     * through or to us.
6675     *
6676     * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
6677     */
6678    LDKMessageSendEvent_BroadcastChannelAnnouncement,
6679    /**
6680     * Used to indicate that a channel_update should be broadcast to all peers.
6681     */
6682    LDKMessageSendEvent_BroadcastChannelUpdate,
6683    /**
6684     * Used to indicate that a node_announcement should be broadcast to all peers.
6685     */
6686    LDKMessageSendEvent_BroadcastNodeAnnouncement,
6687    /**
6688     * Used to indicate that a channel_update should be sent to a single peer.
6689     * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
6690     * private channel and we shouldn't be informing all of our peers of channel parameters.
6691     */
6692    LDKMessageSendEvent_SendChannelUpdate,
6693    /**
6694     * Broadcast an error downstream to be handled
6695     */
6696    LDKMessageSendEvent_HandleError,
6697    /**
6698     * Query a peer for channels with funding transaction UTXOs in a block range.
6699     */
6700    LDKMessageSendEvent_SendChannelRangeQuery,
6701    /**
6702     * Request routing gossip messages from a peer for a list of channels identified by
6703     * their short_channel_ids.
6704     */
6705    LDKMessageSendEvent_SendShortIdsQuery,
6706    /**
6707     * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
6708     * emitted during processing of the query.
6709     */
6710    LDKMessageSendEvent_SendReplyChannelRange,
6711    /**
6712     * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
6713     * enable receiving gossip messages from the peer.
6714     */
6715    LDKMessageSendEvent_SendGossipTimestampFilter,
6716    /**
6717     * Must be last for serialization purposes
6718     */
6719    LDKMessageSendEvent_Sentinel,
6720 } LDKMessageSendEvent_Tag;
6721
6722 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
6723    /**
6724     * The node_id of the node which should receive this message
6725     */
6726    struct LDKPublicKey node_id;
6727    /**
6728     * The message which should be sent.
6729     */
6730    struct LDKAcceptChannel msg;
6731 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
6732
6733 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
6734    /**
6735     * The node_id of the node which should receive this message
6736     */
6737    struct LDKPublicKey node_id;
6738    /**
6739     * The message which should be sent.
6740     */
6741    struct LDKAcceptChannelV2 msg;
6742 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
6743
6744 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
6745    /**
6746     * The node_id of the node which should receive this message
6747     */
6748    struct LDKPublicKey node_id;
6749    /**
6750     * The message which should be sent.
6751     */
6752    struct LDKOpenChannel msg;
6753 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
6754
6755 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
6756    /**
6757     * The node_id of the node which should receive this message
6758     */
6759    struct LDKPublicKey node_id;
6760    /**
6761     * The message which should be sent.
6762     */
6763    struct LDKOpenChannelV2 msg;
6764 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
6765
6766 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
6767    /**
6768     * The node_id of the node which should receive this message
6769     */
6770    struct LDKPublicKey node_id;
6771    /**
6772     * The message which should be sent.
6773     */
6774    struct LDKFundingCreated msg;
6775 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
6776
6777 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
6778    /**
6779     * The node_id of the node which should receive this message
6780     */
6781    struct LDKPublicKey node_id;
6782    /**
6783     * The message which should be sent.
6784     */
6785    struct LDKFundingSigned msg;
6786 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
6787
6788 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
6789    /**
6790     * The node_id of the node which should receive this message
6791     */
6792    struct LDKPublicKey node_id;
6793    /**
6794     * The message which should be sent.
6795     */
6796    struct LDKTxAddInput msg;
6797 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
6798
6799 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
6800    /**
6801     * The node_id of the node which should receive this message
6802     */
6803    struct LDKPublicKey node_id;
6804    /**
6805     * The message which should be sent.
6806     */
6807    struct LDKTxAddOutput msg;
6808 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
6809
6810 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
6811    /**
6812     * The node_id of the node which should receive this message
6813     */
6814    struct LDKPublicKey node_id;
6815    /**
6816     * The message which should be sent.
6817     */
6818    struct LDKTxRemoveInput msg;
6819 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
6820
6821 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
6822    /**
6823     * The node_id of the node which should receive this message
6824     */
6825    struct LDKPublicKey node_id;
6826    /**
6827     * The message which should be sent.
6828     */
6829    struct LDKTxRemoveOutput msg;
6830 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
6831
6832 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
6833    /**
6834     * The node_id of the node which should receive this message
6835     */
6836    struct LDKPublicKey node_id;
6837    /**
6838     * The message which should be sent.
6839     */
6840    struct LDKTxComplete msg;
6841 } LDKMessageSendEvent_LDKSendTxComplete_Body;
6842
6843 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
6844    /**
6845     * The node_id of the node which should receive this message
6846     */
6847    struct LDKPublicKey node_id;
6848    /**
6849     * The message which should be sent.
6850     */
6851    struct LDKTxSignatures msg;
6852 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
6853
6854 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
6855    /**
6856     * The node_id of the node which should receive this message
6857     */
6858    struct LDKPublicKey node_id;
6859    /**
6860     * The message which should be sent.
6861     */
6862    struct LDKTxInitRbf msg;
6863 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
6864
6865 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
6866    /**
6867     * The node_id of the node which should receive this message
6868     */
6869    struct LDKPublicKey node_id;
6870    /**
6871     * The message which should be sent.
6872     */
6873    struct LDKTxAckRbf msg;
6874 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
6875
6876 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
6877    /**
6878     * The node_id of the node which should receive this message
6879     */
6880    struct LDKPublicKey node_id;
6881    /**
6882     * The message which should be sent.
6883     */
6884    struct LDKTxAbort msg;
6885 } LDKMessageSendEvent_LDKSendTxAbort_Body;
6886
6887 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
6888    /**
6889     * The node_id of the node which should receive these message(s)
6890     */
6891    struct LDKPublicKey node_id;
6892    /**
6893     * The channel_ready message which should be sent.
6894     */
6895    struct LDKChannelReady msg;
6896 } LDKMessageSendEvent_LDKSendChannelReady_Body;
6897
6898 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
6899    /**
6900     * The node_id of the node which should receive these message(s)
6901     */
6902    struct LDKPublicKey node_id;
6903    /**
6904     * The announcement_signatures message which should be sent.
6905     */
6906    struct LDKAnnouncementSignatures msg;
6907 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
6908
6909 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
6910    /**
6911     * The node_id of the node which should receive these message(s)
6912     */
6913    struct LDKPublicKey node_id;
6914    /**
6915     * The update messages which should be sent. ALL messages in the struct should be sent!
6916     */
6917    struct LDKCommitmentUpdate updates;
6918 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
6919
6920 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
6921    /**
6922     * The node_id of the node which should receive this message
6923     */
6924    struct LDKPublicKey node_id;
6925    /**
6926     * The message which should be sent.
6927     */
6928    struct LDKRevokeAndACK msg;
6929 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
6930
6931 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
6932    /**
6933     * The node_id of the node which should receive this message
6934     */
6935    struct LDKPublicKey node_id;
6936    /**
6937     * The message which should be sent.
6938     */
6939    struct LDKClosingSigned msg;
6940 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
6941
6942 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
6943    /**
6944     * The node_id of the node which should receive this message
6945     */
6946    struct LDKPublicKey node_id;
6947    /**
6948     * The message which should be sent.
6949     */
6950    struct LDKShutdown msg;
6951 } LDKMessageSendEvent_LDKSendShutdown_Body;
6952
6953 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
6954    /**
6955     * The node_id of the node which should receive this message
6956     */
6957    struct LDKPublicKey node_id;
6958    /**
6959     * The message which should be sent.
6960     */
6961    struct LDKChannelReestablish msg;
6962 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
6963
6964 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
6965    /**
6966     * The node_id of the node which should receive this message
6967     */
6968    struct LDKPublicKey node_id;
6969    /**
6970     * The channel_announcement which should be sent.
6971     */
6972    struct LDKChannelAnnouncement msg;
6973    /**
6974     * The followup channel_update which should be sent.
6975     */
6976    struct LDKChannelUpdate update_msg;
6977 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
6978
6979 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
6980    /**
6981     * The channel_announcement which should be sent.
6982     */
6983    struct LDKChannelAnnouncement msg;
6984    /**
6985     * The followup channel_update which should be sent.
6986     *
6987     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6988     */
6989    struct LDKChannelUpdate update_msg;
6990 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
6991
6992 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
6993    /**
6994     * The channel_update which should be sent.
6995     */
6996    struct LDKChannelUpdate msg;
6997 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
6998
6999 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
7000    /**
7001     * The node_announcement which should be sent.
7002     */
7003    struct LDKNodeAnnouncement msg;
7004 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
7005
7006 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
7007    /**
7008     * The node_id of the node which should receive this message
7009     */
7010    struct LDKPublicKey node_id;
7011    /**
7012     * The channel_update which should be sent.
7013     */
7014    struct LDKChannelUpdate msg;
7015 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
7016
7017 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
7018    /**
7019     * The node_id of the node which should receive this message
7020     */
7021    struct LDKPublicKey node_id;
7022    /**
7023     * The action which should be taken.
7024     */
7025    struct LDKErrorAction action;
7026 } LDKMessageSendEvent_LDKHandleError_Body;
7027
7028 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
7029    /**
7030     * The node_id of this message recipient
7031     */
7032    struct LDKPublicKey node_id;
7033    /**
7034     * The query_channel_range which should be sent.
7035     */
7036    struct LDKQueryChannelRange msg;
7037 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
7038
7039 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
7040    /**
7041     * The node_id of this message recipient
7042     */
7043    struct LDKPublicKey node_id;
7044    /**
7045     * The query_short_channel_ids which should be sent.
7046     */
7047    struct LDKQueryShortChannelIds msg;
7048 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
7049
7050 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
7051    /**
7052     * The node_id of this message recipient
7053     */
7054    struct LDKPublicKey node_id;
7055    /**
7056     * The reply_channel_range which should be sent.
7057     */
7058    struct LDKReplyChannelRange msg;
7059 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
7060
7061 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
7062    /**
7063     * The node_id of this message recipient
7064     */
7065    struct LDKPublicKey node_id;
7066    /**
7067     * The gossip_timestamp_filter which should be sent.
7068     */
7069    struct LDKGossipTimestampFilter msg;
7070 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
7071
7072 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
7073    LDKMessageSendEvent_Tag tag;
7074    union {
7075       LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
7076       LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
7077       LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
7078       LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
7079       LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
7080       LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
7081       LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
7082       LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
7083       LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
7084       LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
7085       LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
7086       LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
7087       LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
7088       LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
7089       LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
7090       LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
7091       LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
7092       LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
7093       LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
7094       LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
7095       LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
7096       LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
7097       LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
7098       LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
7099       LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
7100       LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
7101       LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
7102       LDKMessageSendEvent_LDKHandleError_Body handle_error;
7103       LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
7104       LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
7105       LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
7106       LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
7107    };
7108 } LDKMessageSendEvent;
7109
7110 /**
7111  * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
7112  * This corresponds to std::vector in C++
7113  */
7114 typedef struct LDKCVec_MessageSendEventZ {
7115    /**
7116     * The elements in the array.
7117     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7118     */
7119    struct LDKMessageSendEvent *data;
7120    /**
7121     * The number of elements pointed to by `data`.
7122     */
7123    uintptr_t datalen;
7124 } LDKCVec_MessageSendEventZ;
7125
7126
7127
7128 /**
7129  * Details about one direction of a channel as received within a [`ChannelUpdate`].
7130  */
7131 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
7132    /**
7133     * A pointer to the opaque Rust object.
7134     * Nearly everywhere, inner must be non-null, however in places where
7135     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7136     */
7137    LDKnativeChannelUpdateInfo *inner;
7138    /**
7139     * Indicates that this is the only struct which contains the same pointer.
7140     * Rust functions which take ownership of an object provided via an argument require
7141     * this to be true and invalidate the object pointed to by inner.
7142     */
7143    bool is_owned;
7144 } LDKChannelUpdateInfo;
7145
7146 /**
7147  * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
7148  */
7149 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
7150    /**
7151     * A pointer to the contents in the success state.
7152     * Reading from this pointer when `result_ok` is not set is undefined.
7153     */
7154    struct LDKChannelUpdateInfo *result;
7155    /**
7156     * A pointer to the contents in the error state.
7157     * Reading from this pointer when `result_ok` is set is undefined.
7158     */
7159    struct LDKDecodeError *err;
7160 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
7161
7162 /**
7163  * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
7164  * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7165  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7166  */
7167 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
7168    /**
7169     * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
7170     * `err` or `result` depending on the state of `result_ok`.
7171     */
7172    union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
7173    /**
7174     * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
7175     */
7176    bool result_ok;
7177 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
7178
7179
7180
7181 /**
7182  * Details about a channel (both directions).
7183  * Received within a channel announcement.
7184  */
7185 typedef struct MUST_USE_STRUCT LDKChannelInfo {
7186    /**
7187     * A pointer to the opaque Rust object.
7188     * Nearly everywhere, inner must be non-null, however in places where
7189     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7190     */
7191    LDKnativeChannelInfo *inner;
7192    /**
7193     * Indicates that this is the only struct which contains the same pointer.
7194     * Rust functions which take ownership of an object provided via an argument require
7195     * this to be true and invalidate the object pointed to by inner.
7196     */
7197    bool is_owned;
7198 } LDKChannelInfo;
7199
7200 /**
7201  * The contents of CResult_ChannelInfoDecodeErrorZ
7202  */
7203 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
7204    /**
7205     * A pointer to the contents in the success state.
7206     * Reading from this pointer when `result_ok` is not set is undefined.
7207     */
7208    struct LDKChannelInfo *result;
7209    /**
7210     * A pointer to the contents in the error state.
7211     * Reading from this pointer when `result_ok` is set is undefined.
7212     */
7213    struct LDKDecodeError *err;
7214 } LDKCResult_ChannelInfoDecodeErrorZPtr;
7215
7216 /**
7217  * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
7218  * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7219  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7220  */
7221 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
7222    /**
7223     * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
7224     * `err` or `result` depending on the state of `result_ok`.
7225     */
7226    union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
7227    /**
7228     * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
7229     */
7230    bool result_ok;
7231 } LDKCResult_ChannelInfoDecodeErrorZ;
7232
7233
7234
7235 /**
7236  * Fees for routing via a given channel or a node
7237  */
7238 typedef struct MUST_USE_STRUCT LDKRoutingFees {
7239    /**
7240     * A pointer to the opaque Rust object.
7241     * Nearly everywhere, inner must be non-null, however in places where
7242     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7243     */
7244    LDKnativeRoutingFees *inner;
7245    /**
7246     * Indicates that this is the only struct which contains the same pointer.
7247     * Rust functions which take ownership of an object provided via an argument require
7248     * this to be true and invalidate the object pointed to by inner.
7249     */
7250    bool is_owned;
7251 } LDKRoutingFees;
7252
7253 /**
7254  * The contents of CResult_RoutingFeesDecodeErrorZ
7255  */
7256 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
7257    /**
7258     * A pointer to the contents in the success state.
7259     * Reading from this pointer when `result_ok` is not set is undefined.
7260     */
7261    struct LDKRoutingFees *result;
7262    /**
7263     * A pointer to the contents in the error state.
7264     * Reading from this pointer when `result_ok` is set is undefined.
7265     */
7266    struct LDKDecodeError *err;
7267 } LDKCResult_RoutingFeesDecodeErrorZPtr;
7268
7269 /**
7270  * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
7271  * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
7272  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7273  */
7274 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
7275    /**
7276     * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
7277     * `err` or `result` depending on the state of `result_ok`.
7278     */
7279    union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
7280    /**
7281     * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
7282     */
7283    bool result_ok;
7284 } LDKCResult_RoutingFeesDecodeErrorZ;
7285
7286 /**
7287  * A 4-byte byte array.
7288  */
7289 typedef struct LDKFourBytes {
7290    /**
7291     * The four bytes
7292     */
7293    uint8_t data[4];
7294 } LDKFourBytes;
7295
7296 /**
7297  * A 12-byte byte array.
7298  */
7299 typedef struct LDKTwelveBytes {
7300    /**
7301     * The twelve bytes
7302     */
7303    uint8_t data[12];
7304 } LDKTwelveBytes;
7305
7306
7307
7308 /**
7309  * Represents a hostname for serialization purposes.
7310  * Only the character set and length will be validated.
7311  * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
7312  * Its length is guaranteed to be representable by a single byte.
7313  * This serialization is used by [`BOLT 7`] hostnames.
7314  *
7315  * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
7316  */
7317 typedef struct MUST_USE_STRUCT LDKHostname {
7318    /**
7319     * A pointer to the opaque Rust object.
7320     * Nearly everywhere, inner must be non-null, however in places where
7321     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7322     */
7323    LDKnativeHostname *inner;
7324    /**
7325     * Indicates that this is the only struct which contains the same pointer.
7326     * Rust functions which take ownership of an object provided via an argument require
7327     * this to be true and invalidate the object pointed to by inner.
7328     */
7329    bool is_owned;
7330 } LDKHostname;
7331
7332 /**
7333  * An address which can be used to connect to a remote peer.
7334  */
7335 typedef enum LDKSocketAddress_Tag {
7336    /**
7337     * An IPv4 address and port on which the peer is listening.
7338     */
7339    LDKSocketAddress_TcpIpV4,
7340    /**
7341     * An IPv6 address and port on which the peer is listening.
7342     */
7343    LDKSocketAddress_TcpIpV6,
7344    /**
7345     * An old-style Tor onion address/port on which the peer is listening.
7346     *
7347     * This field is deprecated and the Tor network generally no longer supports V2 Onion
7348     * addresses. Thus, the details are not parsed here.
7349     */
7350    LDKSocketAddress_OnionV2,
7351    /**
7352     * A new-style Tor onion address/port on which the peer is listening.
7353     *
7354     * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
7355     * wrap as base32 and append \".onion\".
7356     */
7357    LDKSocketAddress_OnionV3,
7358    /**
7359     * A hostname/port on which the peer is listening.
7360     */
7361    LDKSocketAddress_Hostname,
7362    /**
7363     * Must be last for serialization purposes
7364     */
7365    LDKSocketAddress_Sentinel,
7366 } LDKSocketAddress_Tag;
7367
7368 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
7369    /**
7370     * The 4-byte IPv4 address
7371     */
7372    struct LDKFourBytes addr;
7373    /**
7374     * The port on which the node is listening
7375     */
7376    uint16_t port;
7377 } LDKSocketAddress_LDKTcpIpV4_Body;
7378
7379 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
7380    /**
7381     * The 16-byte IPv6 address
7382     */
7383    struct LDKSixteenBytes addr;
7384    /**
7385     * The port on which the node is listening
7386     */
7387    uint16_t port;
7388 } LDKSocketAddress_LDKTcpIpV6_Body;
7389
7390 typedef struct LDKSocketAddress_LDKOnionV3_Body {
7391    /**
7392     * The ed25519 long-term public key of the peer
7393     */
7394    struct LDKThirtyTwoBytes ed25519_pubkey;
7395    /**
7396     * The checksum of the pubkey and version, as included in the onion address
7397     */
7398    uint16_t checksum;
7399    /**
7400     * The version byte, as defined by the Tor Onion v3 spec.
7401     */
7402    uint8_t version;
7403    /**
7404     * The port on which the node is listening
7405     */
7406    uint16_t port;
7407 } LDKSocketAddress_LDKOnionV3_Body;
7408
7409 typedef struct LDKSocketAddress_LDKHostname_Body {
7410    /**
7411     * The hostname on which the node is listening.
7412     */
7413    struct LDKHostname hostname;
7414    /**
7415     * The port on which the node is listening.
7416     */
7417    uint16_t port;
7418 } LDKSocketAddress_LDKHostname_Body;
7419
7420 typedef struct MUST_USE_STRUCT LDKSocketAddress {
7421    LDKSocketAddress_Tag tag;
7422    union {
7423       LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
7424       LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
7425       struct {
7426          struct LDKTwelveBytes onion_v2;
7427       };
7428       LDKSocketAddress_LDKOnionV3_Body onion_v3;
7429       LDKSocketAddress_LDKHostname_Body hostname;
7430    };
7431 } LDKSocketAddress;
7432
7433 /**
7434  * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
7435  * This corresponds to std::vector in C++
7436  */
7437 typedef struct LDKCVec_SocketAddressZ {
7438    /**
7439     * The elements in the array.
7440     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7441     */
7442    struct LDKSocketAddress *data;
7443    /**
7444     * The number of elements pointed to by `data`.
7445     */
7446    uintptr_t datalen;
7447 } LDKCVec_SocketAddressZ;
7448
7449
7450
7451 /**
7452  * Information received in the latest node_announcement from this node.
7453  */
7454 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
7455    /**
7456     * A pointer to the opaque Rust object.
7457     * Nearly everywhere, inner must be non-null, however in places where
7458     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7459     */
7460    LDKnativeNodeAnnouncementInfo *inner;
7461    /**
7462     * Indicates that this is the only struct which contains the same pointer.
7463     * Rust functions which take ownership of an object provided via an argument require
7464     * this to be true and invalidate the object pointed to by inner.
7465     */
7466    bool is_owned;
7467 } LDKNodeAnnouncementInfo;
7468
7469 /**
7470  * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
7471  */
7472 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
7473    /**
7474     * A pointer to the contents in the success state.
7475     * Reading from this pointer when `result_ok` is not set is undefined.
7476     */
7477    struct LDKNodeAnnouncementInfo *result;
7478    /**
7479     * A pointer to the contents in the error state.
7480     * Reading from this pointer when `result_ok` is set is undefined.
7481     */
7482    struct LDKDecodeError *err;
7483 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
7484
7485 /**
7486  * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
7487  * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7488  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7489  */
7490 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
7491    /**
7492     * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
7493     * `err` or `result` depending on the state of `result_ok`.
7494     */
7495    union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
7496    /**
7497     * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
7498     */
7499    bool result_ok;
7500 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
7501
7502
7503
7504 /**
7505  * A user-defined name for a node, which may be used when displaying the node in a graph.
7506  *
7507  * Since node aliases are provided by third parties, they are a potential avenue for injection
7508  * attacks. Care must be taken when processing.
7509  */
7510 typedef struct MUST_USE_STRUCT LDKNodeAlias {
7511    /**
7512     * A pointer to the opaque Rust object.
7513     * Nearly everywhere, inner must be non-null, however in places where
7514     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7515     */
7516    LDKnativeNodeAlias *inner;
7517    /**
7518     * Indicates that this is the only struct which contains the same pointer.
7519     * Rust functions which take ownership of an object provided via an argument require
7520     * this to be true and invalidate the object pointed to by inner.
7521     */
7522    bool is_owned;
7523 } LDKNodeAlias;
7524
7525 /**
7526  * The contents of CResult_NodeAliasDecodeErrorZ
7527  */
7528 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
7529    /**
7530     * A pointer to the contents in the success state.
7531     * Reading from this pointer when `result_ok` is not set is undefined.
7532     */
7533    struct LDKNodeAlias *result;
7534    /**
7535     * A pointer to the contents in the error state.
7536     * Reading from this pointer when `result_ok` is set is undefined.
7537     */
7538    struct LDKDecodeError *err;
7539 } LDKCResult_NodeAliasDecodeErrorZPtr;
7540
7541 /**
7542  * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
7543  * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
7544  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7545  */
7546 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
7547    /**
7548     * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
7549     * `err` or `result` depending on the state of `result_ok`.
7550     */
7551    union LDKCResult_NodeAliasDecodeErrorZPtr contents;
7552    /**
7553     * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
7554     */
7555    bool result_ok;
7556 } LDKCResult_NodeAliasDecodeErrorZ;
7557
7558
7559
7560 /**
7561  * Details about a node in the network, known from the network announcement.
7562  */
7563 typedef struct MUST_USE_STRUCT LDKNodeInfo {
7564    /**
7565     * A pointer to the opaque Rust object.
7566     * Nearly everywhere, inner must be non-null, however in places where
7567     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7568     */
7569    LDKnativeNodeInfo *inner;
7570    /**
7571     * Indicates that this is the only struct which contains the same pointer.
7572     * Rust functions which take ownership of an object provided via an argument require
7573     * this to be true and invalidate the object pointed to by inner.
7574     */
7575    bool is_owned;
7576 } LDKNodeInfo;
7577
7578 /**
7579  * The contents of CResult_NodeInfoDecodeErrorZ
7580  */
7581 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
7582    /**
7583     * A pointer to the contents in the success state.
7584     * Reading from this pointer when `result_ok` is not set is undefined.
7585     */
7586    struct LDKNodeInfo *result;
7587    /**
7588     * A pointer to the contents in the error state.
7589     * Reading from this pointer when `result_ok` is set is undefined.
7590     */
7591    struct LDKDecodeError *err;
7592 } LDKCResult_NodeInfoDecodeErrorZPtr;
7593
7594 /**
7595  * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
7596  * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7597  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7598  */
7599 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
7600    /**
7601     * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
7602     * `err` or `result` depending on the state of `result_ok`.
7603     */
7604    union LDKCResult_NodeInfoDecodeErrorZPtr contents;
7605    /**
7606     * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
7607     */
7608    bool result_ok;
7609 } LDKCResult_NodeInfoDecodeErrorZ;
7610
7611 /**
7612  * The contents of CResult_NetworkGraphDecodeErrorZ
7613  */
7614 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
7615    /**
7616     * A pointer to the contents in the success state.
7617     * Reading from this pointer when `result_ok` is not set is undefined.
7618     */
7619    struct LDKNetworkGraph *result;
7620    /**
7621     * A pointer to the contents in the error state.
7622     * Reading from this pointer when `result_ok` is set is undefined.
7623     */
7624    struct LDKDecodeError *err;
7625 } LDKCResult_NetworkGraphDecodeErrorZPtr;
7626
7627 /**
7628  * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
7629  * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
7630  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7631  */
7632 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
7633    /**
7634     * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
7635     * `err` or `result` depending on the state of `result_ok`.
7636     */
7637    union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
7638    /**
7639     * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
7640     */
7641    bool result_ok;
7642 } LDKCResult_NetworkGraphDecodeErrorZ;
7643
7644 /**
7645  * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
7646  */
7647 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
7648    /**
7649     * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
7650     */
7651    LDKCOption_CVec_SocketAddressZZ_Some,
7652    /**
7653     * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
7654     */
7655    LDKCOption_CVec_SocketAddressZZ_None,
7656    /**
7657     * Must be last for serialization purposes
7658     */
7659    LDKCOption_CVec_SocketAddressZZ_Sentinel,
7660 } LDKCOption_CVec_SocketAddressZZ_Tag;
7661
7662 typedef struct LDKCOption_CVec_SocketAddressZZ {
7663    LDKCOption_CVec_SocketAddressZZ_Tag tag;
7664    union {
7665       struct {
7666          struct LDKCVec_SocketAddressZ some;
7667       };
7668    };
7669 } LDKCOption_CVec_SocketAddressZZ;
7670
7671 /**
7672  * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
7673  * This corresponds to std::vector in C++
7674  */
7675 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
7676    /**
7677     * The elements in the array.
7678     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7679     */
7680    struct LDKHTLCOutputInCommitment *data;
7681    /**
7682     * The number of elements pointed to by `data`.
7683     */
7684    uintptr_t datalen;
7685 } LDKCVec_HTLCOutputInCommitmentZ;
7686
7687 /**
7688  * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
7689  * This corresponds to std::vector in C++
7690  */
7691 typedef struct LDKCVec_HTLCDescriptorZ {
7692    /**
7693     * The elements in the array.
7694     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7695     */
7696    struct LDKHTLCDescriptor *data;
7697    /**
7698     * The number of elements pointed to by `data`.
7699     */
7700    uintptr_t datalen;
7701 } LDKCVec_HTLCDescriptorZ;
7702
7703
7704
7705 /**
7706  * An unspent transaction output that is available to spend resulting from a successful
7707  * [`CoinSelection`] attempt.
7708  */
7709 typedef struct MUST_USE_STRUCT LDKUtxo {
7710    /**
7711     * A pointer to the opaque Rust object.
7712     * Nearly everywhere, inner must be non-null, however in places where
7713     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7714     */
7715    LDKnativeUtxo *inner;
7716    /**
7717     * Indicates that this is the only struct which contains the same pointer.
7718     * Rust functions which take ownership of an object provided via an argument require
7719     * this to be true and invalidate the object pointed to by inner.
7720     */
7721    bool is_owned;
7722 } LDKUtxo;
7723
7724 /**
7725  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
7726  * This corresponds to std::vector in C++
7727  */
7728 typedef struct LDKCVec_UtxoZ {
7729    /**
7730     * The elements in the array.
7731     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7732     */
7733    struct LDKUtxo *data;
7734    /**
7735     * The number of elements pointed to by `data`.
7736     */
7737    uintptr_t datalen;
7738 } LDKCVec_UtxoZ;
7739
7740 /**
7741  * An enum which can either contain a crate::c_types::TxOut or not
7742  */
7743 typedef enum LDKCOption_TxOutZ_Tag {
7744    /**
7745     * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
7746     */
7747    LDKCOption_TxOutZ_Some,
7748    /**
7749     * When we're in this state, this COption_TxOutZ contains nothing
7750     */
7751    LDKCOption_TxOutZ_None,
7752    /**
7753     * Must be last for serialization purposes
7754     */
7755    LDKCOption_TxOutZ_Sentinel,
7756 } LDKCOption_TxOutZ_Tag;
7757
7758 typedef struct LDKCOption_TxOutZ {
7759    LDKCOption_TxOutZ_Tag tag;
7760    union {
7761       struct {
7762          struct LDKTxOut some;
7763       };
7764    };
7765 } LDKCOption_TxOutZ;
7766
7767
7768
7769 /**
7770  * An input that must be included in a transaction when performing coin selection through
7771  * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
7772  * must have an empty [`TxIn::script_sig`] when spent.
7773  */
7774 typedef struct MUST_USE_STRUCT LDKInput {
7775    /**
7776     * A pointer to the opaque Rust object.
7777     * Nearly everywhere, inner must be non-null, however in places where
7778     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7779     */
7780    LDKnativeInput *inner;
7781    /**
7782     * Indicates that this is the only struct which contains the same pointer.
7783     * Rust functions which take ownership of an object provided via an argument require
7784     * this to be true and invalidate the object pointed to by inner.
7785     */
7786    bool is_owned;
7787 } LDKInput;
7788
7789 /**
7790  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
7791  * This corresponds to std::vector in C++
7792  */
7793 typedef struct LDKCVec_InputZ {
7794    /**
7795     * The elements in the array.
7796     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7797     */
7798    struct LDKInput *data;
7799    /**
7800     * The number of elements pointed to by `data`.
7801     */
7802    uintptr_t datalen;
7803 } LDKCVec_InputZ;
7804
7805
7806
7807 /**
7808  * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
7809  * to cover its fees.
7810  */
7811 typedef struct MUST_USE_STRUCT LDKCoinSelection {
7812    /**
7813     * A pointer to the opaque Rust object.
7814     * Nearly everywhere, inner must be non-null, however in places where
7815     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7816     */
7817    LDKnativeCoinSelection *inner;
7818    /**
7819     * Indicates that this is the only struct which contains the same pointer.
7820     * Rust functions which take ownership of an object provided via an argument require
7821     * this to be true and invalidate the object pointed to by inner.
7822     */
7823    bool is_owned;
7824 } LDKCoinSelection;
7825
7826 /**
7827  * The contents of CResult_CoinSelectionNoneZ
7828  */
7829 typedef union LDKCResult_CoinSelectionNoneZPtr {
7830    /**
7831     * A pointer to the contents in the success state.
7832     * Reading from this pointer when `result_ok` is not set is undefined.
7833     */
7834    struct LDKCoinSelection *result;
7835    /**
7836     * Note that this value is always NULL, as there are no contents in the Err variant
7837     */
7838    void *err;
7839 } LDKCResult_CoinSelectionNoneZPtr;
7840
7841 /**
7842  * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
7843  * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
7844  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7845  */
7846 typedef struct LDKCResult_CoinSelectionNoneZ {
7847    /**
7848     * The contents of this CResult_CoinSelectionNoneZ, accessible via either
7849     * `err` or `result` depending on the state of `result_ok`.
7850     */
7851    union LDKCResult_CoinSelectionNoneZPtr contents;
7852    /**
7853     * Whether this CResult_CoinSelectionNoneZ represents a success state.
7854     */
7855    bool result_ok;
7856 } LDKCResult_CoinSelectionNoneZ;
7857
7858 /**
7859  * The contents of CResult_CVec_UtxoZNoneZ
7860  */
7861 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
7862    /**
7863     * A pointer to the contents in the success state.
7864     * Reading from this pointer when `result_ok` is not set is undefined.
7865     */
7866    struct LDKCVec_UtxoZ *result;
7867    /**
7868     * Note that this value is always NULL, as there are no contents in the Err variant
7869     */
7870    void *err;
7871 } LDKCResult_CVec_UtxoZNoneZPtr;
7872
7873 /**
7874  * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
7875  * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
7876  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7877  */
7878 typedef struct LDKCResult_CVec_UtxoZNoneZ {
7879    /**
7880     * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
7881     * `err` or `result` depending on the state of `result_ok`.
7882     */
7883    union LDKCResult_CVec_UtxoZNoneZPtr contents;
7884    /**
7885     * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
7886     */
7887    bool result_ok;
7888 } LDKCResult_CVec_UtxoZNoneZ;
7889
7890 /**
7891  * A tuple of 2 elements. See the individual fields for the types contained.
7892  */
7893 typedef struct LDKC2Tuple_u64u16Z {
7894    /**
7895     * The element at position 0
7896     */
7897    uint64_t a;
7898    /**
7899     * The element at position 1
7900     */
7901    uint16_t b;
7902 } LDKC2Tuple_u64u16Z;
7903
7904 /**
7905  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
7906  */
7907 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
7908    /**
7909     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
7910     */
7911    LDKCOption_C2Tuple_u64u16ZZ_Some,
7912    /**
7913     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
7914     */
7915    LDKCOption_C2Tuple_u64u16ZZ_None,
7916    /**
7917     * Must be last for serialization purposes
7918     */
7919    LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
7920 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
7921
7922 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
7923    LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
7924    union {
7925       struct {
7926          struct LDKC2Tuple_u64u16Z some;
7927       };
7928    };
7929 } LDKCOption_C2Tuple_u64u16ZZ;
7930
7931 /**
7932  * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
7933  */
7934 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
7935    /**
7936     * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
7937     */
7938    LDKCOption_ChannelShutdownStateZ_Some,
7939    /**
7940     * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
7941     */
7942    LDKCOption_ChannelShutdownStateZ_None,
7943    /**
7944     * Must be last for serialization purposes
7945     */
7946    LDKCOption_ChannelShutdownStateZ_Sentinel,
7947 } LDKCOption_ChannelShutdownStateZ_Tag;
7948
7949 typedef struct LDKCOption_ChannelShutdownStateZ {
7950    LDKCOption_ChannelShutdownStateZ_Tag tag;
7951    union {
7952       struct {
7953          enum LDKChannelShutdownState some;
7954       };
7955    };
7956 } LDKCOption_ChannelShutdownStateZ;
7957
7958 /**
7959  * The contents of CResult_ThirtyTwoBytesAPIErrorZ
7960  */
7961 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
7962    /**
7963     * A pointer to the contents in the success state.
7964     * Reading from this pointer when `result_ok` is not set is undefined.
7965     */
7966    struct LDKThirtyTwoBytes *result;
7967    /**
7968     * A pointer to the contents in the error state.
7969     * Reading from this pointer when `result_ok` is set is undefined.
7970     */
7971    struct LDKAPIError *err;
7972 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
7973
7974 /**
7975  * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
7976  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7977  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7978  */
7979 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
7980    /**
7981     * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
7982     * `err` or `result` depending on the state of `result_ok`.
7983     */
7984    union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
7985    /**
7986     * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
7987     */
7988    bool result_ok;
7989 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
7990
7991 /**
7992  * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
7993  * These include payments that have yet to find a successful path, or have unresolved HTLCs.
7994  */
7995 typedef enum LDKRecentPaymentDetails_Tag {
7996    /**
7997     * When an invoice was requested and thus a payment has not yet been sent.
7998     */
7999    LDKRecentPaymentDetails_AwaitingInvoice,
8000    /**
8001     * When a payment is still being sent and awaiting successful delivery.
8002     */
8003    LDKRecentPaymentDetails_Pending,
8004    /**
8005     * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
8006     * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
8007     * payment is removed from tracking.
8008     */
8009    LDKRecentPaymentDetails_Fulfilled,
8010    /**
8011     * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
8012     * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
8013     * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
8014     */
8015    LDKRecentPaymentDetails_Abandoned,
8016    /**
8017     * Must be last for serialization purposes
8018     */
8019    LDKRecentPaymentDetails_Sentinel,
8020 } LDKRecentPaymentDetails_Tag;
8021
8022 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
8023    /**
8024     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8025     * a payment and ensure idempotency in LDK.
8026     */
8027    struct LDKThirtyTwoBytes payment_id;
8028 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
8029
8030 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
8031    /**
8032     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8033     * a payment and ensure idempotency in LDK.
8034     */
8035    struct LDKThirtyTwoBytes payment_id;
8036    /**
8037     * Hash of the payment that is currently being sent but has yet to be fulfilled or
8038     * abandoned.
8039     */
8040    struct LDKThirtyTwoBytes payment_hash;
8041    /**
8042     * Total amount (in msat, excluding fees) across all paths for this payment,
8043     * not just the amount currently inflight.
8044     */
8045    uint64_t total_msat;
8046 } LDKRecentPaymentDetails_LDKPending_Body;
8047
8048 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
8049    /**
8050     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8051     * a payment and ensure idempotency in LDK.
8052     */
8053    struct LDKThirtyTwoBytes payment_id;
8054    /**
8055     * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
8056     * made before LDK version 0.0.104.
8057     */
8058    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
8059 } LDKRecentPaymentDetails_LDKFulfilled_Body;
8060
8061 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
8062    /**
8063     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8064     * a payment and ensure idempotency in LDK.
8065     */
8066    struct LDKThirtyTwoBytes payment_id;
8067    /**
8068     * Hash of the payment that we have given up trying to send.
8069     */
8070    struct LDKThirtyTwoBytes payment_hash;
8071 } LDKRecentPaymentDetails_LDKAbandoned_Body;
8072
8073 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
8074    LDKRecentPaymentDetails_Tag tag;
8075    union {
8076       LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
8077       LDKRecentPaymentDetails_LDKPending_Body pending;
8078       LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
8079       LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
8080    };
8081 } LDKRecentPaymentDetails;
8082
8083 /**
8084  * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
8085  * This corresponds to std::vector in C++
8086  */
8087 typedef struct LDKCVec_RecentPaymentDetailsZ {
8088    /**
8089     * The elements in the array.
8090     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8091     */
8092    struct LDKRecentPaymentDetails *data;
8093    /**
8094     * The number of elements pointed to by `data`.
8095     */
8096    uintptr_t datalen;
8097 } LDKCVec_RecentPaymentDetailsZ;
8098
8099 /**
8100  * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
8101  * of several states. This enum is returned as the Err() type describing which state the payment
8102  * is in, see the description of individual enum states for more.
8103  *
8104  * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
8105  */
8106 typedef enum LDKPaymentSendFailure_Tag {
8107    /**
8108     * A parameter which was passed to send_payment was invalid, preventing us from attempting to
8109     * send the payment at all.
8110     *
8111     * You can freely resend the payment in full (with the parameter error fixed).
8112     *
8113     * Because the payment failed outright, no payment tracking is done and no
8114     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8115     *
8116     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8117     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8118     */
8119    LDKPaymentSendFailure_ParameterError,
8120    /**
8121     * A parameter in a single path which was passed to send_payment was invalid, preventing us
8122     * from attempting to send the payment at all.
8123     *
8124     * You can freely resend the payment in full (with the parameter error fixed).
8125     *
8126     * Because the payment failed outright, no payment tracking is done and no
8127     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8128     *
8129     * The results here are ordered the same as the paths in the route object which was passed to
8130     * send_payment.
8131     *
8132     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8133     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8134     */
8135    LDKPaymentSendFailure_PathParameterError,
8136    /**
8137     * All paths which were attempted failed to send, with no channel state change taking place.
8138     * You can freely resend the payment in full (though you probably want to do so over different
8139     * paths than the ones selected).
8140     *
8141     * Because the payment failed outright, no payment tracking is done and no
8142     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8143     *
8144     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8145     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8146     */
8147    LDKPaymentSendFailure_AllFailedResendSafe,
8148    /**
8149     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
8150     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
8151     *
8152     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
8153     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
8154     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8155     */
8156    LDKPaymentSendFailure_DuplicatePayment,
8157    /**
8158     * Some paths that were attempted failed to send, though some paths may have succeeded. At least
8159     * some paths have irrevocably committed to the HTLC.
8160     *
8161     * The results here are ordered the same as the paths in the route object that was passed to
8162     * send_payment.
8163     *
8164     * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
8165     * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
8166     *
8167     * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
8168     */
8169    LDKPaymentSendFailure_PartialFailure,
8170    /**
8171     * Must be last for serialization purposes
8172     */
8173    LDKPaymentSendFailure_Sentinel,
8174 } LDKPaymentSendFailure_Tag;
8175
8176 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
8177    /**
8178     * The errors themselves, in the same order as the paths from the route.
8179     */
8180    struct LDKCVec_CResult_NoneAPIErrorZZ results;
8181    /**
8182     * If some paths failed without irrevocably committing to the new HTLC(s), this will
8183     * contain a [`RouteParameters`] object for the failing paths.
8184     *
8185     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8186     */
8187    struct LDKRouteParameters failed_paths_retry;
8188    /**
8189     * The payment id for the payment, which is now at least partially pending.
8190     */
8191    struct LDKThirtyTwoBytes payment_id;
8192 } LDKPaymentSendFailure_LDKPartialFailure_Body;
8193
8194 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
8195    LDKPaymentSendFailure_Tag tag;
8196    union {
8197       struct {
8198          struct LDKAPIError parameter_error;
8199       };
8200       struct {
8201          struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
8202       };
8203       struct {
8204          struct LDKCVec_APIErrorZ all_failed_resend_safe;
8205       };
8206       LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
8207    };
8208 } LDKPaymentSendFailure;
8209
8210 /**
8211  * The contents of CResult_NonePaymentSendFailureZ
8212  */
8213 typedef union LDKCResult_NonePaymentSendFailureZPtr {
8214    /**
8215     * Note that this value is always NULL, as there are no contents in the OK variant
8216     */
8217    void *result;
8218    /**
8219     * A pointer to the contents in the error state.
8220     * Reading from this pointer when `result_ok` is set is undefined.
8221     */
8222    struct LDKPaymentSendFailure *err;
8223 } LDKCResult_NonePaymentSendFailureZPtr;
8224
8225 /**
8226  * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
8227  * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8228  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8229  */
8230 typedef struct LDKCResult_NonePaymentSendFailureZ {
8231    /**
8232     * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
8233     * `err` or `result` depending on the state of `result_ok`.
8234     */
8235    union LDKCResult_NonePaymentSendFailureZPtr contents;
8236    /**
8237     * Whether this CResult_NonePaymentSendFailureZ represents a success state.
8238     */
8239    bool result_ok;
8240 } LDKCResult_NonePaymentSendFailureZ;
8241
8242 /**
8243  * The contents of CResult_NoneRetryableSendFailureZ
8244  */
8245 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
8246    /**
8247     * Note that this value is always NULL, as there are no contents in the OK variant
8248     */
8249    void *result;
8250    /**
8251     * A pointer to the contents in the error state.
8252     * Reading from this pointer when `result_ok` is set is undefined.
8253     */
8254    enum LDKRetryableSendFailure *err;
8255 } LDKCResult_NoneRetryableSendFailureZPtr;
8256
8257 /**
8258  * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
8259  * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8260  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8261  */
8262 typedef struct LDKCResult_NoneRetryableSendFailureZ {
8263    /**
8264     * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
8265     * `err` or `result` depending on the state of `result_ok`.
8266     */
8267    union LDKCResult_NoneRetryableSendFailureZPtr contents;
8268    /**
8269     * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
8270     */
8271    bool result_ok;
8272 } LDKCResult_NoneRetryableSendFailureZ;
8273
8274 /**
8275  * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
8276  */
8277 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
8278    /**
8279     * A pointer to the contents in the success state.
8280     * Reading from this pointer when `result_ok` is not set is undefined.
8281     */
8282    struct LDKThirtyTwoBytes *result;
8283    /**
8284     * A pointer to the contents in the error state.
8285     * Reading from this pointer when `result_ok` is set is undefined.
8286     */
8287    struct LDKPaymentSendFailure *err;
8288 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
8289
8290 /**
8291  * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
8292  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8293  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8294  */
8295 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
8296    /**
8297     * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
8298     * `err` or `result` depending on the state of `result_ok`.
8299     */
8300    union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
8301    /**
8302     * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
8303     */
8304    bool result_ok;
8305 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
8306
8307 /**
8308  * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
8309  */
8310 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
8311    /**
8312     * A pointer to the contents in the success state.
8313     * Reading from this pointer when `result_ok` is not set is undefined.
8314     */
8315    struct LDKThirtyTwoBytes *result;
8316    /**
8317     * A pointer to the contents in the error state.
8318     * Reading from this pointer when `result_ok` is set is undefined.
8319     */
8320    enum LDKRetryableSendFailure *err;
8321 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
8322
8323 /**
8324  * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
8325  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8326  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8327  */
8328 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
8329    /**
8330     * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
8331     * `err` or `result` depending on the state of `result_ok`.
8332     */
8333    union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
8334    /**
8335     * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
8336     */
8337    bool result_ok;
8338 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
8339
8340 /**
8341  * A tuple of 2 elements. See the individual fields for the types contained.
8342  */
8343 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
8344    /**
8345     * The element at position 0
8346     */
8347    struct LDKThirtyTwoBytes a;
8348    /**
8349     * The element at position 1
8350     */
8351    struct LDKThirtyTwoBytes b;
8352 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
8353
8354 /**
8355  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
8356  */
8357 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
8358    /**
8359     * A pointer to the contents in the success state.
8360     * Reading from this pointer when `result_ok` is not set is undefined.
8361     */
8362    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8363    /**
8364     * A pointer to the contents in the error state.
8365     * Reading from this pointer when `result_ok` is set is undefined.
8366     */
8367    struct LDKPaymentSendFailure *err;
8368 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
8369
8370 /**
8371  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
8372  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8373  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8374  */
8375 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
8376    /**
8377     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
8378     * `err` or `result` depending on the state of `result_ok`.
8379     */
8380    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
8381    /**
8382     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
8383     */
8384    bool result_ok;
8385 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
8386
8387 /**
8388  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
8389  * This corresponds to std::vector in C++
8390  */
8391 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
8392    /**
8393     * The elements in the array.
8394     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8395     */
8396    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
8397    /**
8398     * The number of elements pointed to by `data`.
8399     */
8400    uintptr_t datalen;
8401 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
8402
8403 /**
8404  * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
8405  * [`Event::ProbeFailed`].
8406  *
8407  * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
8408  */
8409 typedef enum LDKProbeSendFailure_Tag {
8410    /**
8411     * We were unable to find a route to the destination.
8412     */
8413    LDKProbeSendFailure_RouteNotFound,
8414    /**
8415     * We failed to send the payment probes.
8416     */
8417    LDKProbeSendFailure_SendingFailed,
8418    /**
8419     * Must be last for serialization purposes
8420     */
8421    LDKProbeSendFailure_Sentinel,
8422 } LDKProbeSendFailure_Tag;
8423
8424 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
8425    LDKProbeSendFailure_Tag tag;
8426    union {
8427       struct {
8428          struct LDKPaymentSendFailure sending_failed;
8429       };
8430    };
8431 } LDKProbeSendFailure;
8432
8433 /**
8434  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
8435  */
8436 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
8437    /**
8438     * A pointer to the contents in the success state.
8439     * Reading from this pointer when `result_ok` is not set is undefined.
8440     */
8441    struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
8442    /**
8443     * A pointer to the contents in the error state.
8444     * Reading from this pointer when `result_ok` is set is undefined.
8445     */
8446    struct LDKProbeSendFailure *err;
8447 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
8448
8449 /**
8450  * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
8451  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
8452  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8453  */
8454 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
8455    /**
8456     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
8457     * `err` or `result` depending on the state of `result_ok`.
8458     */
8459    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
8460    /**
8461     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
8462     */
8463    bool result_ok;
8464 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
8465
8466 /**
8467  * A tuple of 2 elements. See the individual fields for the types contained.
8468  */
8469 typedef struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ {
8470    /**
8471     * The element at position 0
8472     */
8473    struct LDKThirtyTwoBytes a;
8474    /**
8475     * The element at position 1
8476     */
8477    struct LDKPublicKey b;
8478 } LDKC2Tuple_ThirtyTwoBytesPublicKeyZ;
8479
8480 /**
8481  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesPublicKeyZs of arbitrary size.
8482  * This corresponds to std::vector in C++
8483  */
8484 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ {
8485    /**
8486     * The elements in the array.
8487     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8488     */
8489    struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *data;
8490    /**
8491     * The number of elements pointed to by `data`.
8492     */
8493    uintptr_t datalen;
8494 } LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ;
8495
8496 /**
8497  * An enum which can either contain a crate::c_types::Str or not
8498  */
8499 typedef enum LDKCOption_StrZ_Tag {
8500    /**
8501     * When we're in this state, this COption_StrZ contains a crate::c_types::Str
8502     */
8503    LDKCOption_StrZ_Some,
8504    /**
8505     * When we're in this state, this COption_StrZ contains nothing
8506     */
8507    LDKCOption_StrZ_None,
8508    /**
8509     * Must be last for serialization purposes
8510     */
8511    LDKCOption_StrZ_Sentinel,
8512 } LDKCOption_StrZ_Tag;
8513
8514 typedef struct LDKCOption_StrZ {
8515    LDKCOption_StrZ_Tag tag;
8516    union {
8517       struct {
8518          struct LDKStr some;
8519       };
8520    };
8521 } LDKCOption_StrZ;
8522
8523 /**
8524  * The contents of CResult_NoneBolt12SemanticErrorZ
8525  */
8526 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
8527    /**
8528     * Note that this value is always NULL, as there are no contents in the OK variant
8529     */
8530    void *result;
8531    /**
8532     * A pointer to the contents in the error state.
8533     * Reading from this pointer when `result_ok` is set is undefined.
8534     */
8535    enum LDKBolt12SemanticError *err;
8536 } LDKCResult_NoneBolt12SemanticErrorZPtr;
8537
8538 /**
8539  * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
8540  * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
8541  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8542  */
8543 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
8544    /**
8545     * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
8546     * `err` or `result` depending on the state of `result_ok`.
8547     */
8548    union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
8549    /**
8550     * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
8551     */
8552    bool result_ok;
8553 } LDKCResult_NoneBolt12SemanticErrorZ;
8554
8555 /**
8556  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
8557  */
8558 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
8559    /**
8560     * A pointer to the contents in the success state.
8561     * Reading from this pointer when `result_ok` is not set is undefined.
8562     */
8563    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8564    /**
8565     * Note that this value is always NULL, as there are no contents in the Err variant
8566     */
8567    void *err;
8568 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
8569
8570 /**
8571  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
8572  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
8573  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8574  */
8575 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
8576    /**
8577     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
8578     * `err` or `result` depending on the state of `result_ok`.
8579     */
8580    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
8581    /**
8582     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
8583     */
8584    bool result_ok;
8585 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
8586
8587
8588
8589 /**
8590  * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
8591  *
8592  * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
8593  * specifies these such that its recipient can send an invoice for payment.
8594  *
8595  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
8596  * [`Offer`]: crate::offers::offer::Offer
8597  */
8598 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
8599    /**
8600     * A pointer to the opaque Rust object.
8601     * Nearly everywhere, inner must be non-null, however in places where
8602     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8603     */
8604    LDKnativeInvoiceRequest *inner;
8605    /**
8606     * Indicates that this is the only struct which contains the same pointer.
8607     * Rust functions which take ownership of an object provided via an argument require
8608     * this to be true and invalidate the object pointed to by inner.
8609     */
8610    bool is_owned;
8611 } LDKInvoiceRequest;
8612
8613
8614
8615 /**
8616  * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
8617  *
8618  * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
8619  * directly after scanning a refund. It includes all the information needed to pay a recipient.
8620  *
8621  * [`Offer`]: crate::offers::offer::Offer
8622  * [`Refund`]: crate::offers::refund::Refund
8623  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
8624  */
8625 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
8626    /**
8627     * A pointer to the opaque Rust object.
8628     * Nearly everywhere, inner must be non-null, however in places where
8629     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8630     */
8631    LDKnativeBolt12Invoice *inner;
8632    /**
8633     * Indicates that this is the only struct which contains the same pointer.
8634     * Rust functions which take ownership of an object provided via an argument require
8635     * this to be true and invalidate the object pointed to by inner.
8636     */
8637    bool is_owned;
8638 } LDKBolt12Invoice;
8639
8640
8641
8642 /**
8643  * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
8644  *
8645  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
8646  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
8647  */
8648 typedef struct MUST_USE_STRUCT LDKInvoiceError {
8649    /**
8650     * A pointer to the opaque Rust object.
8651     * Nearly everywhere, inner must be non-null, however in places where
8652     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8653     */
8654    LDKnativeInvoiceError *inner;
8655    /**
8656     * Indicates that this is the only struct which contains the same pointer.
8657     * Rust functions which take ownership of an object provided via an argument require
8658     * this to be true and invalidate the object pointed to by inner.
8659     */
8660    bool is_owned;
8661 } LDKInvoiceError;
8662
8663 /**
8664  * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
8665  *
8666  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
8667  */
8668 typedef enum LDKOffersMessage_Tag {
8669    /**
8670     * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
8671     *
8672     * [`Offer`]: crate::offers::offer::Offer
8673     */
8674    LDKOffersMessage_InvoiceRequest,
8675    /**
8676     * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
8677     *
8678     * [`Refund`]: crate::offers::refund::Refund
8679     */
8680    LDKOffersMessage_Invoice,
8681    /**
8682     * An error from handling an [`OffersMessage`].
8683     */
8684    LDKOffersMessage_InvoiceError,
8685    /**
8686     * Must be last for serialization purposes
8687     */
8688    LDKOffersMessage_Sentinel,
8689 } LDKOffersMessage_Tag;
8690
8691 typedef struct MUST_USE_STRUCT LDKOffersMessage {
8692    LDKOffersMessage_Tag tag;
8693    union {
8694       struct {
8695          struct LDKInvoiceRequest invoice_request;
8696       };
8697       struct {
8698          struct LDKBolt12Invoice invoice;
8699       };
8700       struct {
8701          struct LDKInvoiceError invoice_error;
8702       };
8703    };
8704 } LDKOffersMessage;
8705
8706 /**
8707  * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
8708  */
8709 typedef enum LDKCOption_OffersMessageZ_Tag {
8710    /**
8711     * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
8712     */
8713    LDKCOption_OffersMessageZ_Some,
8714    /**
8715     * When we're in this state, this COption_OffersMessageZ contains nothing
8716     */
8717    LDKCOption_OffersMessageZ_None,
8718    /**
8719     * Must be last for serialization purposes
8720     */
8721    LDKCOption_OffersMessageZ_Sentinel,
8722 } LDKCOption_OffersMessageZ_Tag;
8723
8724 typedef struct LDKCOption_OffersMessageZ {
8725    LDKCOption_OffersMessageZ_Tag tag;
8726    union {
8727       struct {
8728          struct LDKOffersMessage some;
8729       };
8730    };
8731 } LDKCOption_OffersMessageZ;
8732
8733 /**
8734  * The destination of an onion message.
8735  */
8736 typedef enum LDKDestination_Tag {
8737    /**
8738     * We're sending this onion message to a node.
8739     */
8740    LDKDestination_Node,
8741    /**
8742     * We're sending this onion message to a blinded path.
8743     */
8744    LDKDestination_BlindedPath,
8745    /**
8746     * Must be last for serialization purposes
8747     */
8748    LDKDestination_Sentinel,
8749 } LDKDestination_Tag;
8750
8751 typedef struct MUST_USE_STRUCT LDKDestination {
8752    LDKDestination_Tag tag;
8753    union {
8754       struct {
8755          struct LDKPublicKey node;
8756       };
8757       struct {
8758          struct LDKBlindedPath blinded_path;
8759       };
8760    };
8761 } LDKDestination;
8762
8763 /**
8764  * A tuple of 3 elements. See the individual fields for the types contained.
8765  */
8766 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
8767    /**
8768     * The element at position 0
8769     */
8770    struct LDKOffersMessage a;
8771    /**
8772     * The element at position 1
8773     */
8774    struct LDKDestination b;
8775    /**
8776     * The element at position 2
8777     */
8778    struct LDKBlindedPath c;
8779 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
8780
8781 /**
8782  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
8783  * This corresponds to std::vector in C++
8784  */
8785 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
8786    /**
8787     * The elements in the array.
8788     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8789     */
8790    struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
8791    /**
8792     * The number of elements pointed to by `data`.
8793     */
8794    uintptr_t datalen;
8795 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
8796
8797
8798
8799 /**
8800  * Information needed for constructing an invoice route hint for this channel.
8801  */
8802 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
8803    /**
8804     * A pointer to the opaque Rust object.
8805     * Nearly everywhere, inner must be non-null, however in places where
8806     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8807     */
8808    LDKnativeCounterpartyForwardingInfo *inner;
8809    /**
8810     * Indicates that this is the only struct which contains the same pointer.
8811     * Rust functions which take ownership of an object provided via an argument require
8812     * this to be true and invalidate the object pointed to by inner.
8813     */
8814    bool is_owned;
8815 } LDKCounterpartyForwardingInfo;
8816
8817 /**
8818  * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
8819  */
8820 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
8821    /**
8822     * A pointer to the contents in the success state.
8823     * Reading from this pointer when `result_ok` is not set is undefined.
8824     */
8825    struct LDKCounterpartyForwardingInfo *result;
8826    /**
8827     * A pointer to the contents in the error state.
8828     * Reading from this pointer when `result_ok` is set is undefined.
8829     */
8830    struct LDKDecodeError *err;
8831 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
8832
8833 /**
8834  * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
8835  * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8836  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8837  */
8838 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
8839    /**
8840     * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
8841     * `err` or `result` depending on the state of `result_ok`.
8842     */
8843    union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
8844    /**
8845     * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
8846     */
8847    bool result_ok;
8848 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
8849
8850
8851
8852 /**
8853  * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8854  * to better separate parameters.
8855  */
8856 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8857    /**
8858     * A pointer to the opaque Rust object.
8859     * Nearly everywhere, inner must be non-null, however in places where
8860     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8861     */
8862    LDKnativeChannelCounterparty *inner;
8863    /**
8864     * Indicates that this is the only struct which contains the same pointer.
8865     * Rust functions which take ownership of an object provided via an argument require
8866     * this to be true and invalidate the object pointed to by inner.
8867     */
8868    bool is_owned;
8869 } LDKChannelCounterparty;
8870
8871 /**
8872  * The contents of CResult_ChannelCounterpartyDecodeErrorZ
8873  */
8874 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
8875    /**
8876     * A pointer to the contents in the success state.
8877     * Reading from this pointer when `result_ok` is not set is undefined.
8878     */
8879    struct LDKChannelCounterparty *result;
8880    /**
8881     * A pointer to the contents in the error state.
8882     * Reading from this pointer when `result_ok` is set is undefined.
8883     */
8884    struct LDKDecodeError *err;
8885 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
8886
8887 /**
8888  * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
8889  * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
8890  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8891  */
8892 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
8893    /**
8894     * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
8895     * `err` or `result` depending on the state of `result_ok`.
8896     */
8897    union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
8898    /**
8899     * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
8900     */
8901    bool result_ok;
8902 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
8903
8904 /**
8905  * The contents of CResult_ChannelDetailsDecodeErrorZ
8906  */
8907 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
8908    /**
8909     * A pointer to the contents in the success state.
8910     * Reading from this pointer when `result_ok` is not set is undefined.
8911     */
8912    struct LDKChannelDetails *result;
8913    /**
8914     * A pointer to the contents in the error state.
8915     * Reading from this pointer when `result_ok` is set is undefined.
8916     */
8917    struct LDKDecodeError *err;
8918 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
8919
8920 /**
8921  * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
8922  * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
8923  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8924  */
8925 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
8926    /**
8927     * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
8928     * `err` or `result` depending on the state of `result_ok`.
8929     */
8930    union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
8931    /**
8932     * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
8933     */
8934    bool result_ok;
8935 } LDKCResult_ChannelDetailsDecodeErrorZ;
8936
8937
8938
8939 /**
8940  * Route hints used in constructing invoices for [phantom node payents].
8941  *
8942  * [phantom node payments]: crate::sign::PhantomKeysManager
8943  */
8944 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
8945    /**
8946     * A pointer to the opaque Rust object.
8947     * Nearly everywhere, inner must be non-null, however in places where
8948     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8949     */
8950    LDKnativePhantomRouteHints *inner;
8951    /**
8952     * Indicates that this is the only struct which contains the same pointer.
8953     * Rust functions which take ownership of an object provided via an argument require
8954     * this to be true and invalidate the object pointed to by inner.
8955     */
8956    bool is_owned;
8957 } LDKPhantomRouteHints;
8958
8959 /**
8960  * The contents of CResult_PhantomRouteHintsDecodeErrorZ
8961  */
8962 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
8963    /**
8964     * A pointer to the contents in the success state.
8965     * Reading from this pointer when `result_ok` is not set is undefined.
8966     */
8967    struct LDKPhantomRouteHints *result;
8968    /**
8969     * A pointer to the contents in the error state.
8970     * Reading from this pointer when `result_ok` is set is undefined.
8971     */
8972    struct LDKDecodeError *err;
8973 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
8974
8975 /**
8976  * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
8977  * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
8978  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8979  */
8980 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
8981    /**
8982     * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
8983     * `err` or `result` depending on the state of `result_ok`.
8984     */
8985    union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
8986    /**
8987     * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
8988     */
8989    bool result_ok;
8990 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
8991
8992 /**
8993  * The contents of CResult_ChannelShutdownStateDecodeErrorZ
8994  */
8995 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
8996    /**
8997     * A pointer to the contents in the success state.
8998     * Reading from this pointer when `result_ok` is not set is undefined.
8999     */
9000    enum LDKChannelShutdownState *result;
9001    /**
9002     * A pointer to the contents in the error state.
9003     * Reading from this pointer when `result_ok` is set is undefined.
9004     */
9005    struct LDKDecodeError *err;
9006 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
9007
9008 /**
9009  * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
9010  * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
9011  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9012  */
9013 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
9014    /**
9015     * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
9016     * `err` or `result` depending on the state of `result_ok`.
9017     */
9018    union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
9019    /**
9020     * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
9021     */
9022    bool result_ok;
9023 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
9024
9025
9026
9027 /**
9028  * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
9029  * on-chain transactions to ensure no loss of funds occurs.
9030  *
9031  * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
9032  * information and are actively monitoring the chain.
9033  *
9034  * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
9035  * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
9036  * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
9037  * returned block hash and the the current chain and then reconnecting blocks to get to the
9038  * best chain) upon deserializing the object!
9039  */
9040 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
9041    /**
9042     * A pointer to the opaque Rust object.
9043     * Nearly everywhere, inner must be non-null, however in places where
9044     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9045     */
9046    LDKnativeChannelMonitor *inner;
9047    /**
9048     * Indicates that this is the only struct which contains the same pointer.
9049     * Rust functions which take ownership of an object provided via an argument require
9050     * this to be true and invalidate the object pointed to by inner.
9051     */
9052    bool is_owned;
9053 } LDKChannelMonitor;
9054
9055 /**
9056  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
9057  * This corresponds to std::vector in C++
9058  */
9059 typedef struct LDKCVec_ChannelMonitorZ {
9060    /**
9061     * The elements in the array.
9062     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9063     */
9064    struct LDKChannelMonitor *data;
9065    /**
9066     * The number of elements pointed to by `data`.
9067     */
9068    uintptr_t datalen;
9069 } LDKCVec_ChannelMonitorZ;
9070
9071
9072
9073 /**
9074  * An update generated by the underlying channel itself which contains some new information the
9075  * [`ChannelMonitor`] should be made aware of.
9076  *
9077  * Because this represents only a small number of updates to the underlying state, it is generally
9078  * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
9079  * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
9080  * transaction), a single update may reach upwards of 1 MiB in serialized size.
9081  */
9082 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
9083    /**
9084     * A pointer to the opaque Rust object.
9085     * Nearly everywhere, inner must be non-null, however in places where
9086     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9087     */
9088    LDKnativeChannelMonitorUpdate *inner;
9089    /**
9090     * Indicates that this is the only struct which contains the same pointer.
9091     * Rust functions which take ownership of an object provided via an argument require
9092     * this to be true and invalidate the object pointed to by inner.
9093     */
9094    bool is_owned;
9095 } LDKChannelMonitorUpdate;
9096
9097 /**
9098  * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
9099  * blocks are connected and disconnected.
9100  *
9101  * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
9102  * responsible for maintaining a set of monitors such that they can be updated as channel state
9103  * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
9104  * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
9105  * application crashes.
9106  *
9107  * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
9108  */
9109 typedef struct LDKWatch {
9110    /**
9111     * An opaque pointer which is passed to your function implementations as an argument.
9112     * This has no meaning in the LDK, and can be NULL or any other value.
9113     */
9114    void *this_arg;
9115    /**
9116     * Watches a channel identified by `funding_txo` using `monitor`.
9117     *
9118     * Implementations are responsible for watching the chain for the funding transaction along
9119     * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
9120     * calling [`block_connected`] and [`block_disconnected`] on the monitor.
9121     *
9122     * A return of `Err(())` indicates that the channel should immediately be force-closed without
9123     * broadcasting the funding transaction.
9124     *
9125     * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
9126     * must be returned.
9127     *
9128     * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
9129     * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
9130     * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
9131     */
9132    struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
9133    /**
9134     * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
9135     *
9136     * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
9137     * may fail (returning an `Err(())`), in which case this should return
9138     * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
9139     * generally implies the channel has been closed (either by the funding outpoint being spent
9140     * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
9141     * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
9142     *
9143     * In general, persistence failures should be retried after returning
9144     * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
9145     * cannot be retried, the node should shut down immediately after returning
9146     * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
9147     *
9148     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
9149     */
9150    enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
9151    /**
9152     * Returns any monitor events since the last call. Subsequent calls must only return new
9153     * events.
9154     *
9155     * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
9156     * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
9157     * to disk.
9158     *
9159     * For details on asynchronous [`ChannelMonitor`] updating and returning
9160     * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
9161     */
9162    struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
9163    /**
9164     * Frees any resources associated with this object given its this_arg pointer.
9165     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9166     */
9167    void (*free)(void *this_arg);
9168 } LDKWatch;
9169
9170 /**
9171  * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
9172  * This corresponds to std::vector in C++
9173  */
9174 typedef struct LDKCVec_TransactionZ {
9175    /**
9176     * The elements in the array.
9177     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9178     */
9179    struct LDKTransaction *data;
9180    /**
9181     * The number of elements pointed to by `data`.
9182     */
9183    uintptr_t datalen;
9184 } LDKCVec_TransactionZ;
9185
9186 /**
9187  * An interface to send a transaction to the Bitcoin network.
9188  */
9189 typedef struct LDKBroadcasterInterface {
9190    /**
9191     * An opaque pointer which is passed to your function implementations as an argument.
9192     * This has no meaning in the LDK, and can be NULL or any other value.
9193     */
9194    void *this_arg;
9195    /**
9196     * Sends a list of transactions out to (hopefully) be mined.
9197     * This only needs to handle the actual broadcasting of transactions, LDK will automatically
9198     * rebroadcast transactions that haven't made it into a block.
9199     *
9200     * In some cases LDK may attempt to broadcast a transaction which double-spends another
9201     * and this isn't a bug and can be safely ignored.
9202     *
9203     * If more than one transaction is given, these transactions should be considered to be a
9204     * package and broadcast together. Some of the transactions may or may not depend on each other,
9205     * be sure to manage both cases correctly.
9206     *
9207     * Bitcoin transaction packages are defined in BIP 331 and here:
9208     * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md
9209     */
9210    void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
9211    /**
9212     * Frees any resources associated with this object given its this_arg pointer.
9213     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9214     */
9215    void (*free)(void *this_arg);
9216 } LDKBroadcasterInterface;
9217
9218 /**
9219  * A trait that describes a source of entropy.
9220  */
9221 typedef struct LDKEntropySource {
9222    /**
9223     * An opaque pointer which is passed to your function implementations as an argument.
9224     * This has no meaning in the LDK, and can be NULL or any other value.
9225     */
9226    void *this_arg;
9227    /**
9228     * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
9229     * different value each time it is called.
9230     */
9231    struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
9232    /**
9233     * Frees any resources associated with this object given its this_arg pointer.
9234     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9235     */
9236    void (*free)(void *this_arg);
9237 } LDKEntropySource;
9238
9239 /**
9240  * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
9241  * own the memory pointed to by data.
9242  */
9243 typedef struct LDKu8slice {
9244    /**
9245     * A pointer to the byte buffer
9246     */
9247    const uint8_t *data;
9248    /**
9249     * The number of bytes pointed to by `data`.
9250     */
9251    uintptr_t datalen;
9252 } LDKu8slice;
9253
9254
9255
9256 /**
9257  * A semantically valid [`InvoiceRequest`] that hasn't been signed.
9258  *
9259  * # Serialization
9260  *
9261  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
9262  * such, it may include unknown, odd TLV records.
9263  */
9264 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
9265    /**
9266     * A pointer to the opaque Rust object.
9267     * Nearly everywhere, inner must be non-null, however in places where
9268     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9269     */
9270    LDKnativeUnsignedInvoiceRequest *inner;
9271    /**
9272     * Indicates that this is the only struct which contains the same pointer.
9273     * Rust functions which take ownership of an object provided via an argument require
9274     * this to be true and invalidate the object pointed to by inner.
9275     */
9276    bool is_owned;
9277 } LDKUnsignedInvoiceRequest;
9278
9279
9280
9281 /**
9282  * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
9283  *
9284  * # Serialization
9285  *
9286  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
9287  * such, it may include unknown, odd TLV records.
9288  */
9289 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
9290    /**
9291     * A pointer to the opaque Rust object.
9292     * Nearly everywhere, inner must be non-null, however in places where
9293     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9294     */
9295    LDKnativeUnsignedBolt12Invoice *inner;
9296    /**
9297     * Indicates that this is the only struct which contains the same pointer.
9298     * Rust functions which take ownership of an object provided via an argument require
9299     * this to be true and invalidate the object pointed to by inner.
9300     */
9301    bool is_owned;
9302 } LDKUnsignedBolt12Invoice;
9303
9304
9305
9306 /**
9307  * The unsigned part of a [`channel_update`] message.
9308  *
9309  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
9310  */
9311 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
9312    /**
9313     * A pointer to the opaque Rust object.
9314     * Nearly everywhere, inner must be non-null, however in places where
9315     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9316     */
9317    LDKnativeUnsignedChannelUpdate *inner;
9318    /**
9319     * Indicates that this is the only struct which contains the same pointer.
9320     * Rust functions which take ownership of an object provided via an argument require
9321     * this to be true and invalidate the object pointed to by inner.
9322     */
9323    bool is_owned;
9324 } LDKUnsignedChannelUpdate;
9325
9326
9327
9328 /**
9329  * The unsigned part of a [`node_announcement`] message.
9330  *
9331  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
9332  */
9333 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
9334    /**
9335     * A pointer to the opaque Rust object.
9336     * Nearly everywhere, inner must be non-null, however in places where
9337     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9338     */
9339    LDKnativeUnsignedNodeAnnouncement *inner;
9340    /**
9341     * Indicates that this is the only struct which contains the same pointer.
9342     * Rust functions which take ownership of an object provided via an argument require
9343     * this to be true and invalidate the object pointed to by inner.
9344     */
9345    bool is_owned;
9346 } LDKUnsignedNodeAnnouncement;
9347
9348 /**
9349  * Represents the set of gossip messages that require a signature from a node's identity key.
9350  */
9351 typedef enum LDKUnsignedGossipMessage_Tag {
9352    /**
9353     * An unsigned channel announcement.
9354     */
9355    LDKUnsignedGossipMessage_ChannelAnnouncement,
9356    /**
9357     * An unsigned channel update.
9358     */
9359    LDKUnsignedGossipMessage_ChannelUpdate,
9360    /**
9361     * An unsigned node announcement.
9362     */
9363    LDKUnsignedGossipMessage_NodeAnnouncement,
9364    /**
9365     * Must be last for serialization purposes
9366     */
9367    LDKUnsignedGossipMessage_Sentinel,
9368 } LDKUnsignedGossipMessage_Tag;
9369
9370 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
9371    LDKUnsignedGossipMessage_Tag tag;
9372    union {
9373       struct {
9374          struct LDKUnsignedChannelAnnouncement channel_announcement;
9375       };
9376       struct {
9377          struct LDKUnsignedChannelUpdate channel_update;
9378       };
9379       struct {
9380          struct LDKUnsignedNodeAnnouncement node_announcement;
9381       };
9382    };
9383 } LDKUnsignedGossipMessage;
9384
9385 /**
9386  * A trait that can handle cryptographic operations at the scope level of a node.
9387  */
9388 typedef struct LDKNodeSigner {
9389    /**
9390     * An opaque pointer which is passed to your function implementations as an argument.
9391     * This has no meaning in the LDK, and can be NULL or any other value.
9392     */
9393    void *this_arg;
9394    /**
9395     * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
9396     *
9397     * If the implementor of this trait supports [phantom node payments], then every node that is
9398     * intended to be included in the phantom invoice route hints must return the same value from
9399     * this method.
9400     *
9401     * This method must return the same value each time it is called.
9402     *
9403     * [phantom node payments]: PhantomKeysManager
9404     */
9405    struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
9406    /**
9407     * Get node id based on the provided [`Recipient`].
9408     *
9409     * This method must return the same value each time it is called with a given [`Recipient`]
9410     * parameter.
9411     *
9412     * Errors if the [`Recipient`] variant is not supported by the implementation.
9413     */
9414    struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
9415    /**
9416     * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
9417     * one is provided. Note that this tweak can be applied to `other_key` instead of our node
9418     * secret, though this is less efficient.
9419     *
9420     * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
9421     * should be resolved to allow LDK to resume forwarding HTLCs.
9422     *
9423     * Errors if the [`Recipient`] variant is not supported by the implementation.
9424     */
9425    struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
9426    /**
9427     * Sign an invoice.
9428     *
9429     * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
9430     * this trait to parse the invoice and make sure they're signing what they expect, rather than
9431     * blindly signing the hash.
9432     *
9433     * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
9434     *
9435     * The secret key used to sign the invoice is dependent on the [`Recipient`].
9436     *
9437     * Errors if the [`Recipient`] variant is not supported by the implementation.
9438     */
9439    struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
9440    /**
9441     * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
9442     *
9443     * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
9444     * `invoice_request` is the callee.
9445     *
9446     * Implementors may check that the `invoice_request` is expected rather than blindly signing
9447     * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
9448     * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
9449     * [`UnsignedInvoiceRequest::payer_id`].
9450     *
9451     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
9452     */
9453    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
9454    /**
9455     * Signs the [`TaggedHash`] of a BOLT 12 invoice.
9456     *
9457     * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
9458     * callee.
9459     *
9460     * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
9461     * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
9462     * key or an ephemeral key to preserve privacy, whichever is associated with
9463     * [`UnsignedBolt12Invoice::signing_pubkey`].
9464     *
9465     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
9466     */
9467    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
9468    /**
9469     * Sign a gossip message.
9470     *
9471     * Note that if this fails, LDK may panic and the message will not be broadcast to the network
9472     * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
9473     * message to be broadcast, as otherwise it may prevent one from receiving funds over the
9474     * corresponding channel.
9475     */
9476    struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
9477    /**
9478     * Frees any resources associated with this object given its this_arg pointer.
9479     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9480     */
9481    void (*free)(void *this_arg);
9482 } LDKNodeSigner;
9483
9484 /**
9485  * A trait that can return signer instances for individual channels.
9486  */
9487 typedef struct LDKSignerProvider {
9488    /**
9489     * An opaque pointer which is passed to your function implementations as an argument.
9490     * This has no meaning in the LDK, and can be NULL or any other value.
9491     */
9492    void *this_arg;
9493    /**
9494     * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through
9495     * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
9496     * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
9497     * `channel_keys_id`.
9498     *
9499     * This method must return a different value each time it is called.
9500     */
9501    struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
9502    /**
9503     * Derives the private key material backing a `Signer`.
9504     *
9505     * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
9506     * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
9507     * re-derived from its `channel_keys_id`, which can be obtained through its trait method
9508     * [`ChannelSigner::channel_keys_id`].
9509     */
9510    struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
9511    /**
9512     * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
9513     * This is only called during deserialization of other objects which contain
9514     * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
9515     * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
9516     * contain no versioning scheme. You may wish to include your own version prefix and ensure
9517     * you've read all of the provided bytes to ensure no corruption occurred.
9518     *
9519     * This method is slowly being phased out -- it will only be called when reading objects
9520     * written by LDK versions prior to 0.0.113.
9521     *
9522     * [`Signer`]: Self::Signer
9523     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
9524     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
9525     */
9526    struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
9527    /**
9528     * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
9529     *
9530     * If this function returns an error, this will result in a channel failing to open.
9531     *
9532     * This method should return a different value each time it is called, to avoid linking
9533     * on-chain funds across channels as controlled to the same user.
9534     */
9535    struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg);
9536    /**
9537     * Get a script pubkey which we will send funds to when closing a channel.
9538     *
9539     * If this function returns an error, this will result in a channel failing to open or close.
9540     * In the event of a failure when the counterparty is initiating a close, this can result in a
9541     * channel force close.
9542     *
9543     * This method should return a different value each time it is called, to avoid linking
9544     * on-chain funds across channels as controlled to the same user.
9545     */
9546    struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
9547    /**
9548     * Frees any resources associated with this object given its this_arg pointer.
9549     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9550     */
9551    void (*free)(void *this_arg);
9552 } LDKSignerProvider;
9553
9554 /**
9555  * A trait which should be implemented to provide feerate information on a number of time
9556  * horizons.
9557  *
9558  * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
9559  * third-parties hosting them. Note that this enables them to affect the propagation of your
9560  * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
9561  * should be considered carefully as a deployment.
9562  *
9563  * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
9564  * called from inside the library in response to chain events, P2P events, or timer events).
9565  */
9566 typedef struct LDKFeeEstimator {
9567    /**
9568     * An opaque pointer which is passed to your function implementations as an argument.
9569     * This has no meaning in the LDK, and can be NULL or any other value.
9570     */
9571    void *this_arg;
9572    /**
9573     * Gets estimated satoshis of fee required per 1000 Weight-Units.
9574     *
9575     * LDK will wrap this method and ensure that the value returned is no smaller than 253
9576     * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
9577     *
9578     * The following unit conversions can be used to convert to sats/KW:
9579     *  * satoshis-per-byte * 250
9580     *  * satoshis-per-kbyte / 4
9581     */
9582    uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
9583    /**
9584     * Frees any resources associated with this object given its this_arg pointer.
9585     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9586     */
9587    void (*free)(void *this_arg);
9588 } LDKFeeEstimator;
9589
9590 /**
9591  * A trait defining behavior for routing a payment.
9592  */
9593 typedef struct LDKRouter {
9594    /**
9595     * An opaque pointer which is passed to your function implementations as an argument.
9596     * This has no meaning in the LDK, and can be NULL or any other value.
9597     */
9598    void *this_arg;
9599    /**
9600     * Finds a [`Route`] for a payment between the given `payer` and a payee.
9601     *
9602     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
9603     * and [`RouteParameters::final_value_msat`], respectively.
9604     *
9605     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9606     */
9607    struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs);
9608    /**
9609     * Finds a [`Route`] for a payment between the given `payer` and a payee.
9610     *
9611     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
9612     * and [`RouteParameters::final_value_msat`], respectively.
9613     *
9614     * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
9615     * payment.
9616     *
9617     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9618     */
9619    struct LDKCResult_RouteLightningErrorZ (*find_route_with_id)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id);
9620    /**
9621     * Frees any resources associated with this object given its this_arg pointer.
9622     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9623     */
9624    void (*free)(void *this_arg);
9625 } LDKRouter;
9626
9627
9628
9629 /**
9630  * Manager which keeps track of a number of channels and sends messages to the appropriate
9631  * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
9632  *
9633  * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
9634  * to individual Channels.
9635  *
9636  * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
9637  * all peers during write/read (though does not modify this instance, only the instance being
9638  * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
9639  * called [`funding_transaction_generated`] for outbound channels) being closed.
9640  *
9641  * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
9642  * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
9643  * [`ChannelMonitorUpdate`] before returning from
9644  * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
9645  * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
9646  * `ChannelManager` operations from occurring during the serialization process). If the
9647  * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
9648  * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
9649  * will be lost (modulo on-chain transaction fees).
9650  *
9651  * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
9652  * tells you the last block hash which was connected. You should get the best block tip before using the manager.
9653  * See [`chain::Listen`] and [`chain::Confirm`] for more details.
9654  *
9655  * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
9656  * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
9657  * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
9658  * offline for a full minute. In order to track this, you must call
9659  * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
9660  *
9661  * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
9662  * inbound channels without confirmed funding transactions. This may result in nodes which we do
9663  * not have a channel with being unable to connect to us or open new channels with us if we have
9664  * many peers with unfunded channels.
9665  *
9666  * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
9667  * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
9668  * never limited. Please ensure you limit the count of such channels yourself.
9669  *
9670  * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
9671  * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
9672  * essentially you should default to using a [`SimpleRefChannelManager`], and use a
9673  * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
9674  * you're using lightning-net-tokio.
9675  *
9676  * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
9677  * [`funding_created`]: msgs::FundingCreated
9678  * [`funding_transaction_generated`]: Self::funding_transaction_generated
9679  * [`BlockHash`]: bitcoin::hash_types::BlockHash
9680  * [`update_channel`]: chain::Watch::update_channel
9681  * [`ChannelUpdate`]: msgs::ChannelUpdate
9682  * [`timer_tick_occurred`]: Self::timer_tick_occurred
9683  * [`read`]: ReadableArgs::read
9684  */
9685 typedef struct MUST_USE_STRUCT LDKChannelManager {
9686    /**
9687     * A pointer to the opaque Rust object.
9688     * Nearly everywhere, inner must be non-null, however in places where
9689     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9690     */
9691    LDKnativeChannelManager *inner;
9692    /**
9693     * Indicates that this is the only struct which contains the same pointer.
9694     * Rust functions which take ownership of an object provided via an argument require
9695     * this to be true and invalidate the object pointed to by inner.
9696     */
9697    bool is_owned;
9698 } LDKChannelManager;
9699
9700 /**
9701  * A tuple of 2 elements. See the individual fields for the types contained.
9702  */
9703 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
9704    /**
9705     * The element at position 0
9706     */
9707    struct LDKThirtyTwoBytes a;
9708    /**
9709     * The element at position 1
9710     */
9711    struct LDKChannelManager b;
9712 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
9713
9714 /**
9715  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
9716  */
9717 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
9718    /**
9719     * A pointer to the contents in the success state.
9720     * Reading from this pointer when `result_ok` is not set is undefined.
9721     */
9722    struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
9723    /**
9724     * A pointer to the contents in the error state.
9725     * Reading from this pointer when `result_ok` is set is undefined.
9726     */
9727    struct LDKDecodeError *err;
9728 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
9729
9730 /**
9731  * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
9732  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9733  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9734  */
9735 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
9736    /**
9737     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
9738     * `err` or `result` depending on the state of `result_ok`.
9739     */
9740    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
9741    /**
9742     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
9743     */
9744    bool result_ok;
9745 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
9746
9747 /**
9748  * Options for how to set the max dust HTLC exposure allowed on a channel. See
9749  * [`ChannelConfig::max_dust_htlc_exposure`] for details.
9750  */
9751 typedef enum LDKMaxDustHTLCExposure_Tag {
9752    /**
9753     * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
9754     * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
9755     * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
9756     * through [fee griefing
9757     * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
9758     *
9759     * Note that if the feerate increases significantly, without a manual increase
9760     * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
9761     * exposure and the new minimum value for HTLCs to be economically viable to claim.
9762     */
9763    LDKMaxDustHTLCExposure_FixedLimitMsat,
9764    /**
9765     * This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from
9766     * [`FeeEstimator`]) to determine the maximum allowed dust exposure. If this variant is used
9767     * then the maximum dust exposure in millisatoshis is calculated as:
9768     * `high_priority_feerate_per_kw * value`. For example, with our default value
9769     * `FeeRateMultiplier(5000)`:
9770     *
9771     * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
9772     * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
9773     * be 253 * 5000 = 1,265,000 msats.
9774     * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
9775     * 7500 * 5000 = 37,500,000 msats.
9776     *
9777     * This allows the maximum dust exposure to automatically scale with fee rate changes.
9778     *
9779     * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
9780     * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
9781     * causing you to accept more dust HTLCs than you would otherwise.
9782     *
9783     * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
9784     * on HTLC outputs means your channel may be subject to more dust exposure in the event of
9785     * increases in fee rate.
9786     *
9787     * # Backwards Compatibility
9788     * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
9789     * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
9790     *
9791     * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
9792     */
9793    LDKMaxDustHTLCExposure_FeeRateMultiplier,
9794    /**
9795     * Must be last for serialization purposes
9796     */
9797    LDKMaxDustHTLCExposure_Sentinel,
9798 } LDKMaxDustHTLCExposure_Tag;
9799
9800 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
9801    LDKMaxDustHTLCExposure_Tag tag;
9802    union {
9803       struct {
9804          uint64_t fixed_limit_msat;
9805       };
9806       struct {
9807          uint64_t fee_rate_multiplier;
9808       };
9809    };
9810 } LDKMaxDustHTLCExposure;
9811
9812 /**
9813  * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
9814  */
9815 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
9816    /**
9817     * A pointer to the contents in the success state.
9818     * Reading from this pointer when `result_ok` is not set is undefined.
9819     */
9820    struct LDKMaxDustHTLCExposure *result;
9821    /**
9822     * A pointer to the contents in the error state.
9823     * Reading from this pointer when `result_ok` is set is undefined.
9824     */
9825    struct LDKDecodeError *err;
9826 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
9827
9828 /**
9829  * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
9830  * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
9831  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9832  */
9833 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
9834    /**
9835     * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
9836     * `err` or `result` depending on the state of `result_ok`.
9837     */
9838    union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
9839    /**
9840     * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
9841     */
9842    bool result_ok;
9843 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
9844
9845
9846
9847 /**
9848  * Options which apply on a per-channel basis and may change at runtime or based on negotiation
9849  * with our counterparty.
9850  */
9851 typedef struct MUST_USE_STRUCT LDKChannelConfig {
9852    /**
9853     * A pointer to the opaque Rust object.
9854     * Nearly everywhere, inner must be non-null, however in places where
9855     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9856     */
9857    LDKnativeChannelConfig *inner;
9858    /**
9859     * Indicates that this is the only struct which contains the same pointer.
9860     * Rust functions which take ownership of an object provided via an argument require
9861     * this to be true and invalidate the object pointed to by inner.
9862     */
9863    bool is_owned;
9864 } LDKChannelConfig;
9865
9866 /**
9867  * The contents of CResult_ChannelConfigDecodeErrorZ
9868  */
9869 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
9870    /**
9871     * A pointer to the contents in the success state.
9872     * Reading from this pointer when `result_ok` is not set is undefined.
9873     */
9874    struct LDKChannelConfig *result;
9875    /**
9876     * A pointer to the contents in the error state.
9877     * Reading from this pointer when `result_ok` is set is undefined.
9878     */
9879    struct LDKDecodeError *err;
9880 } LDKCResult_ChannelConfigDecodeErrorZPtr;
9881
9882 /**
9883  * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
9884  * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
9885  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9886  */
9887 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
9888    /**
9889     * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
9890     * `err` or `result` depending on the state of `result_ok`.
9891     */
9892    union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
9893    /**
9894     * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
9895     */
9896    bool result_ok;
9897 } LDKCResult_ChannelConfigDecodeErrorZ;
9898
9899 /**
9900  * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
9901  */
9902 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
9903    /**
9904     * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
9905     */
9906    LDKCOption_MaxDustHTLCExposureZ_Some,
9907    /**
9908     * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
9909     */
9910    LDKCOption_MaxDustHTLCExposureZ_None,
9911    /**
9912     * Must be last for serialization purposes
9913     */
9914    LDKCOption_MaxDustHTLCExposureZ_Sentinel,
9915 } LDKCOption_MaxDustHTLCExposureZ_Tag;
9916
9917 typedef struct LDKCOption_MaxDustHTLCExposureZ {
9918    LDKCOption_MaxDustHTLCExposureZ_Tag tag;
9919    union {
9920       struct {
9921          struct LDKMaxDustHTLCExposure some;
9922       };
9923    };
9924 } LDKCOption_MaxDustHTLCExposureZ;
9925
9926 /**
9927  * An enum which can either contain a crate::lightning::util::errors::APIError or not
9928  */
9929 typedef enum LDKCOption_APIErrorZ_Tag {
9930    /**
9931     * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
9932     */
9933    LDKCOption_APIErrorZ_Some,
9934    /**
9935     * When we're in this state, this COption_APIErrorZ contains nothing
9936     */
9937    LDKCOption_APIErrorZ_None,
9938    /**
9939     * Must be last for serialization purposes
9940     */
9941    LDKCOption_APIErrorZ_Sentinel,
9942 } LDKCOption_APIErrorZ_Tag;
9943
9944 typedef struct LDKCOption_APIErrorZ {
9945    LDKCOption_APIErrorZ_Tag tag;
9946    union {
9947       struct {
9948          struct LDKAPIError some;
9949       };
9950    };
9951 } LDKCOption_APIErrorZ;
9952
9953 /**
9954  * The contents of CResult_COption_APIErrorZDecodeErrorZ
9955  */
9956 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
9957    /**
9958     * A pointer to the contents in the success state.
9959     * Reading from this pointer when `result_ok` is not set is undefined.
9960     */
9961    struct LDKCOption_APIErrorZ *result;
9962    /**
9963     * A pointer to the contents in the error state.
9964     * Reading from this pointer when `result_ok` is set is undefined.
9965     */
9966    struct LDKDecodeError *err;
9967 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
9968
9969 /**
9970  * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
9971  * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9972  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9973  */
9974 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
9975    /**
9976     * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
9977     * `err` or `result` depending on the state of `result_ok`.
9978     */
9979    union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
9980    /**
9981     * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
9982     */
9983    bool result_ok;
9984 } LDKCResult_COption_APIErrorZDecodeErrorZ;
9985
9986 /**
9987  * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9988  */
9989 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9990    /**
9991     * A pointer to the contents in the success state.
9992     * Reading from this pointer when `result_ok` is not set is undefined.
9993     */
9994    struct LDKChannelMonitorUpdate *result;
9995    /**
9996     * A pointer to the contents in the error state.
9997     * Reading from this pointer when `result_ok` is set is undefined.
9998     */
9999    struct LDKDecodeError *err;
10000 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
10001
10002 /**
10003  * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
10004  * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10005  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10006  */
10007 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
10008    /**
10009     * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
10010     * `err` or `result` depending on the state of `result_ok`.
10011     */
10012    union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
10013    /**
10014     * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
10015     */
10016    bool result_ok;
10017 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
10018
10019 /**
10020  * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
10021  */
10022 typedef enum LDKCOption_MonitorEventZ_Tag {
10023    /**
10024     * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
10025     */
10026    LDKCOption_MonitorEventZ_Some,
10027    /**
10028     * When we're in this state, this COption_MonitorEventZ contains nothing
10029     */
10030    LDKCOption_MonitorEventZ_None,
10031    /**
10032     * Must be last for serialization purposes
10033     */
10034    LDKCOption_MonitorEventZ_Sentinel,
10035 } LDKCOption_MonitorEventZ_Tag;
10036
10037 typedef struct LDKCOption_MonitorEventZ {
10038    LDKCOption_MonitorEventZ_Tag tag;
10039    union {
10040       struct {
10041          struct LDKMonitorEvent some;
10042       };
10043    };
10044 } LDKCOption_MonitorEventZ;
10045
10046 /**
10047  * The contents of CResult_COption_MonitorEventZDecodeErrorZ
10048  */
10049 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
10050    /**
10051     * A pointer to the contents in the success state.
10052     * Reading from this pointer when `result_ok` is not set is undefined.
10053     */
10054    struct LDKCOption_MonitorEventZ *result;
10055    /**
10056     * A pointer to the contents in the error state.
10057     * Reading from this pointer when `result_ok` is set is undefined.
10058     */
10059    struct LDKDecodeError *err;
10060 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
10061
10062 /**
10063  * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
10064  * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10065  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10066  */
10067 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
10068    /**
10069     * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
10070     * `err` or `result` depending on the state of `result_ok`.
10071     */
10072    union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
10073    /**
10074     * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
10075     */
10076    bool result_ok;
10077 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
10078
10079 /**
10080  * The contents of CResult_HTLCUpdateDecodeErrorZ
10081  */
10082 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
10083    /**
10084     * A pointer to the contents in the success state.
10085     * Reading from this pointer when `result_ok` is not set is undefined.
10086     */
10087    struct LDKHTLCUpdate *result;
10088    /**
10089     * A pointer to the contents in the error state.
10090     * Reading from this pointer when `result_ok` is set is undefined.
10091     */
10092    struct LDKDecodeError *err;
10093 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
10094
10095 /**
10096  * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
10097  * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10098  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10099  */
10100 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
10101    /**
10102     * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
10103     * `err` or `result` depending on the state of `result_ok`.
10104     */
10105    union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
10106    /**
10107     * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
10108     */
10109    bool result_ok;
10110 } LDKCResult_HTLCUpdateDecodeErrorZ;
10111
10112 /**
10113  * A tuple of 2 elements. See the individual fields for the types contained.
10114  */
10115 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
10116    /**
10117     * The element at position 0
10118     */
10119    struct LDKOutPoint a;
10120    /**
10121     * The element at position 1
10122     */
10123    struct LDKCVec_u8Z b;
10124 } LDKC2Tuple_OutPointCVec_u8ZZ;
10125
10126 /**
10127  * A tuple of 2 elements. See the individual fields for the types contained.
10128  */
10129 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
10130    /**
10131     * The element at position 0
10132     */
10133    uint32_t a;
10134    /**
10135     * The element at position 1
10136     */
10137    struct LDKCVec_u8Z b;
10138 } LDKC2Tuple_u32CVec_u8ZZ;
10139
10140 /**
10141  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
10142  * This corresponds to std::vector in C++
10143  */
10144 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
10145    /**
10146     * The elements in the array.
10147     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10148     */
10149    struct LDKC2Tuple_u32CVec_u8ZZ *data;
10150    /**
10151     * The number of elements pointed to by `data`.
10152     */
10153    uintptr_t datalen;
10154 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
10155
10156 /**
10157  * A tuple of 2 elements. See the individual fields for the types contained.
10158  */
10159 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
10160    /**
10161     * The element at position 0
10162     */
10163    struct LDKThirtyTwoBytes a;
10164    /**
10165     * The element at position 1
10166     */
10167    struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
10168 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
10169
10170 /**
10171  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
10172  * This corresponds to std::vector in C++
10173  */
10174 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
10175    /**
10176     * The elements in the array.
10177     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10178     */
10179    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
10180    /**
10181     * The number of elements pointed to by `data`.
10182     */
10183    uintptr_t datalen;
10184 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
10185
10186 /**
10187  * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
10188  * This corresponds to std::vector in C++
10189  */
10190 typedef struct LDKCVec_CommitmentTransactionZ {
10191    /**
10192     * The elements in the array.
10193     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10194     */
10195    struct LDKCommitmentTransaction *data;
10196    /**
10197     * The number of elements pointed to by `data`.
10198     */
10199    uintptr_t datalen;
10200 } LDKCVec_CommitmentTransactionZ;
10201
10202 /**
10203  * A tuple of 2 elements. See the individual fields for the types contained.
10204  */
10205 typedef struct LDKC2Tuple_u32TxOutZ {
10206    /**
10207     * The element at position 0
10208     */
10209    uint32_t a;
10210    /**
10211     * The element at position 1
10212     */
10213    struct LDKTxOut b;
10214 } LDKC2Tuple_u32TxOutZ;
10215
10216 /**
10217  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
10218  * This corresponds to std::vector in C++
10219  */
10220 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
10221    /**
10222     * The elements in the array.
10223     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10224     */
10225    struct LDKC2Tuple_u32TxOutZ *data;
10226    /**
10227     * The number of elements pointed to by `data`.
10228     */
10229    uintptr_t datalen;
10230 } LDKCVec_C2Tuple_u32TxOutZZ;
10231
10232 /**
10233  * A tuple of 2 elements. See the individual fields for the types contained.
10234  */
10235 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
10236    /**
10237     * The element at position 0
10238     */
10239    struct LDKThirtyTwoBytes a;
10240    /**
10241     * The element at position 1
10242     */
10243    struct LDKCVec_C2Tuple_u32TxOutZZ b;
10244 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
10245
10246 /**
10247  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
10248  * This corresponds to std::vector in C++
10249  */
10250 typedef struct LDKCVec_TransactionOutputsZ {
10251    /**
10252     * The elements in the array.
10253     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10254     */
10255    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
10256    /**
10257     * The number of elements pointed to by `data`.
10258     */
10259    uintptr_t datalen;
10260 } LDKCVec_TransactionOutputsZ;
10261
10262 /**
10263  * Details about the balance(s) available for spending once the channel appears on chain.
10264  *
10265  * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
10266  * be provided.
10267  */
10268 typedef enum LDKBalance_Tag {
10269    /**
10270     * The channel is not yet closed (or the commitment or closing transaction has not yet
10271     * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
10272     * force-closed now.
10273     */
10274    LDKBalance_ClaimableOnChannelClose,
10275    /**
10276     * The channel has been closed, and the given balance is ours but awaiting confirmations until
10277     * we consider it spendable.
10278     */
10279    LDKBalance_ClaimableAwaitingConfirmations,
10280    /**
10281     * The channel has been closed, and the given balance should be ours but awaiting spending
10282     * transaction confirmation. If the spending transaction does not confirm in time, it is
10283     * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
10284     *
10285     * Once the spending transaction confirms, before it has reached enough confirmations to be
10286     * considered safe from chain reorganizations, the balance will instead be provided via
10287     * [`Balance::ClaimableAwaitingConfirmations`].
10288     */
10289    LDKBalance_ContentiousClaimable,
10290    /**
10291     * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
10292     * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
10293     * likely to be claimed by our counterparty before we do.
10294     */
10295    LDKBalance_MaybeTimeoutClaimableHTLC,
10296    /**
10297     * HTLCs which we received from our counterparty which are claimable with a preimage which we
10298     * do not currently have. This will only be claimable if we receive the preimage from the node
10299     * to which we forwarded this HTLC before the timeout.
10300     */
10301    LDKBalance_MaybePreimageClaimableHTLC,
10302    /**
10303     * The channel has been closed, and our counterparty broadcasted a revoked commitment
10304     * transaction.
10305     *
10306     * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
10307     * following amount.
10308     */
10309    LDKBalance_CounterpartyRevokedOutputClaimable,
10310    /**
10311     * Must be last for serialization purposes
10312     */
10313    LDKBalance_Sentinel,
10314 } LDKBalance_Tag;
10315
10316 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
10317    /**
10318     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
10319     * required to do so.
10320     */
10321    uint64_t amount_satoshis;
10322 } LDKBalance_LDKClaimableOnChannelClose_Body;
10323
10324 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
10325    /**
10326     * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
10327     * were spent in broadcasting the transaction.
10328     */
10329    uint64_t amount_satoshis;
10330    /**
10331     * The height at which an [`Event::SpendableOutputs`] event will be generated for this
10332     * amount.
10333     */
10334    uint32_t confirmation_height;
10335 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
10336
10337 typedef struct LDKBalance_LDKContentiousClaimable_Body {
10338    /**
10339     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
10340     * required to do so.
10341     */
10342    uint64_t amount_satoshis;
10343    /**
10344     * The height at which the counterparty may be able to claim the balance if we have not
10345     * done so.
10346     */
10347    uint32_t timeout_height;
10348    /**
10349     * The payment hash that locks this HTLC.
10350     */
10351    struct LDKThirtyTwoBytes payment_hash;
10352    /**
10353     * The preimage that can be used to claim this HTLC.
10354     */
10355    struct LDKThirtyTwoBytes payment_preimage;
10356 } LDKBalance_LDKContentiousClaimable_Body;
10357
10358 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
10359    /**
10360     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10361     * which will be required to do so.
10362     */
10363    uint64_t amount_satoshis;
10364    /**
10365     * The height at which we will be able to claim the balance if our counterparty has not
10366     * done so.
10367     */
10368    uint32_t claimable_height;
10369    /**
10370     * The payment hash whose preimage our counterparty needs to claim this HTLC.
10371     */
10372    struct LDKThirtyTwoBytes payment_hash;
10373 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
10374
10375 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
10376    /**
10377     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10378     * which will be required to do so.
10379     */
10380    uint64_t amount_satoshis;
10381    /**
10382     * The height at which our counterparty will be able to claim the balance if we have not
10383     * yet received the preimage and claimed it ourselves.
10384     */
10385    uint32_t expiry_height;
10386    /**
10387     * The payment hash whose preimage we need to claim this HTLC.
10388     */
10389    struct LDKThirtyTwoBytes payment_hash;
10390 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
10391
10392 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
10393    /**
10394     * The amount, in satoshis, of the output which we can claim.
10395     *
10396     * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
10397     * were already spent.
10398     */
10399    uint64_t amount_satoshis;
10400 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
10401
10402 typedef struct MUST_USE_STRUCT LDKBalance {
10403    LDKBalance_Tag tag;
10404    union {
10405       LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
10406       LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
10407       LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
10408       LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
10409       LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
10410       LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
10411    };
10412 } LDKBalance;
10413
10414 /**
10415  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
10416  * This corresponds to std::vector in C++
10417  */
10418 typedef struct LDKCVec_BalanceZ {
10419    /**
10420     * The elements in the array.
10421     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10422     */
10423    struct LDKBalance *data;
10424    /**
10425     * The number of elements pointed to by `data`.
10426     */
10427    uintptr_t datalen;
10428 } LDKCVec_BalanceZ;
10429
10430 /**
10431  * A tuple of 2 elements. See the individual fields for the types contained.
10432  */
10433 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
10434    /**
10435     * The element at position 0
10436     */
10437    struct LDKThirtyTwoBytes a;
10438    /**
10439     * The element at position 1
10440     */
10441    struct LDKChannelMonitor b;
10442 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
10443
10444 /**
10445  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
10446  */
10447 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
10448    /**
10449     * A pointer to the contents in the success state.
10450     * Reading from this pointer when `result_ok` is not set is undefined.
10451     */
10452    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
10453    /**
10454     * A pointer to the contents in the error state.
10455     * Reading from this pointer when `result_ok` is set is undefined.
10456     */
10457    struct LDKDecodeError *err;
10458 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
10459
10460 /**
10461  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
10462  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10463  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10464  */
10465 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
10466    /**
10467     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
10468     * `err` or `result` depending on the state of `result_ok`.
10469     */
10470    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
10471    /**
10472     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
10473     */
10474    bool result_ok;
10475 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
10476
10477 /**
10478  * Defines a type identifier for sending messages over the wire.
10479  *
10480  * Messages implementing this trait specify a type and must be [`Writeable`].
10481  */
10482 typedef struct LDKType {
10483    /**
10484     * An opaque pointer which is passed to your function implementations as an argument.
10485     * This has no meaning in the LDK, and can be NULL or any other value.
10486     */
10487    void *this_arg;
10488    /**
10489     * Returns the type identifying the message payload.
10490     */
10491    uint16_t (*type_id)(const void *this_arg);
10492    /**
10493     * Return a human-readable "debug" string describing this object
10494     */
10495    struct LDKStr (*debug_str)(const void *this_arg);
10496    /**
10497     * Serialize the object into a byte array
10498     */
10499    struct LDKCVec_u8Z (*write)(const void *this_arg);
10500    /**
10501     * Called, if set, after this Type has been cloned into a duplicate object.
10502     * The new Type is provided, and should be mutated as needed to perform a
10503     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10504     */
10505    void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
10506    /**
10507     * Frees any resources associated with this object given its this_arg pointer.
10508     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10509     */
10510    void (*free)(void *this_arg);
10511 } LDKType;
10512
10513 /**
10514  * A tuple of 2 elements. See the individual fields for the types contained.
10515  */
10516 typedef struct LDKC2Tuple_PublicKeyTypeZ {
10517    /**
10518     * The element at position 0
10519     */
10520    struct LDKPublicKey a;
10521    /**
10522     * The element at position 1
10523     */
10524    struct LDKType b;
10525 } LDKC2Tuple_PublicKeyTypeZ;
10526
10527 /**
10528  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
10529  * This corresponds to std::vector in C++
10530  */
10531 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
10532    /**
10533     * The elements in the array.
10534     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10535     */
10536    struct LDKC2Tuple_PublicKeyTypeZ *data;
10537    /**
10538     * The number of elements pointed to by `data`.
10539     */
10540    uintptr_t datalen;
10541 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
10542
10543 /**
10544  * The contents of an onion message.
10545  */
10546 typedef struct LDKOnionMessageContents {
10547    /**
10548     * An opaque pointer which is passed to your function implementations as an argument.
10549     * This has no meaning in the LDK, and can be NULL or any other value.
10550     */
10551    void *this_arg;
10552    /**
10553     * Returns the TLV type identifying the message contents. MUST be >= 64.
10554     */
10555    uint64_t (*tlv_type)(const void *this_arg);
10556    /**
10557     * Serialize the object into a byte array
10558     */
10559    struct LDKCVec_u8Z (*write)(const void *this_arg);
10560    /**
10561     * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
10562     * The new OnionMessageContents is provided, and should be mutated as needed to perform a
10563     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10564     */
10565    void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
10566    /**
10567     * Frees any resources associated with this object given its this_arg pointer.
10568     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10569     */
10570    void (*free)(void *this_arg);
10571 } LDKOnionMessageContents;
10572
10573 /**
10574  * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
10575  */
10576 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
10577    /**
10578     * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
10579     */
10580    LDKCOption_OnionMessageContentsZ_Some,
10581    /**
10582     * When we're in this state, this COption_OnionMessageContentsZ contains nothing
10583     */
10584    LDKCOption_OnionMessageContentsZ_None,
10585    /**
10586     * Must be last for serialization purposes
10587     */
10588    LDKCOption_OnionMessageContentsZ_Sentinel,
10589 } LDKCOption_OnionMessageContentsZ_Tag;
10590
10591 typedef struct LDKCOption_OnionMessageContentsZ {
10592    LDKCOption_OnionMessageContentsZ_Tag tag;
10593    union {
10594       struct {
10595          struct LDKOnionMessageContents some;
10596       };
10597    };
10598 } LDKCOption_OnionMessageContentsZ;
10599
10600 /**
10601  * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
10602  */
10603 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
10604    /**
10605     * A pointer to the contents in the success state.
10606     * Reading from this pointer when `result_ok` is not set is undefined.
10607     */
10608    struct LDKCOption_OnionMessageContentsZ *result;
10609    /**
10610     * A pointer to the contents in the error state.
10611     * Reading from this pointer when `result_ok` is set is undefined.
10612     */
10613    struct LDKDecodeError *err;
10614 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
10615
10616 /**
10617  * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
10618  * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10619  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10620  */
10621 typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
10622    /**
10623     * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
10624     * `err` or `result` depending on the state of `result_ok`.
10625     */
10626    union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
10627    /**
10628     * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
10629     */
10630    bool result_ok;
10631 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
10632
10633 /**
10634  * A tuple of 3 elements. See the individual fields for the types contained.
10635  */
10636 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
10637    /**
10638     * The element at position 0
10639     */
10640    struct LDKOnionMessageContents a;
10641    /**
10642     * The element at position 1
10643     */
10644    struct LDKDestination b;
10645    /**
10646     * The element at position 2
10647     */
10648    struct LDKBlindedPath c;
10649 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
10650
10651 /**
10652  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
10653  * This corresponds to std::vector in C++
10654  */
10655 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
10656    /**
10657     * The elements in the array.
10658     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10659     */
10660    struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
10661    /**
10662     * The number of elements pointed to by `data`.
10663     */
10664    uintptr_t datalen;
10665 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
10666
10667 /**
10668  * An enum which can either contain a crate::lightning::ln::wire::Type or not
10669  */
10670 typedef enum LDKCOption_TypeZ_Tag {
10671    /**
10672     * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
10673     */
10674    LDKCOption_TypeZ_Some,
10675    /**
10676     * When we're in this state, this COption_TypeZ contains nothing
10677     */
10678    LDKCOption_TypeZ_None,
10679    /**
10680     * Must be last for serialization purposes
10681     */
10682    LDKCOption_TypeZ_Sentinel,
10683 } LDKCOption_TypeZ_Tag;
10684
10685 typedef struct LDKCOption_TypeZ {
10686    LDKCOption_TypeZ_Tag tag;
10687    union {
10688       struct {
10689          struct LDKType some;
10690       };
10691    };
10692 } LDKCOption_TypeZ;
10693
10694 /**
10695  * The contents of CResult_COption_TypeZDecodeErrorZ
10696  */
10697 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
10698    /**
10699     * A pointer to the contents in the success state.
10700     * Reading from this pointer when `result_ok` is not set is undefined.
10701     */
10702    struct LDKCOption_TypeZ *result;
10703    /**
10704     * A pointer to the contents in the error state.
10705     * Reading from this pointer when `result_ok` is set is undefined.
10706     */
10707    struct LDKDecodeError *err;
10708 } LDKCResult_COption_TypeZDecodeErrorZPtr;
10709
10710 /**
10711  * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
10712  * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10713  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10714  */
10715 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
10716    /**
10717     * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
10718     * `err` or `result` depending on the state of `result_ok`.
10719     */
10720    union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
10721    /**
10722     * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
10723     */
10724    bool result_ok;
10725 } LDKCResult_COption_TypeZDecodeErrorZ;
10726
10727 /**
10728  * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
10729  */
10730 typedef enum LDKCOption_SocketAddressZ_Tag {
10731    /**
10732     * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
10733     */
10734    LDKCOption_SocketAddressZ_Some,
10735    /**
10736     * When we're in this state, this COption_SocketAddressZ contains nothing
10737     */
10738    LDKCOption_SocketAddressZ_None,
10739    /**
10740     * Must be last for serialization purposes
10741     */
10742    LDKCOption_SocketAddressZ_Sentinel,
10743 } LDKCOption_SocketAddressZ_Tag;
10744
10745 typedef struct LDKCOption_SocketAddressZ {
10746    LDKCOption_SocketAddressZ_Tag tag;
10747    union {
10748       struct {
10749          struct LDKSocketAddress some;
10750       };
10751    };
10752 } LDKCOption_SocketAddressZ;
10753
10754 /**
10755  * A tuple of 2 elements. See the individual fields for the types contained.
10756  */
10757 typedef struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ {
10758    /**
10759     * The element at position 0
10760     */
10761    struct LDKPublicKey a;
10762    /**
10763     * The element at position 1
10764     */
10765    struct LDKCOption_SocketAddressZ b;
10766 } LDKC2Tuple_PublicKeyCOption_SocketAddressZZ;
10767
10768 /**
10769  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_SocketAddressZZs of arbitrary size.
10770  * This corresponds to std::vector in C++
10771  */
10772 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ {
10773    /**
10774     * The elements in the array.
10775     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10776     */
10777    struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *data;
10778    /**
10779     * The number of elements pointed to by `data`.
10780     */
10781    uintptr_t datalen;
10782 } LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ;
10783
10784
10785
10786 /**
10787  * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
10788  * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
10789  * descriptor.
10790  */
10791 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
10792    /**
10793     * A pointer to the opaque Rust object.
10794     * Nearly everywhere, inner must be non-null, however in places where
10795     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10796     */
10797    LDKnativePeerHandleError *inner;
10798    /**
10799     * Indicates that this is the only struct which contains the same pointer.
10800     * Rust functions which take ownership of an object provided via an argument require
10801     * this to be true and invalidate the object pointed to by inner.
10802     */
10803    bool is_owned;
10804 } LDKPeerHandleError;
10805
10806 /**
10807  * The contents of CResult_CVec_u8ZPeerHandleErrorZ
10808  */
10809 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
10810    /**
10811     * A pointer to the contents in the success state.
10812     * Reading from this pointer when `result_ok` is not set is undefined.
10813     */
10814    struct LDKCVec_u8Z *result;
10815    /**
10816     * A pointer to the contents in the error state.
10817     * Reading from this pointer when `result_ok` is set is undefined.
10818     */
10819    struct LDKPeerHandleError *err;
10820 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
10821
10822 /**
10823  * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
10824  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10825  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10826  */
10827 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
10828    /**
10829     * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
10830     * `err` or `result` depending on the state of `result_ok`.
10831     */
10832    union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
10833    /**
10834     * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
10835     */
10836    bool result_ok;
10837 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
10838
10839 /**
10840  * The contents of CResult_NonePeerHandleErrorZ
10841  */
10842 typedef union LDKCResult_NonePeerHandleErrorZPtr {
10843    /**
10844     * Note that this value is always NULL, as there are no contents in the OK variant
10845     */
10846    void *result;
10847    /**
10848     * A pointer to the contents in the error state.
10849     * Reading from this pointer when `result_ok` is set is undefined.
10850     */
10851    struct LDKPeerHandleError *err;
10852 } LDKCResult_NonePeerHandleErrorZPtr;
10853
10854 /**
10855  * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
10856  * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10857  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10858  */
10859 typedef struct LDKCResult_NonePeerHandleErrorZ {
10860    /**
10861     * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
10862     * `err` or `result` depending on the state of `result_ok`.
10863     */
10864    union LDKCResult_NonePeerHandleErrorZPtr contents;
10865    /**
10866     * Whether this CResult_NonePeerHandleErrorZ represents a success state.
10867     */
10868    bool result_ok;
10869 } LDKCResult_NonePeerHandleErrorZ;
10870
10871 /**
10872  * The contents of CResult_boolPeerHandleErrorZ
10873  */
10874 typedef union LDKCResult_boolPeerHandleErrorZPtr {
10875    /**
10876     * A pointer to the contents in the success state.
10877     * Reading from this pointer when `result_ok` is not set is undefined.
10878     */
10879    bool *result;
10880    /**
10881     * A pointer to the contents in the error state.
10882     * Reading from this pointer when `result_ok` is set is undefined.
10883     */
10884    struct LDKPeerHandleError *err;
10885 } LDKCResult_boolPeerHandleErrorZPtr;
10886
10887 /**
10888  * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
10889  * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10890  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10891  */
10892 typedef struct LDKCResult_boolPeerHandleErrorZ {
10893    /**
10894     * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
10895     * `err` or `result` depending on the state of `result_ok`.
10896     */
10897    union LDKCResult_boolPeerHandleErrorZPtr contents;
10898    /**
10899     * Whether this CResult_boolPeerHandleErrorZ represents a success state.
10900     */
10901    bool result_ok;
10902 } LDKCResult_boolPeerHandleErrorZ;
10903
10904 /**
10905  * All-encompassing standard error type that processing can return
10906  */
10907 typedef enum LDKGraphSyncError_Tag {
10908    /**
10909     * Error trying to read the update data, typically due to an erroneous data length indication
10910     * that is greater than the actual amount of data provided
10911     */
10912    LDKGraphSyncError_DecodeError,
10913    /**
10914     * Error applying the patch to the network graph, usually the result of updates that are too
10915     * old or missing prerequisite data to the application of updates out of order
10916     */
10917    LDKGraphSyncError_LightningError,
10918    /**
10919     * Must be last for serialization purposes
10920     */
10921    LDKGraphSyncError_Sentinel,
10922 } LDKGraphSyncError_Tag;
10923
10924 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
10925    LDKGraphSyncError_Tag tag;
10926    union {
10927       struct {
10928          struct LDKDecodeError decode_error;
10929       };
10930       struct {
10931          struct LDKLightningError lightning_error;
10932       };
10933    };
10934 } LDKGraphSyncError;
10935
10936 /**
10937  * The contents of CResult_u32GraphSyncErrorZ
10938  */
10939 typedef union LDKCResult_u32GraphSyncErrorZPtr {
10940    /**
10941     * A pointer to the contents in the success state.
10942     * Reading from this pointer when `result_ok` is not set is undefined.
10943     */
10944    uint32_t *result;
10945    /**
10946     * A pointer to the contents in the error state.
10947     * Reading from this pointer when `result_ok` is set is undefined.
10948     */
10949    struct LDKGraphSyncError *err;
10950 } LDKCResult_u32GraphSyncErrorZPtr;
10951
10952 /**
10953  * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
10954  * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
10955  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10956  */
10957 typedef struct LDKCResult_u32GraphSyncErrorZ {
10958    /**
10959     * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
10960     * `err` or `result` depending on the state of `result_ok`.
10961     */
10962    union LDKCResult_u32GraphSyncErrorZPtr contents;
10963    /**
10964     * Whether this CResult_u32GraphSyncErrorZ represents a success state.
10965     */
10966    bool result_ok;
10967 } LDKCResult_u32GraphSyncErrorZ;
10968
10969 /**
10970  * The contents of CResult_CVec_u8ZIOErrorZ
10971  */
10972 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
10973    /**
10974     * A pointer to the contents in the success state.
10975     * Reading from this pointer when `result_ok` is not set is undefined.
10976     */
10977    struct LDKCVec_u8Z *result;
10978    /**
10979     * A pointer to the contents in the error state.
10980     * Reading from this pointer when `result_ok` is set is undefined.
10981     */
10982    enum LDKIOError *err;
10983 } LDKCResult_CVec_u8ZIOErrorZPtr;
10984
10985 /**
10986  * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
10987  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
10988  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10989  */
10990 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
10991    /**
10992     * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
10993     * `err` or `result` depending on the state of `result_ok`.
10994     */
10995    union LDKCResult_CVec_u8ZIOErrorZPtr contents;
10996    /**
10997     * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
10998     */
10999    bool result_ok;
11000 } LDKCResult_CVec_u8ZIOErrorZ;
11001
11002 /**
11003  * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
11004  * This corresponds to std::vector in C++
11005  */
11006 typedef struct LDKCVec_StrZ {
11007    /**
11008     * The elements in the array.
11009     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11010     */
11011    struct LDKStr *data;
11012    /**
11013     * The number of elements pointed to by `data`.
11014     */
11015    uintptr_t datalen;
11016 } LDKCVec_StrZ;
11017
11018 /**
11019  * The contents of CResult_CVec_StrZIOErrorZ
11020  */
11021 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
11022    /**
11023     * A pointer to the contents in the success state.
11024     * Reading from this pointer when `result_ok` is not set is undefined.
11025     */
11026    struct LDKCVec_StrZ *result;
11027    /**
11028     * A pointer to the contents in the error state.
11029     * Reading from this pointer when `result_ok` is set is undefined.
11030     */
11031    enum LDKIOError *err;
11032 } LDKCResult_CVec_StrZIOErrorZPtr;
11033
11034 /**
11035  * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
11036  * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
11037  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11038  */
11039 typedef struct LDKCResult_CVec_StrZIOErrorZ {
11040    /**
11041     * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
11042     * `err` or `result` depending on the state of `result_ok`.
11043     */
11044    union LDKCResult_CVec_StrZIOErrorZPtr contents;
11045    /**
11046     * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
11047     */
11048    bool result_ok;
11049 } LDKCResult_CVec_StrZIOErrorZ;
11050
11051 /**
11052  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
11053  * This corresponds to std::vector in C++
11054  */
11055 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
11056    /**
11057     * The elements in the array.
11058     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11059     */
11060    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
11061    /**
11062     * The number of elements pointed to by `data`.
11063     */
11064    uintptr_t datalen;
11065 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
11066
11067 /**
11068  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
11069  */
11070 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
11071    /**
11072     * A pointer to the contents in the success state.
11073     * Reading from this pointer when `result_ok` is not set is undefined.
11074     */
11075    struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
11076    /**
11077     * A pointer to the contents in the error state.
11078     * Reading from this pointer when `result_ok` is set is undefined.
11079     */
11080    enum LDKIOError *err;
11081 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
11082
11083 /**
11084  * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
11085  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
11086  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11087  */
11088 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
11089    /**
11090     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
11091     * `err` or `result` depending on the state of `result_ok`.
11092     */
11093    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
11094    /**
11095     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
11096     */
11097    bool result_ok;
11098 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
11099
11100 /**
11101  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
11102  */
11103 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
11104    /**
11105     * A pointer to the contents in the success state.
11106     * Reading from this pointer when `result_ok` is not set is undefined.
11107     */
11108    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
11109    /**
11110     * A pointer to the contents in the error state.
11111     * Reading from this pointer when `result_ok` is set is undefined.
11112     */
11113    enum LDKIOError *err;
11114 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
11115
11116 /**
11117  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
11118  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
11119  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11120  */
11121 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
11122    /**
11123     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
11124     * `err` or `result` depending on the state of `result_ok`.
11125     */
11126    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
11127    /**
11128     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
11129     */
11130    bool result_ok;
11131 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
11132
11133 /**
11134  * Represents a valid secp256k1 secret key serialized as a 32 byte array.
11135  */
11136 typedef struct LDKSecretKey {
11137    /**
11138     * The bytes of the secret key
11139     */
11140    uint8_t bytes[32];
11141 } LDKSecretKey;
11142
11143 /**
11144  * An enum which can either contain a crate::c_types::SecretKey or not
11145  */
11146 typedef enum LDKCOption_SecretKeyZ_Tag {
11147    /**
11148     * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
11149     */
11150    LDKCOption_SecretKeyZ_Some,
11151    /**
11152     * When we're in this state, this COption_SecretKeyZ contains nothing
11153     */
11154    LDKCOption_SecretKeyZ_None,
11155    /**
11156     * Must be last for serialization purposes
11157     */
11158    LDKCOption_SecretKeyZ_Sentinel,
11159 } LDKCOption_SecretKeyZ_Tag;
11160
11161 typedef struct LDKCOption_SecretKeyZ {
11162    LDKCOption_SecretKeyZ_Tag tag;
11163    union {
11164       struct {
11165          struct LDKSecretKey some;
11166       };
11167    };
11168 } LDKCOption_SecretKeyZ;
11169
11170
11171
11172 /**
11173  * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
11174  * ways to respond depending on whether the signing keys were derived.
11175  */
11176 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
11177    /**
11178     * A pointer to the opaque Rust object.
11179     * Nearly everywhere, inner must be non-null, however in places where
11180     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11181     */
11182    LDKnativeVerifiedInvoiceRequest *inner;
11183    /**
11184     * Indicates that this is the only struct which contains the same pointer.
11185     * Rust functions which take ownership of an object provided via an argument require
11186     * this to be true and invalidate the object pointed to by inner.
11187     */
11188    bool is_owned;
11189 } LDKVerifiedInvoiceRequest;
11190
11191 /**
11192  * The contents of CResult_VerifiedInvoiceRequestNoneZ
11193  */
11194 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
11195    /**
11196     * A pointer to the contents in the success state.
11197     * Reading from this pointer when `result_ok` is not set is undefined.
11198     */
11199    struct LDKVerifiedInvoiceRequest *result;
11200    /**
11201     * Note that this value is always NULL, as there are no contents in the Err variant
11202     */
11203    void *err;
11204 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
11205
11206 /**
11207  * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
11208  * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
11209  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11210  */
11211 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
11212    /**
11213     * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
11214     * `err` or `result` depending on the state of `result_ok`.
11215     */
11216    union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
11217    /**
11218     * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
11219     */
11220    bool result_ok;
11221 } LDKCResult_VerifiedInvoiceRequestNoneZ;
11222
11223 /**
11224  * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
11225  * This corresponds to std::vector in C++
11226  */
11227 typedef struct LDKCVec_WitnessZ {
11228    /**
11229     * The elements in the array.
11230     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11231     */
11232    struct LDKWitness *data;
11233    /**
11234     * The number of elements pointed to by `data`.
11235     */
11236    uintptr_t datalen;
11237 } LDKCVec_WitnessZ;
11238
11239 /**
11240  * An enum which can either contain a i64 or not
11241  */
11242 typedef enum LDKCOption_i64Z_Tag {
11243    /**
11244     * When we're in this state, this COption_i64Z contains a i64
11245     */
11246    LDKCOption_i64Z_Some,
11247    /**
11248     * When we're in this state, this COption_i64Z contains nothing
11249     */
11250    LDKCOption_i64Z_None,
11251    /**
11252     * Must be last for serialization purposes
11253     */
11254    LDKCOption_i64Z_Sentinel,
11255 } LDKCOption_i64Z_Tag;
11256
11257 typedef struct LDKCOption_i64Z {
11258    LDKCOption_i64Z_Tag tag;
11259    union {
11260       struct {
11261          int64_t some;
11262       };
11263    };
11264 } LDKCOption_i64Z;
11265
11266 /**
11267  * The contents of CResult_SocketAddressDecodeErrorZ
11268  */
11269 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
11270    /**
11271     * A pointer to the contents in the success state.
11272     * Reading from this pointer when `result_ok` is not set is undefined.
11273     */
11274    struct LDKSocketAddress *result;
11275    /**
11276     * A pointer to the contents in the error state.
11277     * Reading from this pointer when `result_ok` is set is undefined.
11278     */
11279    struct LDKDecodeError *err;
11280 } LDKCResult_SocketAddressDecodeErrorZPtr;
11281
11282 /**
11283  * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
11284  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
11285  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11286  */
11287 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
11288    /**
11289     * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
11290     * `err` or `result` depending on the state of `result_ok`.
11291     */
11292    union LDKCResult_SocketAddressDecodeErrorZPtr contents;
11293    /**
11294     * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
11295     */
11296    bool result_ok;
11297 } LDKCResult_SocketAddressDecodeErrorZ;
11298
11299 /**
11300  * The contents of CResult_SocketAddressSocketAddressParseErrorZ
11301  */
11302 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
11303    /**
11304     * A pointer to the contents in the success state.
11305     * Reading from this pointer when `result_ok` is not set is undefined.
11306     */
11307    struct LDKSocketAddress *result;
11308    /**
11309     * A pointer to the contents in the error state.
11310     * Reading from this pointer when `result_ok` is set is undefined.
11311     */
11312    enum LDKSocketAddressParseError *err;
11313 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
11314
11315 /**
11316  * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
11317  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
11318  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11319  */
11320 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
11321    /**
11322     * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
11323     * `err` or `result` depending on the state of `result_ok`.
11324     */
11325    union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
11326    /**
11327     * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
11328     */
11329    bool result_ok;
11330 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
11331
11332
11333
11334 /**
11335  * An [`update_add_htlc`] message to be sent to or received from a peer.
11336  *
11337  * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
11338  */
11339 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
11340    /**
11341     * A pointer to the opaque Rust object.
11342     * Nearly everywhere, inner must be non-null, however in places where
11343     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11344     */
11345    LDKnativeUpdateAddHTLC *inner;
11346    /**
11347     * Indicates that this is the only struct which contains the same pointer.
11348     * Rust functions which take ownership of an object provided via an argument require
11349     * this to be true and invalidate the object pointed to by inner.
11350     */
11351    bool is_owned;
11352 } LDKUpdateAddHTLC;
11353
11354 /**
11355  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
11356  * This corresponds to std::vector in C++
11357  */
11358 typedef struct LDKCVec_UpdateAddHTLCZ {
11359    /**
11360     * The elements in the array.
11361     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11362     */
11363    struct LDKUpdateAddHTLC *data;
11364    /**
11365     * The number of elements pointed to by `data`.
11366     */
11367    uintptr_t datalen;
11368 } LDKCVec_UpdateAddHTLCZ;
11369
11370
11371
11372 /**
11373  * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
11374  *
11375  * [`update_fulfill_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
11376  */
11377 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
11378    /**
11379     * A pointer to the opaque Rust object.
11380     * Nearly everywhere, inner must be non-null, however in places where
11381     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11382     */
11383    LDKnativeUpdateFulfillHTLC *inner;
11384    /**
11385     * Indicates that this is the only struct which contains the same pointer.
11386     * Rust functions which take ownership of an object provided via an argument require
11387     * this to be true and invalidate the object pointed to by inner.
11388     */
11389    bool is_owned;
11390 } LDKUpdateFulfillHTLC;
11391
11392 /**
11393  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
11394  * This corresponds to std::vector in C++
11395  */
11396 typedef struct LDKCVec_UpdateFulfillHTLCZ {
11397    /**
11398     * The elements in the array.
11399     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11400     */
11401    struct LDKUpdateFulfillHTLC *data;
11402    /**
11403     * The number of elements pointed to by `data`.
11404     */
11405    uintptr_t datalen;
11406 } LDKCVec_UpdateFulfillHTLCZ;
11407
11408
11409
11410 /**
11411  * An [`update_fail_htlc`] message to be sent to or received from a peer.
11412  *
11413  * [`update_fail_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
11414  */
11415 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
11416    /**
11417     * A pointer to the opaque Rust object.
11418     * Nearly everywhere, inner must be non-null, however in places where
11419     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11420     */
11421    LDKnativeUpdateFailHTLC *inner;
11422    /**
11423     * Indicates that this is the only struct which contains the same pointer.
11424     * Rust functions which take ownership of an object provided via an argument require
11425     * this to be true and invalidate the object pointed to by inner.
11426     */
11427    bool is_owned;
11428 } LDKUpdateFailHTLC;
11429
11430 /**
11431  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
11432  * This corresponds to std::vector in C++
11433  */
11434 typedef struct LDKCVec_UpdateFailHTLCZ {
11435    /**
11436     * The elements in the array.
11437     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11438     */
11439    struct LDKUpdateFailHTLC *data;
11440    /**
11441     * The number of elements pointed to by `data`.
11442     */
11443    uintptr_t datalen;
11444 } LDKCVec_UpdateFailHTLCZ;
11445
11446
11447
11448 /**
11449  * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
11450  *
11451  * [`update_fail_malformed_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
11452  */
11453 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
11454    /**
11455     * A pointer to the opaque Rust object.
11456     * Nearly everywhere, inner must be non-null, however in places where
11457     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11458     */
11459    LDKnativeUpdateFailMalformedHTLC *inner;
11460    /**
11461     * Indicates that this is the only struct which contains the same pointer.
11462     * Rust functions which take ownership of an object provided via an argument require
11463     * this to be true and invalidate the object pointed to by inner.
11464     */
11465    bool is_owned;
11466 } LDKUpdateFailMalformedHTLC;
11467
11468 /**
11469  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
11470  * This corresponds to std::vector in C++
11471  */
11472 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
11473    /**
11474     * The elements in the array.
11475     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11476     */
11477    struct LDKUpdateFailMalformedHTLC *data;
11478    /**
11479     * The number of elements pointed to by `data`.
11480     */
11481    uintptr_t datalen;
11482 } LDKCVec_UpdateFailMalformedHTLCZ;
11483
11484 /**
11485  * The contents of CResult_AcceptChannelDecodeErrorZ
11486  */
11487 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
11488    /**
11489     * A pointer to the contents in the success state.
11490     * Reading from this pointer when `result_ok` is not set is undefined.
11491     */
11492    struct LDKAcceptChannel *result;
11493    /**
11494     * A pointer to the contents in the error state.
11495     * Reading from this pointer when `result_ok` is set is undefined.
11496     */
11497    struct LDKDecodeError *err;
11498 } LDKCResult_AcceptChannelDecodeErrorZPtr;
11499
11500 /**
11501  * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
11502  * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11503  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11504  */
11505 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
11506    /**
11507     * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
11508     * `err` or `result` depending on the state of `result_ok`.
11509     */
11510    union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
11511    /**
11512     * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
11513     */
11514    bool result_ok;
11515 } LDKCResult_AcceptChannelDecodeErrorZ;
11516
11517 /**
11518  * The contents of CResult_AcceptChannelV2DecodeErrorZ
11519  */
11520 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
11521    /**
11522     * A pointer to the contents in the success state.
11523     * Reading from this pointer when `result_ok` is not set is undefined.
11524     */
11525    struct LDKAcceptChannelV2 *result;
11526    /**
11527     * A pointer to the contents in the error state.
11528     * Reading from this pointer when `result_ok` is set is undefined.
11529     */
11530    struct LDKDecodeError *err;
11531 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
11532
11533 /**
11534  * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
11535  * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
11536  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11537  */
11538 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
11539    /**
11540     * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
11541     * `err` or `result` depending on the state of `result_ok`.
11542     */
11543    union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
11544    /**
11545     * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
11546     */
11547    bool result_ok;
11548 } LDKCResult_AcceptChannelV2DecodeErrorZ;
11549
11550 /**
11551  * The contents of CResult_TxAddInputDecodeErrorZ
11552  */
11553 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
11554    /**
11555     * A pointer to the contents in the success state.
11556     * Reading from this pointer when `result_ok` is not set is undefined.
11557     */
11558    struct LDKTxAddInput *result;
11559    /**
11560     * A pointer to the contents in the error state.
11561     * Reading from this pointer when `result_ok` is set is undefined.
11562     */
11563    struct LDKDecodeError *err;
11564 } LDKCResult_TxAddInputDecodeErrorZPtr;
11565
11566 /**
11567  * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
11568  * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11569  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11570  */
11571 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
11572    /**
11573     * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
11574     * `err` or `result` depending on the state of `result_ok`.
11575     */
11576    union LDKCResult_TxAddInputDecodeErrorZPtr contents;
11577    /**
11578     * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
11579     */
11580    bool result_ok;
11581 } LDKCResult_TxAddInputDecodeErrorZ;
11582
11583 /**
11584  * The contents of CResult_TxAddOutputDecodeErrorZ
11585  */
11586 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
11587    /**
11588     * A pointer to the contents in the success state.
11589     * Reading from this pointer when `result_ok` is not set is undefined.
11590     */
11591    struct LDKTxAddOutput *result;
11592    /**
11593     * A pointer to the contents in the error state.
11594     * Reading from this pointer when `result_ok` is set is undefined.
11595     */
11596    struct LDKDecodeError *err;
11597 } LDKCResult_TxAddOutputDecodeErrorZPtr;
11598
11599 /**
11600  * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
11601  * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11602  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11603  */
11604 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
11605    /**
11606     * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
11607     * `err` or `result` depending on the state of `result_ok`.
11608     */
11609    union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
11610    /**
11611     * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
11612     */
11613    bool result_ok;
11614 } LDKCResult_TxAddOutputDecodeErrorZ;
11615
11616 /**
11617  * The contents of CResult_TxRemoveInputDecodeErrorZ
11618  */
11619 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
11620    /**
11621     * A pointer to the contents in the success state.
11622     * Reading from this pointer when `result_ok` is not set is undefined.
11623     */
11624    struct LDKTxRemoveInput *result;
11625    /**
11626     * A pointer to the contents in the error state.
11627     * Reading from this pointer when `result_ok` is set is undefined.
11628     */
11629    struct LDKDecodeError *err;
11630 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
11631
11632 /**
11633  * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
11634  * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11635  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11636  */
11637 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
11638    /**
11639     * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
11640     * `err` or `result` depending on the state of `result_ok`.
11641     */
11642    union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
11643    /**
11644     * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
11645     */
11646    bool result_ok;
11647 } LDKCResult_TxRemoveInputDecodeErrorZ;
11648
11649 /**
11650  * The contents of CResult_TxRemoveOutputDecodeErrorZ
11651  */
11652 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
11653    /**
11654     * A pointer to the contents in the success state.
11655     * Reading from this pointer when `result_ok` is not set is undefined.
11656     */
11657    struct LDKTxRemoveOutput *result;
11658    /**
11659     * A pointer to the contents in the error state.
11660     * Reading from this pointer when `result_ok` is set is undefined.
11661     */
11662    struct LDKDecodeError *err;
11663 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
11664
11665 /**
11666  * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
11667  * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11668  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11669  */
11670 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
11671    /**
11672     * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
11673     * `err` or `result` depending on the state of `result_ok`.
11674     */
11675    union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
11676    /**
11677     * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
11678     */
11679    bool result_ok;
11680 } LDKCResult_TxRemoveOutputDecodeErrorZ;
11681
11682 /**
11683  * The contents of CResult_TxCompleteDecodeErrorZ
11684  */
11685 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
11686    /**
11687     * A pointer to the contents in the success state.
11688     * Reading from this pointer when `result_ok` is not set is undefined.
11689     */
11690    struct LDKTxComplete *result;
11691    /**
11692     * A pointer to the contents in the error state.
11693     * Reading from this pointer when `result_ok` is set is undefined.
11694     */
11695    struct LDKDecodeError *err;
11696 } LDKCResult_TxCompleteDecodeErrorZPtr;
11697
11698 /**
11699  * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
11700  * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
11701  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11702  */
11703 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
11704    /**
11705     * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
11706     * `err` or `result` depending on the state of `result_ok`.
11707     */
11708    union LDKCResult_TxCompleteDecodeErrorZPtr contents;
11709    /**
11710     * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
11711     */
11712    bool result_ok;
11713 } LDKCResult_TxCompleteDecodeErrorZ;
11714
11715 /**
11716  * The contents of CResult_TxSignaturesDecodeErrorZ
11717  */
11718 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
11719    /**
11720     * A pointer to the contents in the success state.
11721     * Reading from this pointer when `result_ok` is not set is undefined.
11722     */
11723    struct LDKTxSignatures *result;
11724    /**
11725     * A pointer to the contents in the error state.
11726     * Reading from this pointer when `result_ok` is set is undefined.
11727     */
11728    struct LDKDecodeError *err;
11729 } LDKCResult_TxSignaturesDecodeErrorZPtr;
11730
11731 /**
11732  * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
11733  * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11734  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11735  */
11736 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
11737    /**
11738     * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
11739     * `err` or `result` depending on the state of `result_ok`.
11740     */
11741    union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
11742    /**
11743     * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
11744     */
11745    bool result_ok;
11746 } LDKCResult_TxSignaturesDecodeErrorZ;
11747
11748 /**
11749  * The contents of CResult_TxInitRbfDecodeErrorZ
11750  */
11751 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
11752    /**
11753     * A pointer to the contents in the success state.
11754     * Reading from this pointer when `result_ok` is not set is undefined.
11755     */
11756    struct LDKTxInitRbf *result;
11757    /**
11758     * A pointer to the contents in the error state.
11759     * Reading from this pointer when `result_ok` is set is undefined.
11760     */
11761    struct LDKDecodeError *err;
11762 } LDKCResult_TxInitRbfDecodeErrorZPtr;
11763
11764 /**
11765  * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
11766  * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11767  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11768  */
11769 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
11770    /**
11771     * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
11772     * `err` or `result` depending on the state of `result_ok`.
11773     */
11774    union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
11775    /**
11776     * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
11777     */
11778    bool result_ok;
11779 } LDKCResult_TxInitRbfDecodeErrorZ;
11780
11781 /**
11782  * The contents of CResult_TxAckRbfDecodeErrorZ
11783  */
11784 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
11785    /**
11786     * A pointer to the contents in the success state.
11787     * Reading from this pointer when `result_ok` is not set is undefined.
11788     */
11789    struct LDKTxAckRbf *result;
11790    /**
11791     * A pointer to the contents in the error state.
11792     * Reading from this pointer when `result_ok` is set is undefined.
11793     */
11794    struct LDKDecodeError *err;
11795 } LDKCResult_TxAckRbfDecodeErrorZPtr;
11796
11797 /**
11798  * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
11799  * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11800  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11801  */
11802 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
11803    /**
11804     * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
11805     * `err` or `result` depending on the state of `result_ok`.
11806     */
11807    union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
11808    /**
11809     * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
11810     */
11811    bool result_ok;
11812 } LDKCResult_TxAckRbfDecodeErrorZ;
11813
11814 /**
11815  * The contents of CResult_TxAbortDecodeErrorZ
11816  */
11817 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
11818    /**
11819     * A pointer to the contents in the success state.
11820     * Reading from this pointer when `result_ok` is not set is undefined.
11821     */
11822    struct LDKTxAbort *result;
11823    /**
11824     * A pointer to the contents in the error state.
11825     * Reading from this pointer when `result_ok` is set is undefined.
11826     */
11827    struct LDKDecodeError *err;
11828 } LDKCResult_TxAbortDecodeErrorZPtr;
11829
11830 /**
11831  * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
11832  * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
11833  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11834  */
11835 typedef struct LDKCResult_TxAbortDecodeErrorZ {
11836    /**
11837     * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
11838     * `err` or `result` depending on the state of `result_ok`.
11839     */
11840    union LDKCResult_TxAbortDecodeErrorZPtr contents;
11841    /**
11842     * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
11843     */
11844    bool result_ok;
11845 } LDKCResult_TxAbortDecodeErrorZ;
11846
11847 /**
11848  * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
11849  */
11850 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
11851    /**
11852     * A pointer to the contents in the success state.
11853     * Reading from this pointer when `result_ok` is not set is undefined.
11854     */
11855    struct LDKAnnouncementSignatures *result;
11856    /**
11857     * A pointer to the contents in the error state.
11858     * Reading from this pointer when `result_ok` is set is undefined.
11859     */
11860    struct LDKDecodeError *err;
11861 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
11862
11863 /**
11864  * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
11865  * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11866  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11867  */
11868 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
11869    /**
11870     * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
11871     * `err` or `result` depending on the state of `result_ok`.
11872     */
11873    union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
11874    /**
11875     * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
11876     */
11877    bool result_ok;
11878 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
11879
11880 /**
11881  * The contents of CResult_ChannelReestablishDecodeErrorZ
11882  */
11883 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
11884    /**
11885     * A pointer to the contents in the success state.
11886     * Reading from this pointer when `result_ok` is not set is undefined.
11887     */
11888    struct LDKChannelReestablish *result;
11889    /**
11890     * A pointer to the contents in the error state.
11891     * Reading from this pointer when `result_ok` is set is undefined.
11892     */
11893    struct LDKDecodeError *err;
11894 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
11895
11896 /**
11897  * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
11898  * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
11899  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11900  */
11901 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
11902    /**
11903     * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
11904     * `err` or `result` depending on the state of `result_ok`.
11905     */
11906    union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
11907    /**
11908     * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
11909     */
11910    bool result_ok;
11911 } LDKCResult_ChannelReestablishDecodeErrorZ;
11912
11913 /**
11914  * The contents of CResult_ClosingSignedDecodeErrorZ
11915  */
11916 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
11917    /**
11918     * A pointer to the contents in the success state.
11919     * Reading from this pointer when `result_ok` is not set is undefined.
11920     */
11921    struct LDKClosingSigned *result;
11922    /**
11923     * A pointer to the contents in the error state.
11924     * Reading from this pointer when `result_ok` is set is undefined.
11925     */
11926    struct LDKDecodeError *err;
11927 } LDKCResult_ClosingSignedDecodeErrorZPtr;
11928
11929 /**
11930  * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
11931  * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11932  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11933  */
11934 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
11935    /**
11936     * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
11937     * `err` or `result` depending on the state of `result_ok`.
11938     */
11939    union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
11940    /**
11941     * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
11942     */
11943    bool result_ok;
11944 } LDKCResult_ClosingSignedDecodeErrorZ;
11945
11946
11947
11948 /**
11949  * The minimum and maximum fees which the sender is willing to place on the closing transaction.
11950  *
11951  * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
11952  * to use.
11953  */
11954 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
11955    /**
11956     * A pointer to the opaque Rust object.
11957     * Nearly everywhere, inner must be non-null, however in places where
11958     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11959     */
11960    LDKnativeClosingSignedFeeRange *inner;
11961    /**
11962     * Indicates that this is the only struct which contains the same pointer.
11963     * Rust functions which take ownership of an object provided via an argument require
11964     * this to be true and invalidate the object pointed to by inner.
11965     */
11966    bool is_owned;
11967 } LDKClosingSignedFeeRange;
11968
11969 /**
11970  * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
11971  */
11972 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
11973    /**
11974     * A pointer to the contents in the success state.
11975     * Reading from this pointer when `result_ok` is not set is undefined.
11976     */
11977    struct LDKClosingSignedFeeRange *result;
11978    /**
11979     * A pointer to the contents in the error state.
11980     * Reading from this pointer when `result_ok` is set is undefined.
11981     */
11982    struct LDKDecodeError *err;
11983 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
11984
11985 /**
11986  * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
11987  * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11988  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11989  */
11990 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
11991    /**
11992     * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
11993     * `err` or `result` depending on the state of `result_ok`.
11994     */
11995    union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
11996    /**
11997     * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
11998     */
11999    bool result_ok;
12000 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
12001
12002
12003
12004 /**
12005  * A [`commitment_signed`] message to be sent to or received from a peer.
12006  *
12007  * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
12008  */
12009 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
12010    /**
12011     * A pointer to the opaque Rust object.
12012     * Nearly everywhere, inner must be non-null, however in places where
12013     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12014     */
12015    LDKnativeCommitmentSigned *inner;
12016    /**
12017     * Indicates that this is the only struct which contains the same pointer.
12018     * Rust functions which take ownership of an object provided via an argument require
12019     * this to be true and invalidate the object pointed to by inner.
12020     */
12021    bool is_owned;
12022 } LDKCommitmentSigned;
12023
12024 /**
12025  * The contents of CResult_CommitmentSignedDecodeErrorZ
12026  */
12027 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
12028    /**
12029     * A pointer to the contents in the success state.
12030     * Reading from this pointer when `result_ok` is not set is undefined.
12031     */
12032    struct LDKCommitmentSigned *result;
12033    /**
12034     * A pointer to the contents in the error state.
12035     * Reading from this pointer when `result_ok` is set is undefined.
12036     */
12037    struct LDKDecodeError *err;
12038 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
12039
12040 /**
12041  * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
12042  * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
12043  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12044  */
12045 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
12046    /**
12047     * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
12048     * `err` or `result` depending on the state of `result_ok`.
12049     */
12050    union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
12051    /**
12052     * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
12053     */
12054    bool result_ok;
12055 } LDKCResult_CommitmentSignedDecodeErrorZ;
12056
12057 /**
12058  * The contents of CResult_FundingCreatedDecodeErrorZ
12059  */
12060 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
12061    /**
12062     * A pointer to the contents in the success state.
12063     * Reading from this pointer when `result_ok` is not set is undefined.
12064     */
12065    struct LDKFundingCreated *result;
12066    /**
12067     * A pointer to the contents in the error state.
12068     * Reading from this pointer when `result_ok` is set is undefined.
12069     */
12070    struct LDKDecodeError *err;
12071 } LDKCResult_FundingCreatedDecodeErrorZPtr;
12072
12073 /**
12074  * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
12075  * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
12076  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12077  */
12078 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
12079    /**
12080     * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
12081     * `err` or `result` depending on the state of `result_ok`.
12082     */
12083    union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
12084    /**
12085     * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
12086     */
12087    bool result_ok;
12088 } LDKCResult_FundingCreatedDecodeErrorZ;
12089
12090 /**
12091  * The contents of CResult_FundingSignedDecodeErrorZ
12092  */
12093 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
12094    /**
12095     * A pointer to the contents in the success state.
12096     * Reading from this pointer when `result_ok` is not set is undefined.
12097     */
12098    struct LDKFundingSigned *result;
12099    /**
12100     * A pointer to the contents in the error state.
12101     * Reading from this pointer when `result_ok` is set is undefined.
12102     */
12103    struct LDKDecodeError *err;
12104 } LDKCResult_FundingSignedDecodeErrorZPtr;
12105
12106 /**
12107  * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
12108  * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
12109  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12110  */
12111 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
12112    /**
12113     * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
12114     * `err` or `result` depending on the state of `result_ok`.
12115     */
12116    union LDKCResult_FundingSignedDecodeErrorZPtr contents;
12117    /**
12118     * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
12119     */
12120    bool result_ok;
12121 } LDKCResult_FundingSignedDecodeErrorZ;
12122
12123 /**
12124  * The contents of CResult_ChannelReadyDecodeErrorZ
12125  */
12126 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
12127    /**
12128     * A pointer to the contents in the success state.
12129     * Reading from this pointer when `result_ok` is not set is undefined.
12130     */
12131    struct LDKChannelReady *result;
12132    /**
12133     * A pointer to the contents in the error state.
12134     * Reading from this pointer when `result_ok` is set is undefined.
12135     */
12136    struct LDKDecodeError *err;
12137 } LDKCResult_ChannelReadyDecodeErrorZPtr;
12138
12139 /**
12140  * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
12141  * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
12142  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12143  */
12144 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
12145    /**
12146     * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
12147     * `err` or `result` depending on the state of `result_ok`.
12148     */
12149    union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
12150    /**
12151     * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
12152     */
12153    bool result_ok;
12154 } LDKCResult_ChannelReadyDecodeErrorZ;
12155
12156
12157
12158 /**
12159  * An [`init`] message to be sent to or received from a peer.
12160  *
12161  * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
12162  */
12163 typedef struct MUST_USE_STRUCT LDKInit {
12164    /**
12165     * A pointer to the opaque Rust object.
12166     * Nearly everywhere, inner must be non-null, however in places where
12167     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12168     */
12169    LDKnativeInit *inner;
12170    /**
12171     * Indicates that this is the only struct which contains the same pointer.
12172     * Rust functions which take ownership of an object provided via an argument require
12173     * this to be true and invalidate the object pointed to by inner.
12174     */
12175    bool is_owned;
12176 } LDKInit;
12177
12178 /**
12179  * The contents of CResult_InitDecodeErrorZ
12180  */
12181 typedef union LDKCResult_InitDecodeErrorZPtr {
12182    /**
12183     * A pointer to the contents in the success state.
12184     * Reading from this pointer when `result_ok` is not set is undefined.
12185     */
12186    struct LDKInit *result;
12187    /**
12188     * A pointer to the contents in the error state.
12189     * Reading from this pointer when `result_ok` is set is undefined.
12190     */
12191    struct LDKDecodeError *err;
12192 } LDKCResult_InitDecodeErrorZPtr;
12193
12194 /**
12195  * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
12196  * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
12197  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12198  */
12199 typedef struct LDKCResult_InitDecodeErrorZ {
12200    /**
12201     * The contents of this CResult_InitDecodeErrorZ, accessible via either
12202     * `err` or `result` depending on the state of `result_ok`.
12203     */
12204    union LDKCResult_InitDecodeErrorZPtr contents;
12205    /**
12206     * Whether this CResult_InitDecodeErrorZ represents a success state.
12207     */
12208    bool result_ok;
12209 } LDKCResult_InitDecodeErrorZ;
12210
12211 /**
12212  * The contents of CResult_OpenChannelDecodeErrorZ
12213  */
12214 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
12215    /**
12216     * A pointer to the contents in the success state.
12217     * Reading from this pointer when `result_ok` is not set is undefined.
12218     */
12219    struct LDKOpenChannel *result;
12220    /**
12221     * A pointer to the contents in the error state.
12222     * Reading from this pointer when `result_ok` is set is undefined.
12223     */
12224    struct LDKDecodeError *err;
12225 } LDKCResult_OpenChannelDecodeErrorZPtr;
12226
12227 /**
12228  * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
12229  * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
12230  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12231  */
12232 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
12233    /**
12234     * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
12235     * `err` or `result` depending on the state of `result_ok`.
12236     */
12237    union LDKCResult_OpenChannelDecodeErrorZPtr contents;
12238    /**
12239     * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
12240     */
12241    bool result_ok;
12242 } LDKCResult_OpenChannelDecodeErrorZ;
12243
12244 /**
12245  * The contents of CResult_OpenChannelV2DecodeErrorZ
12246  */
12247 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
12248    /**
12249     * A pointer to the contents in the success state.
12250     * Reading from this pointer when `result_ok` is not set is undefined.
12251     */
12252    struct LDKOpenChannelV2 *result;
12253    /**
12254     * A pointer to the contents in the error state.
12255     * Reading from this pointer when `result_ok` is set is undefined.
12256     */
12257    struct LDKDecodeError *err;
12258 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
12259
12260 /**
12261  * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
12262  * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
12263  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12264  */
12265 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
12266    /**
12267     * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
12268     * `err` or `result` depending on the state of `result_ok`.
12269     */
12270    union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
12271    /**
12272     * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
12273     */
12274    bool result_ok;
12275 } LDKCResult_OpenChannelV2DecodeErrorZ;
12276
12277 /**
12278  * The contents of CResult_RevokeAndACKDecodeErrorZ
12279  */
12280 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
12281    /**
12282     * A pointer to the contents in the success state.
12283     * Reading from this pointer when `result_ok` is not set is undefined.
12284     */
12285    struct LDKRevokeAndACK *result;
12286    /**
12287     * A pointer to the contents in the error state.
12288     * Reading from this pointer when `result_ok` is set is undefined.
12289     */
12290    struct LDKDecodeError *err;
12291 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
12292
12293 /**
12294  * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
12295  * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
12296  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12297  */
12298 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
12299    /**
12300     * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
12301     * `err` or `result` depending on the state of `result_ok`.
12302     */
12303    union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
12304    /**
12305     * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
12306     */
12307    bool result_ok;
12308 } LDKCResult_RevokeAndACKDecodeErrorZ;
12309
12310 /**
12311  * The contents of CResult_ShutdownDecodeErrorZ
12312  */
12313 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
12314    /**
12315     * A pointer to the contents in the success state.
12316     * Reading from this pointer when `result_ok` is not set is undefined.
12317     */
12318    struct LDKShutdown *result;
12319    /**
12320     * A pointer to the contents in the error state.
12321     * Reading from this pointer when `result_ok` is set is undefined.
12322     */
12323    struct LDKDecodeError *err;
12324 } LDKCResult_ShutdownDecodeErrorZPtr;
12325
12326 /**
12327  * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
12328  * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
12329  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12330  */
12331 typedef struct LDKCResult_ShutdownDecodeErrorZ {
12332    /**
12333     * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
12334     * `err` or `result` depending on the state of `result_ok`.
12335     */
12336    union LDKCResult_ShutdownDecodeErrorZPtr contents;
12337    /**
12338     * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
12339     */
12340    bool result_ok;
12341 } LDKCResult_ShutdownDecodeErrorZ;
12342
12343 /**
12344  * The contents of CResult_UpdateFailHTLCDecodeErrorZ
12345  */
12346 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
12347    /**
12348     * A pointer to the contents in the success state.
12349     * Reading from this pointer when `result_ok` is not set is undefined.
12350     */
12351    struct LDKUpdateFailHTLC *result;
12352    /**
12353     * A pointer to the contents in the error state.
12354     * Reading from this pointer when `result_ok` is set is undefined.
12355     */
12356    struct LDKDecodeError *err;
12357 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
12358
12359 /**
12360  * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
12361  * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12362  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12363  */
12364 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
12365    /**
12366     * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
12367     * `err` or `result` depending on the state of `result_ok`.
12368     */
12369    union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
12370    /**
12371     * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
12372     */
12373    bool result_ok;
12374 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
12375
12376 /**
12377  * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
12378  */
12379 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
12380    /**
12381     * A pointer to the contents in the success state.
12382     * Reading from this pointer when `result_ok` is not set is undefined.
12383     */
12384    struct LDKUpdateFailMalformedHTLC *result;
12385    /**
12386     * A pointer to the contents in the error state.
12387     * Reading from this pointer when `result_ok` is set is undefined.
12388     */
12389    struct LDKDecodeError *err;
12390 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
12391
12392 /**
12393  * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
12394  * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12395  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12396  */
12397 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
12398    /**
12399     * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
12400     * `err` or `result` depending on the state of `result_ok`.
12401     */
12402    union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
12403    /**
12404     * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
12405     */
12406    bool result_ok;
12407 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
12408
12409
12410
12411 /**
12412  * An [`update_fee`] message to be sent to or received from a peer
12413  *
12414  * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
12415  */
12416 typedef struct MUST_USE_STRUCT LDKUpdateFee {
12417    /**
12418     * A pointer to the opaque Rust object.
12419     * Nearly everywhere, inner must be non-null, however in places where
12420     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12421     */
12422    LDKnativeUpdateFee *inner;
12423    /**
12424     * Indicates that this is the only struct which contains the same pointer.
12425     * Rust functions which take ownership of an object provided via an argument require
12426     * this to be true and invalidate the object pointed to by inner.
12427     */
12428    bool is_owned;
12429 } LDKUpdateFee;
12430
12431 /**
12432  * The contents of CResult_UpdateFeeDecodeErrorZ
12433  */
12434 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
12435    /**
12436     * A pointer to the contents in the success state.
12437     * Reading from this pointer when `result_ok` is not set is undefined.
12438     */
12439    struct LDKUpdateFee *result;
12440    /**
12441     * A pointer to the contents in the error state.
12442     * Reading from this pointer when `result_ok` is set is undefined.
12443     */
12444    struct LDKDecodeError *err;
12445 } LDKCResult_UpdateFeeDecodeErrorZPtr;
12446
12447 /**
12448  * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
12449  * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
12450  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12451  */
12452 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
12453    /**
12454     * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
12455     * `err` or `result` depending on the state of `result_ok`.
12456     */
12457    union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
12458    /**
12459     * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
12460     */
12461    bool result_ok;
12462 } LDKCResult_UpdateFeeDecodeErrorZ;
12463
12464 /**
12465  * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
12466  */
12467 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
12468    /**
12469     * A pointer to the contents in the success state.
12470     * Reading from this pointer when `result_ok` is not set is undefined.
12471     */
12472    struct LDKUpdateFulfillHTLC *result;
12473    /**
12474     * A pointer to the contents in the error state.
12475     * Reading from this pointer when `result_ok` is set is undefined.
12476     */
12477    struct LDKDecodeError *err;
12478 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
12479
12480 /**
12481  * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
12482  * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12483  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12484  */
12485 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
12486    /**
12487     * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
12488     * `err` or `result` depending on the state of `result_ok`.
12489     */
12490    union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
12491    /**
12492     * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
12493     */
12494    bool result_ok;
12495 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
12496
12497 /**
12498  * The contents of CResult_UpdateAddHTLCDecodeErrorZ
12499  */
12500 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
12501    /**
12502     * A pointer to the contents in the success state.
12503     * Reading from this pointer when `result_ok` is not set is undefined.
12504     */
12505    struct LDKUpdateAddHTLC *result;
12506    /**
12507     * A pointer to the contents in the error state.
12508     * Reading from this pointer when `result_ok` is set is undefined.
12509     */
12510    struct LDKDecodeError *err;
12511 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
12512
12513 /**
12514  * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
12515  * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12516  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12517  */
12518 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
12519    /**
12520     * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
12521     * `err` or `result` depending on the state of `result_ok`.
12522     */
12523    union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
12524    /**
12525     * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
12526     */
12527    bool result_ok;
12528 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
12529
12530
12531
12532 /**
12533  * An onion message to be sent to or received from a peer.
12534  *
12535  */
12536 typedef struct MUST_USE_STRUCT LDKOnionMessage {
12537    /**
12538     * A pointer to the opaque Rust object.
12539     * Nearly everywhere, inner must be non-null, however in places where
12540     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12541     */
12542    LDKnativeOnionMessage *inner;
12543    /**
12544     * Indicates that this is the only struct which contains the same pointer.
12545     * Rust functions which take ownership of an object provided via an argument require
12546     * this to be true and invalidate the object pointed to by inner.
12547     */
12548    bool is_owned;
12549 } LDKOnionMessage;
12550
12551 /**
12552  * The contents of CResult_OnionMessageDecodeErrorZ
12553  */
12554 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
12555    /**
12556     * A pointer to the contents in the success state.
12557     * Reading from this pointer when `result_ok` is not set is undefined.
12558     */
12559    struct LDKOnionMessage *result;
12560    /**
12561     * A pointer to the contents in the error state.
12562     * Reading from this pointer when `result_ok` is set is undefined.
12563     */
12564    struct LDKDecodeError *err;
12565 } LDKCResult_OnionMessageDecodeErrorZPtr;
12566
12567 /**
12568  * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
12569  * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12570  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12571  */
12572 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
12573    /**
12574     * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
12575     * `err` or `result` depending on the state of `result_ok`.
12576     */
12577    union LDKCResult_OnionMessageDecodeErrorZPtr contents;
12578    /**
12579     * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
12580     */
12581    bool result_ok;
12582 } LDKCResult_OnionMessageDecodeErrorZ;
12583
12584
12585
12586 /**
12587  * A [`ping`] message to be sent to or received from a peer.
12588  *
12589  * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12590  */
12591 typedef struct MUST_USE_STRUCT LDKPing {
12592    /**
12593     * A pointer to the opaque Rust object.
12594     * Nearly everywhere, inner must be non-null, however in places where
12595     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12596     */
12597    LDKnativePing *inner;
12598    /**
12599     * Indicates that this is the only struct which contains the same pointer.
12600     * Rust functions which take ownership of an object provided via an argument require
12601     * this to be true and invalidate the object pointed to by inner.
12602     */
12603    bool is_owned;
12604 } LDKPing;
12605
12606 /**
12607  * The contents of CResult_PingDecodeErrorZ
12608  */
12609 typedef union LDKCResult_PingDecodeErrorZPtr {
12610    /**
12611     * A pointer to the contents in the success state.
12612     * Reading from this pointer when `result_ok` is not set is undefined.
12613     */
12614    struct LDKPing *result;
12615    /**
12616     * A pointer to the contents in the error state.
12617     * Reading from this pointer when `result_ok` is set is undefined.
12618     */
12619    struct LDKDecodeError *err;
12620 } LDKCResult_PingDecodeErrorZPtr;
12621
12622 /**
12623  * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
12624  * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
12625  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12626  */
12627 typedef struct LDKCResult_PingDecodeErrorZ {
12628    /**
12629     * The contents of this CResult_PingDecodeErrorZ, accessible via either
12630     * `err` or `result` depending on the state of `result_ok`.
12631     */
12632    union LDKCResult_PingDecodeErrorZPtr contents;
12633    /**
12634     * Whether this CResult_PingDecodeErrorZ represents a success state.
12635     */
12636    bool result_ok;
12637 } LDKCResult_PingDecodeErrorZ;
12638
12639
12640
12641 /**
12642  * A [`pong`] message to be sent to or received from a peer.
12643  *
12644  * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12645  */
12646 typedef struct MUST_USE_STRUCT LDKPong {
12647    /**
12648     * A pointer to the opaque Rust object.
12649     * Nearly everywhere, inner must be non-null, however in places where
12650     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12651     */
12652    LDKnativePong *inner;
12653    /**
12654     * Indicates that this is the only struct which contains the same pointer.
12655     * Rust functions which take ownership of an object provided via an argument require
12656     * this to be true and invalidate the object pointed to by inner.
12657     */
12658    bool is_owned;
12659 } LDKPong;
12660
12661 /**
12662  * The contents of CResult_PongDecodeErrorZ
12663  */
12664 typedef union LDKCResult_PongDecodeErrorZPtr {
12665    /**
12666     * A pointer to the contents in the success state.
12667     * Reading from this pointer when `result_ok` is not set is undefined.
12668     */
12669    struct LDKPong *result;
12670    /**
12671     * A pointer to the contents in the error state.
12672     * Reading from this pointer when `result_ok` is set is undefined.
12673     */
12674    struct LDKDecodeError *err;
12675 } LDKCResult_PongDecodeErrorZPtr;
12676
12677 /**
12678  * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
12679  * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
12680  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12681  */
12682 typedef struct LDKCResult_PongDecodeErrorZ {
12683    /**
12684     * The contents of this CResult_PongDecodeErrorZ, accessible via either
12685     * `err` or `result` depending on the state of `result_ok`.
12686     */
12687    union LDKCResult_PongDecodeErrorZPtr contents;
12688    /**
12689     * Whether this CResult_PongDecodeErrorZ represents a success state.
12690     */
12691    bool result_ok;
12692 } LDKCResult_PongDecodeErrorZ;
12693
12694 /**
12695  * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
12696  */
12697 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
12698    /**
12699     * A pointer to the contents in the success state.
12700     * Reading from this pointer when `result_ok` is not set is undefined.
12701     */
12702    struct LDKUnsignedChannelAnnouncement *result;
12703    /**
12704     * A pointer to the contents in the error state.
12705     * Reading from this pointer when `result_ok` is set is undefined.
12706     */
12707    struct LDKDecodeError *err;
12708 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
12709
12710 /**
12711  * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12712  * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12713  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12714  */
12715 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
12716    /**
12717     * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
12718     * `err` or `result` depending on the state of `result_ok`.
12719     */
12720    union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
12721    /**
12722     * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
12723     */
12724    bool result_ok;
12725 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
12726
12727 /**
12728  * The contents of CResult_ChannelAnnouncementDecodeErrorZ
12729  */
12730 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
12731    /**
12732     * A pointer to the contents in the success state.
12733     * Reading from this pointer when `result_ok` is not set is undefined.
12734     */
12735    struct LDKChannelAnnouncement *result;
12736    /**
12737     * A pointer to the contents in the error state.
12738     * Reading from this pointer when `result_ok` is set is undefined.
12739     */
12740    struct LDKDecodeError *err;
12741 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
12742
12743 /**
12744  * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12745  * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12746  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12747  */
12748 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
12749    /**
12750     * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
12751     * `err` or `result` depending on the state of `result_ok`.
12752     */
12753    union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
12754    /**
12755     * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
12756     */
12757    bool result_ok;
12758 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
12759
12760 /**
12761  * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
12762  */
12763 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
12764    /**
12765     * A pointer to the contents in the success state.
12766     * Reading from this pointer when `result_ok` is not set is undefined.
12767     */
12768    struct LDKUnsignedChannelUpdate *result;
12769    /**
12770     * A pointer to the contents in the error state.
12771     * Reading from this pointer when `result_ok` is set is undefined.
12772     */
12773    struct LDKDecodeError *err;
12774 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
12775
12776 /**
12777  * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12778  * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12779  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12780  */
12781 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
12782    /**
12783     * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
12784     * `err` or `result` depending on the state of `result_ok`.
12785     */
12786    union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
12787    /**
12788     * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
12789     */
12790    bool result_ok;
12791 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
12792
12793 /**
12794  * The contents of CResult_ChannelUpdateDecodeErrorZ
12795  */
12796 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
12797    /**
12798     * A pointer to the contents in the success state.
12799     * Reading from this pointer when `result_ok` is not set is undefined.
12800     */
12801    struct LDKChannelUpdate *result;
12802    /**
12803     * A pointer to the contents in the error state.
12804     * Reading from this pointer when `result_ok` is set is undefined.
12805     */
12806    struct LDKDecodeError *err;
12807 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
12808
12809 /**
12810  * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12811  * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12812  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12813  */
12814 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
12815    /**
12816     * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
12817     * `err` or `result` depending on the state of `result_ok`.
12818     */
12819    union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
12820    /**
12821     * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
12822     */
12823    bool result_ok;
12824 } LDKCResult_ChannelUpdateDecodeErrorZ;
12825
12826 /**
12827  * The contents of CResult_ErrorMessageDecodeErrorZ
12828  */
12829 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
12830    /**
12831     * A pointer to the contents in the success state.
12832     * Reading from this pointer when `result_ok` is not set is undefined.
12833     */
12834    struct LDKErrorMessage *result;
12835    /**
12836     * A pointer to the contents in the error state.
12837     * Reading from this pointer when `result_ok` is set is undefined.
12838     */
12839    struct LDKDecodeError *err;
12840 } LDKCResult_ErrorMessageDecodeErrorZPtr;
12841
12842 /**
12843  * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
12844  * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12845  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12846  */
12847 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
12848    /**
12849     * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
12850     * `err` or `result` depending on the state of `result_ok`.
12851     */
12852    union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
12853    /**
12854     * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
12855     */
12856    bool result_ok;
12857 } LDKCResult_ErrorMessageDecodeErrorZ;
12858
12859 /**
12860  * The contents of CResult_WarningMessageDecodeErrorZ
12861  */
12862 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
12863    /**
12864     * A pointer to the contents in the success state.
12865     * Reading from this pointer when `result_ok` is not set is undefined.
12866     */
12867    struct LDKWarningMessage *result;
12868    /**
12869     * A pointer to the contents in the error state.
12870     * Reading from this pointer when `result_ok` is set is undefined.
12871     */
12872    struct LDKDecodeError *err;
12873 } LDKCResult_WarningMessageDecodeErrorZPtr;
12874
12875 /**
12876  * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
12877  * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12878  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12879  */
12880 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
12881    /**
12882     * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
12883     * `err` or `result` depending on the state of `result_ok`.
12884     */
12885    union LDKCResult_WarningMessageDecodeErrorZPtr contents;
12886    /**
12887     * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
12888     */
12889    bool result_ok;
12890 } LDKCResult_WarningMessageDecodeErrorZ;
12891
12892 /**
12893  * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
12894  */
12895 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
12896    /**
12897     * A pointer to the contents in the success state.
12898     * Reading from this pointer when `result_ok` is not set is undefined.
12899     */
12900    struct LDKUnsignedNodeAnnouncement *result;
12901    /**
12902     * A pointer to the contents in the error state.
12903     * Reading from this pointer when `result_ok` is set is undefined.
12904     */
12905    struct LDKDecodeError *err;
12906 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
12907
12908 /**
12909  * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12910  * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12911  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12912  */
12913 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
12914    /**
12915     * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
12916     * `err` or `result` depending on the state of `result_ok`.
12917     */
12918    union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
12919    /**
12920     * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
12921     */
12922    bool result_ok;
12923 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
12924
12925 /**
12926  * The contents of CResult_NodeAnnouncementDecodeErrorZ
12927  */
12928 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
12929    /**
12930     * A pointer to the contents in the success state.
12931     * Reading from this pointer when `result_ok` is not set is undefined.
12932     */
12933    struct LDKNodeAnnouncement *result;
12934    /**
12935     * A pointer to the contents in the error state.
12936     * Reading from this pointer when `result_ok` is set is undefined.
12937     */
12938    struct LDKDecodeError *err;
12939 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
12940
12941 /**
12942  * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12943  * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12944  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12945  */
12946 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
12947    /**
12948     * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
12949     * `err` or `result` depending on the state of `result_ok`.
12950     */
12951    union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
12952    /**
12953     * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
12954     */
12955    bool result_ok;
12956 } LDKCResult_NodeAnnouncementDecodeErrorZ;
12957
12958 /**
12959  * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
12960  */
12961 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
12962    /**
12963     * A pointer to the contents in the success state.
12964     * Reading from this pointer when `result_ok` is not set is undefined.
12965     */
12966    struct LDKQueryShortChannelIds *result;
12967    /**
12968     * A pointer to the contents in the error state.
12969     * Reading from this pointer when `result_ok` is set is undefined.
12970     */
12971    struct LDKDecodeError *err;
12972 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
12973
12974 /**
12975  * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
12976  * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
12977  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12978  */
12979 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
12980    /**
12981     * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
12982     * `err` or `result` depending on the state of `result_ok`.
12983     */
12984    union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
12985    /**
12986     * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
12987     */
12988    bool result_ok;
12989 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
12990
12991
12992
12993 /**
12994  * A [`reply_short_channel_ids_end`] message is sent as a reply to a
12995  * message. The query recipient makes a best
12996  * effort to respond based on their local network view which may not be
12997  * a perfect view of the network.
12998  *
12999  * [`reply_short_channel_ids_end`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
13000  */
13001 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
13002    /**
13003     * A pointer to the opaque Rust object.
13004     * Nearly everywhere, inner must be non-null, however in places where
13005     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13006     */
13007    LDKnativeReplyShortChannelIdsEnd *inner;
13008    /**
13009     * Indicates that this is the only struct which contains the same pointer.
13010     * Rust functions which take ownership of an object provided via an argument require
13011     * this to be true and invalidate the object pointed to by inner.
13012     */
13013    bool is_owned;
13014 } LDKReplyShortChannelIdsEnd;
13015
13016 /**
13017  * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
13018  */
13019 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
13020    /**
13021     * A pointer to the contents in the success state.
13022     * Reading from this pointer when `result_ok` is not set is undefined.
13023     */
13024    struct LDKReplyShortChannelIdsEnd *result;
13025    /**
13026     * A pointer to the contents in the error state.
13027     * Reading from this pointer when `result_ok` is set is undefined.
13028     */
13029    struct LDKDecodeError *err;
13030 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
13031
13032 /**
13033  * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
13034  * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
13035  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13036  */
13037 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
13038    /**
13039     * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
13040     * `err` or `result` depending on the state of `result_ok`.
13041     */
13042    union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
13043    /**
13044     * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
13045     */
13046    bool result_ok;
13047 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
13048
13049 /**
13050  * The contents of CResult_QueryChannelRangeDecodeErrorZ
13051  */
13052 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
13053    /**
13054     * A pointer to the contents in the success state.
13055     * Reading from this pointer when `result_ok` is not set is undefined.
13056     */
13057    struct LDKQueryChannelRange *result;
13058    /**
13059     * A pointer to the contents in the error state.
13060     * Reading from this pointer when `result_ok` is set is undefined.
13061     */
13062    struct LDKDecodeError *err;
13063 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
13064
13065 /**
13066  * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
13067  * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
13068  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13069  */
13070 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
13071    /**
13072     * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
13073     * `err` or `result` depending on the state of `result_ok`.
13074     */
13075    union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
13076    /**
13077     * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
13078     */
13079    bool result_ok;
13080 } LDKCResult_QueryChannelRangeDecodeErrorZ;
13081
13082 /**
13083  * The contents of CResult_ReplyChannelRangeDecodeErrorZ
13084  */
13085 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
13086    /**
13087     * A pointer to the contents in the success state.
13088     * Reading from this pointer when `result_ok` is not set is undefined.
13089     */
13090    struct LDKReplyChannelRange *result;
13091    /**
13092     * A pointer to the contents in the error state.
13093     * Reading from this pointer when `result_ok` is set is undefined.
13094     */
13095    struct LDKDecodeError *err;
13096 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
13097
13098 /**
13099  * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
13100  * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
13101  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13102  */
13103 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
13104    /**
13105     * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
13106     * `err` or `result` depending on the state of `result_ok`.
13107     */
13108    union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
13109    /**
13110     * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
13111     */
13112    bool result_ok;
13113 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
13114
13115 /**
13116  * The contents of CResult_GossipTimestampFilterDecodeErrorZ
13117  */
13118 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
13119    /**
13120     * A pointer to the contents in the success state.
13121     * Reading from this pointer when `result_ok` is not set is undefined.
13122     */
13123    struct LDKGossipTimestampFilter *result;
13124    /**
13125     * A pointer to the contents in the error state.
13126     * Reading from this pointer when `result_ok` is set is undefined.
13127     */
13128    struct LDKDecodeError *err;
13129 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
13130
13131 /**
13132  * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
13133  * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
13134  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13135  */
13136 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
13137    /**
13138     * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
13139     * `err` or `result` depending on the state of `result_ok`.
13140     */
13141    union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
13142    /**
13143     * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
13144     */
13145    bool result_ok;
13146 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
13147
13148 /**
13149  * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
13150  * This corresponds to std::vector in C++
13151  */
13152 typedef struct LDKCVec_PhantomRouteHintsZ {
13153    /**
13154     * The elements in the array.
13155     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13156     */
13157    struct LDKPhantomRouteHints *data;
13158    /**
13159     * The number of elements pointed to by `data`.
13160     */
13161    uintptr_t datalen;
13162 } LDKCVec_PhantomRouteHintsZ;
13163
13164
13165
13166 /**
13167  * Represents a syntactically and semantically correct lightning BOLT11 invoice.
13168  *
13169  * There are three ways to construct a `Bolt11Invoice`:
13170  *  1. using [`InvoiceBuilder`]
13171  *  2. using [`Bolt11Invoice::from_signed`]
13172  *  3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
13173  *
13174  * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
13175  */
13176 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
13177    /**
13178     * A pointer to the opaque Rust object.
13179     * Nearly everywhere, inner must be non-null, however in places where
13180     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13181     */
13182    LDKnativeBolt11Invoice *inner;
13183    /**
13184     * Indicates that this is the only struct which contains the same pointer.
13185     * Rust functions which take ownership of an object provided via an argument require
13186     * this to be true and invalidate the object pointed to by inner.
13187     */
13188    bool is_owned;
13189 } LDKBolt11Invoice;
13190
13191 /**
13192  * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
13193  * may occur.
13194  */
13195 typedef enum LDKSignOrCreationError_Tag {
13196    /**
13197     * An error occurred during signing
13198     */
13199    LDKSignOrCreationError_SignError,
13200    /**
13201     * An error occurred while building the transaction
13202     */
13203    LDKSignOrCreationError_CreationError,
13204    /**
13205     * Must be last for serialization purposes
13206     */
13207    LDKSignOrCreationError_Sentinel,
13208 } LDKSignOrCreationError_Tag;
13209
13210 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
13211    LDKSignOrCreationError_Tag tag;
13212    union {
13213       struct {
13214          enum LDKCreationError creation_error;
13215       };
13216    };
13217 } LDKSignOrCreationError;
13218
13219 /**
13220  * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
13221  */
13222 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
13223    /**
13224     * A pointer to the contents in the success state.
13225     * Reading from this pointer when `result_ok` is not set is undefined.
13226     */
13227    struct LDKBolt11Invoice *result;
13228    /**
13229     * A pointer to the contents in the error state.
13230     * Reading from this pointer when `result_ok` is set is undefined.
13231     */
13232    struct LDKSignOrCreationError *err;
13233 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
13234
13235 /**
13236  * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
13237  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
13238  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13239  */
13240 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
13241    /**
13242     * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
13243     * `err` or `result` depending on the state of `result_ok`.
13244     */
13245    union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
13246    /**
13247     * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
13248     */
13249    bool result_ok;
13250 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
13251
13252
13253
13254 /**
13255  * A simple future which can complete once, and calls some callback(s) when it does so.
13256  *
13257  * Clones can be made and all futures cloned from the same source will complete at the same time.
13258  */
13259 typedef struct MUST_USE_STRUCT LDKFuture {
13260    /**
13261     * A pointer to the opaque Rust object.
13262     * Nearly everywhere, inner must be non-null, however in places where
13263     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13264     */
13265    LDKnativeFuture *inner;
13266    /**
13267     * Indicates that this is the only struct which contains the same pointer.
13268     * Rust functions which take ownership of an object provided via an argument require
13269     * this to be true and invalidate the object pointed to by inner.
13270     */
13271    bool is_owned;
13272 } LDKFuture;
13273
13274 /**
13275  * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
13276  * This corresponds to std::vector in C++
13277  */
13278 typedef struct LDKCVec_FutureZ {
13279    /**
13280     * The elements in the array.
13281     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13282     */
13283    struct LDKFuture *data;
13284    /**
13285     * The number of elements pointed to by `data`.
13286     */
13287    uintptr_t datalen;
13288 } LDKCVec_FutureZ;
13289
13290 /**
13291  * The contents of CResult_OffersMessageDecodeErrorZ
13292  */
13293 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
13294    /**
13295     * A pointer to the contents in the success state.
13296     * Reading from this pointer when `result_ok` is not set is undefined.
13297     */
13298    struct LDKOffersMessage *result;
13299    /**
13300     * A pointer to the contents in the error state.
13301     * Reading from this pointer when `result_ok` is set is undefined.
13302     */
13303    struct LDKDecodeError *err;
13304 } LDKCResult_OffersMessageDecodeErrorZPtr;
13305
13306 /**
13307  * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
13308  * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
13309  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13310  */
13311 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
13312    /**
13313     * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
13314     * `err` or `result` depending on the state of `result_ok`.
13315     */
13316    union LDKCResult_OffersMessageDecodeErrorZPtr contents;
13317    /**
13318     * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
13319     */
13320    bool result_ok;
13321 } LDKCResult_OffersMessageDecodeErrorZ;
13322
13323 /**
13324  * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
13325  */
13326 typedef enum LDKCOption_HTLCClaimZ_Tag {
13327    /**
13328     * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
13329     */
13330    LDKCOption_HTLCClaimZ_Some,
13331    /**
13332     * When we're in this state, this COption_HTLCClaimZ contains nothing
13333     */
13334    LDKCOption_HTLCClaimZ_None,
13335    /**
13336     * Must be last for serialization purposes
13337     */
13338    LDKCOption_HTLCClaimZ_Sentinel,
13339 } LDKCOption_HTLCClaimZ_Tag;
13340
13341 typedef struct LDKCOption_HTLCClaimZ {
13342    LDKCOption_HTLCClaimZ_Tag tag;
13343    union {
13344       struct {
13345          enum LDKHTLCClaim some;
13346       };
13347    };
13348 } LDKCOption_HTLCClaimZ;
13349
13350
13351
13352 /**
13353  * Implements the per-commitment secret storage scheme from
13354  * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
13355  *
13356  * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
13357  * or so.
13358  */
13359 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
13360    /**
13361     * A pointer to the opaque Rust object.
13362     * Nearly everywhere, inner must be non-null, however in places where
13363     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13364     */
13365    LDKnativeCounterpartyCommitmentSecrets *inner;
13366    /**
13367     * Indicates that this is the only struct which contains the same pointer.
13368     * Rust functions which take ownership of an object provided via an argument require
13369     * this to be true and invalidate the object pointed to by inner.
13370     */
13371    bool is_owned;
13372 } LDKCounterpartyCommitmentSecrets;
13373
13374 /**
13375  * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
13376  */
13377 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
13378    /**
13379     * A pointer to the contents in the success state.
13380     * Reading from this pointer when `result_ok` is not set is undefined.
13381     */
13382    struct LDKCounterpartyCommitmentSecrets *result;
13383    /**
13384     * A pointer to the contents in the error state.
13385     * Reading from this pointer when `result_ok` is set is undefined.
13386     */
13387    struct LDKDecodeError *err;
13388 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
13389
13390 /**
13391  * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
13392  * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
13393  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13394  */
13395 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
13396    /**
13397     * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
13398     * `err` or `result` depending on the state of `result_ok`.
13399     */
13400    union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
13401    /**
13402     * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
13403     */
13404    bool result_ok;
13405 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
13406
13407
13408
13409 /**
13410  * The set of public keys which are used in the creation of one commitment transaction.
13411  * These are derived from the channel base keys and per-commitment data.
13412  *
13413  * A broadcaster key is provided from potential broadcaster of the computed transaction.
13414  * A countersignatory key is coming from a protocol participant unable to broadcast the
13415  * transaction.
13416  *
13417  * These keys are assumed to be good, either because the code derived them from
13418  * channel basepoints via the new function, or they were obtained via
13419  * CommitmentTransaction.trust().keys() because we trusted the source of the
13420  * pre-calculated keys.
13421  */
13422 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
13423    /**
13424     * A pointer to the opaque Rust object.
13425     * Nearly everywhere, inner must be non-null, however in places where
13426     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13427     */
13428    LDKnativeTxCreationKeys *inner;
13429    /**
13430     * Indicates that this is the only struct which contains the same pointer.
13431     * Rust functions which take ownership of an object provided via an argument require
13432     * this to be true and invalidate the object pointed to by inner.
13433     */
13434    bool is_owned;
13435 } LDKTxCreationKeys;
13436
13437 /**
13438  * The contents of CResult_TxCreationKeysDecodeErrorZ
13439  */
13440 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
13441    /**
13442     * A pointer to the contents in the success state.
13443     * Reading from this pointer when `result_ok` is not set is undefined.
13444     */
13445    struct LDKTxCreationKeys *result;
13446    /**
13447     * A pointer to the contents in the error state.
13448     * Reading from this pointer when `result_ok` is set is undefined.
13449     */
13450    struct LDKDecodeError *err;
13451 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
13452
13453 /**
13454  * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
13455  * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
13456  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13457  */
13458 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
13459    /**
13460     * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
13461     * `err` or `result` depending on the state of `result_ok`.
13462     */
13463    union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
13464    /**
13465     * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
13466     */
13467    bool result_ok;
13468 } LDKCResult_TxCreationKeysDecodeErrorZ;
13469
13470 /**
13471  * The contents of CResult_ChannelPublicKeysDecodeErrorZ
13472  */
13473 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
13474    /**
13475     * A pointer to the contents in the success state.
13476     * Reading from this pointer when `result_ok` is not set is undefined.
13477     */
13478    struct LDKChannelPublicKeys *result;
13479    /**
13480     * A pointer to the contents in the error state.
13481     * Reading from this pointer when `result_ok` is set is undefined.
13482     */
13483    struct LDKDecodeError *err;
13484 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
13485
13486 /**
13487  * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
13488  * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
13489  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13490  */
13491 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
13492    /**
13493     * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
13494     * `err` or `result` depending on the state of `result_ok`.
13495     */
13496    union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
13497    /**
13498     * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
13499     */
13500    bool result_ok;
13501 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
13502
13503 /**
13504  * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
13505  */
13506 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
13507    /**
13508     * A pointer to the contents in the success state.
13509     * Reading from this pointer when `result_ok` is not set is undefined.
13510     */
13511    struct LDKHTLCOutputInCommitment *result;
13512    /**
13513     * A pointer to the contents in the error state.
13514     * Reading from this pointer when `result_ok` is set is undefined.
13515     */
13516    struct LDKDecodeError *err;
13517 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
13518
13519 /**
13520  * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
13521  * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
13522  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13523  */
13524 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
13525    /**
13526     * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
13527     * `err` or `result` depending on the state of `result_ok`.
13528     */
13529    union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
13530    /**
13531     * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
13532     */
13533    bool result_ok;
13534 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
13535
13536
13537
13538 /**
13539  * Late-bound per-channel counterparty data used to build transactions.
13540  */
13541 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
13542    /**
13543     * A pointer to the opaque Rust object.
13544     * Nearly everywhere, inner must be non-null, however in places where
13545     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13546     */
13547    LDKnativeCounterpartyChannelTransactionParameters *inner;
13548    /**
13549     * Indicates that this is the only struct which contains the same pointer.
13550     * Rust functions which take ownership of an object provided via an argument require
13551     * this to be true and invalidate the object pointed to by inner.
13552     */
13553    bool is_owned;
13554 } LDKCounterpartyChannelTransactionParameters;
13555
13556 /**
13557  * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
13558  */
13559 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
13560    /**
13561     * A pointer to the contents in the success state.
13562     * Reading from this pointer when `result_ok` is not set is undefined.
13563     */
13564    struct LDKCounterpartyChannelTransactionParameters *result;
13565    /**
13566     * A pointer to the contents in the error state.
13567     * Reading from this pointer when `result_ok` is set is undefined.
13568     */
13569    struct LDKDecodeError *err;
13570 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
13571
13572 /**
13573  * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
13574  * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
13575  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13576  */
13577 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
13578    /**
13579     * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
13580     * `err` or `result` depending on the state of `result_ok`.
13581     */
13582    union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
13583    /**
13584     * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
13585     */
13586    bool result_ok;
13587 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
13588
13589 /**
13590  * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
13591  */
13592 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
13593    /**
13594     * A pointer to the contents in the success state.
13595     * Reading from this pointer when `result_ok` is not set is undefined.
13596     */
13597    struct LDKChannelTransactionParameters *result;
13598    /**
13599     * A pointer to the contents in the error state.
13600     * Reading from this pointer when `result_ok` is set is undefined.
13601     */
13602    struct LDKDecodeError *err;
13603 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
13604
13605 /**
13606  * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
13607  * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
13608  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13609  */
13610 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
13611    /**
13612     * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
13613     * `err` or `result` depending on the state of `result_ok`.
13614     */
13615    union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
13616    /**
13617     * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
13618     */
13619    bool result_ok;
13620 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
13621
13622 /**
13623  * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
13624  */
13625 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
13626    /**
13627     * A pointer to the contents in the success state.
13628     * Reading from this pointer when `result_ok` is not set is undefined.
13629     */
13630    struct LDKHolderCommitmentTransaction *result;
13631    /**
13632     * A pointer to the contents in the error state.
13633     * Reading from this pointer when `result_ok` is set is undefined.
13634     */
13635    struct LDKDecodeError *err;
13636 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
13637
13638 /**
13639  * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13640  * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13641  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13642  */
13643 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
13644    /**
13645     * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
13646     * `err` or `result` depending on the state of `result_ok`.
13647     */
13648    union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
13649    /**
13650     * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
13651     */
13652    bool result_ok;
13653 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
13654
13655
13656
13657 /**
13658  * A pre-built Bitcoin commitment transaction and its txid.
13659  */
13660 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
13661    /**
13662     * A pointer to the opaque Rust object.
13663     * Nearly everywhere, inner must be non-null, however in places where
13664     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13665     */
13666    LDKnativeBuiltCommitmentTransaction *inner;
13667    /**
13668     * Indicates that this is the only struct which contains the same pointer.
13669     * Rust functions which take ownership of an object provided via an argument require
13670     * this to be true and invalidate the object pointed to by inner.
13671     */
13672    bool is_owned;
13673 } LDKBuiltCommitmentTransaction;
13674
13675 /**
13676  * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
13677  */
13678 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
13679    /**
13680     * A pointer to the contents in the success state.
13681     * Reading from this pointer when `result_ok` is not set is undefined.
13682     */
13683    struct LDKBuiltCommitmentTransaction *result;
13684    /**
13685     * A pointer to the contents in the error state.
13686     * Reading from this pointer when `result_ok` is set is undefined.
13687     */
13688    struct LDKDecodeError *err;
13689 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
13690
13691 /**
13692  * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13693  * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13694  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13695  */
13696 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
13697    /**
13698     * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
13699     * `err` or `result` depending on the state of `result_ok`.
13700     */
13701    union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
13702    /**
13703     * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
13704     */
13705    bool result_ok;
13706 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
13707
13708
13709
13710 /**
13711  * A wrapper on ClosingTransaction indicating that the built bitcoin
13712  * transaction is trusted.
13713  *
13714  * See trust() and verify() functions on CommitmentTransaction.
13715  *
13716  * This structure implements Deref.
13717  */
13718 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
13719    /**
13720     * A pointer to the opaque Rust object.
13721     * Nearly everywhere, inner must be non-null, however in places where
13722     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13723     */
13724    LDKnativeTrustedClosingTransaction *inner;
13725    /**
13726     * Indicates that this is the only struct which contains the same pointer.
13727     * Rust functions which take ownership of an object provided via an argument require
13728     * this to be true and invalidate the object pointed to by inner.
13729     */
13730    bool is_owned;
13731 } LDKTrustedClosingTransaction;
13732
13733 /**
13734  * The contents of CResult_TrustedClosingTransactionNoneZ
13735  */
13736 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
13737    /**
13738     * A pointer to the contents in the success state.
13739     * Reading from this pointer when `result_ok` is not set is undefined.
13740     */
13741    struct LDKTrustedClosingTransaction *result;
13742    /**
13743     * Note that this value is always NULL, as there are no contents in the Err variant
13744     */
13745    void *err;
13746 } LDKCResult_TrustedClosingTransactionNoneZPtr;
13747
13748 /**
13749  * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
13750  * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
13751  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13752  */
13753 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
13754    /**
13755     * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
13756     * `err` or `result` depending on the state of `result_ok`.
13757     */
13758    union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
13759    /**
13760     * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
13761     */
13762    bool result_ok;
13763 } LDKCResult_TrustedClosingTransactionNoneZ;
13764
13765 /**
13766  * The contents of CResult_CommitmentTransactionDecodeErrorZ
13767  */
13768 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
13769    /**
13770     * A pointer to the contents in the success state.
13771     * Reading from this pointer when `result_ok` is not set is undefined.
13772     */
13773    struct LDKCommitmentTransaction *result;
13774    /**
13775     * A pointer to the contents in the error state.
13776     * Reading from this pointer when `result_ok` is set is undefined.
13777     */
13778    struct LDKDecodeError *err;
13779 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
13780
13781 /**
13782  * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13783  * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13784  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13785  */
13786 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
13787    /**
13788     * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
13789     * `err` or `result` depending on the state of `result_ok`.
13790     */
13791    union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
13792    /**
13793     * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
13794     */
13795    bool result_ok;
13796 } LDKCResult_CommitmentTransactionDecodeErrorZ;
13797
13798
13799
13800 /**
13801  * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
13802  * transaction and the transaction creation keys) are trusted.
13803  *
13804  * See trust() and verify() functions on CommitmentTransaction.
13805  *
13806  * This structure implements Deref.
13807  */
13808 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
13809    /**
13810     * A pointer to the opaque Rust object.
13811     * Nearly everywhere, inner must be non-null, however in places where
13812     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13813     */
13814    LDKnativeTrustedCommitmentTransaction *inner;
13815    /**
13816     * Indicates that this is the only struct which contains the same pointer.
13817     * Rust functions which take ownership of an object provided via an argument require
13818     * this to be true and invalidate the object pointed to by inner.
13819     */
13820    bool is_owned;
13821 } LDKTrustedCommitmentTransaction;
13822
13823 /**
13824  * The contents of CResult_TrustedCommitmentTransactionNoneZ
13825  */
13826 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
13827    /**
13828     * A pointer to the contents in the success state.
13829     * Reading from this pointer when `result_ok` is not set is undefined.
13830     */
13831    struct LDKTrustedCommitmentTransaction *result;
13832    /**
13833     * Note that this value is always NULL, as there are no contents in the Err variant
13834     */
13835    void *err;
13836 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
13837
13838 /**
13839  * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
13840  * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
13841  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13842  */
13843 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
13844    /**
13845     * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
13846     * `err` or `result` depending on the state of `result_ok`.
13847     */
13848    union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
13849    /**
13850     * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
13851     */
13852    bool result_ok;
13853 } LDKCResult_TrustedCommitmentTransactionNoneZ;
13854
13855 /**
13856  * The contents of CResult_CVec_ECDSASignatureZNoneZ
13857  */
13858 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
13859    /**
13860     * A pointer to the contents in the success state.
13861     * Reading from this pointer when `result_ok` is not set is undefined.
13862     */
13863    struct LDKCVec_ECDSASignatureZ *result;
13864    /**
13865     * Note that this value is always NULL, as there are no contents in the Err variant
13866     */
13867    void *err;
13868 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
13869
13870 /**
13871  * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
13872  * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
13873  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13874  */
13875 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
13876    /**
13877     * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
13878     * `err` or `result` depending on the state of `result_ok`.
13879     */
13880    union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
13881    /**
13882     * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
13883     */
13884    bool result_ok;
13885 } LDKCResult_CVec_ECDSASignatureZNoneZ;
13886
13887 /**
13888  * An enum which can either contain a usize or not
13889  */
13890 typedef enum LDKCOption_usizeZ_Tag {
13891    /**
13892     * When we're in this state, this COption_usizeZ contains a usize
13893     */
13894    LDKCOption_usizeZ_Some,
13895    /**
13896     * When we're in this state, this COption_usizeZ contains nothing
13897     */
13898    LDKCOption_usizeZ_None,
13899    /**
13900     * Must be last for serialization purposes
13901     */
13902    LDKCOption_usizeZ_Sentinel,
13903 } LDKCOption_usizeZ_Tag;
13904
13905 typedef struct LDKCOption_usizeZ {
13906    LDKCOption_usizeZ_Tag tag;
13907    union {
13908       struct {
13909          uintptr_t some;
13910       };
13911    };
13912 } LDKCOption_usizeZ;
13913
13914 /**
13915  * The contents of CResult_ShutdownScriptDecodeErrorZ
13916  */
13917 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
13918    /**
13919     * A pointer to the contents in the success state.
13920     * Reading from this pointer when `result_ok` is not set is undefined.
13921     */
13922    struct LDKShutdownScript *result;
13923    /**
13924     * A pointer to the contents in the error state.
13925     * Reading from this pointer when `result_ok` is set is undefined.
13926     */
13927    struct LDKDecodeError *err;
13928 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
13929
13930 /**
13931  * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
13932  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
13933  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13934  */
13935 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
13936    /**
13937     * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
13938     * `err` or `result` depending on the state of `result_ok`.
13939     */
13940    union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
13941    /**
13942     * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
13943     */
13944    bool result_ok;
13945 } LDKCResult_ShutdownScriptDecodeErrorZ;
13946
13947
13948
13949 /**
13950  * An error occurring when converting from [`Script`] to [`ShutdownScript`].
13951  */
13952 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
13953    /**
13954     * A pointer to the opaque Rust object.
13955     * Nearly everywhere, inner must be non-null, however in places where
13956     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13957     */
13958    LDKnativeInvalidShutdownScript *inner;
13959    /**
13960     * Indicates that this is the only struct which contains the same pointer.
13961     * Rust functions which take ownership of an object provided via an argument require
13962     * this to be true and invalidate the object pointed to by inner.
13963     */
13964    bool is_owned;
13965 } LDKInvalidShutdownScript;
13966
13967 /**
13968  * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
13969  */
13970 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
13971    /**
13972     * A pointer to the contents in the success state.
13973     * Reading from this pointer when `result_ok` is not set is undefined.
13974     */
13975    struct LDKShutdownScript *result;
13976    /**
13977     * A pointer to the contents in the error state.
13978     * Reading from this pointer when `result_ok` is set is undefined.
13979     */
13980    struct LDKInvalidShutdownScript *err;
13981 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
13982
13983 /**
13984  * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
13985  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
13986  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13987  */
13988 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
13989    /**
13990     * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
13991     * `err` or `result` depending on the state of `result_ok`.
13992     */
13993    union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
13994    /**
13995     * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
13996     */
13997    bool result_ok;
13998 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
13999
14000 /**
14001  * Some information provided on receipt of payment depends on whether the payment received is a
14002  * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
14003  */
14004 typedef enum LDKPaymentPurpose_Tag {
14005    /**
14006     * Information for receiving a payment that we generated an invoice for.
14007     */
14008    LDKPaymentPurpose_InvoicePayment,
14009    /**
14010     * Because this is a spontaneous payment, the payer generated their own preimage rather than us
14011     * (the payee) providing a preimage.
14012     */
14013    LDKPaymentPurpose_SpontaneousPayment,
14014    /**
14015     * Must be last for serialization purposes
14016     */
14017    LDKPaymentPurpose_Sentinel,
14018 } LDKPaymentPurpose_Tag;
14019
14020 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
14021    /**
14022     * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
14023     * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
14024     * [`ChannelManager::claim_funds`].
14025     *
14026     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
14027     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14028     */
14029    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
14030    /**
14031     * The \"payment secret\". This authenticates the sender to the recipient, preventing a
14032     * number of deanonymization attacks during the routing process.
14033     * It is provided here for your reference, however its accuracy is enforced directly by
14034     * [`ChannelManager`] using the values you previously provided to
14035     * [`ChannelManager::create_inbound_payment`] or
14036     * [`ChannelManager::create_inbound_payment_for_hash`].
14037     *
14038     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14039     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
14040     * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
14041     */
14042    struct LDKThirtyTwoBytes payment_secret;
14043 } LDKPaymentPurpose_LDKInvoicePayment_Body;
14044
14045 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
14046    LDKPaymentPurpose_Tag tag;
14047    union {
14048       LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
14049       struct {
14050          struct LDKThirtyTwoBytes spontaneous_payment;
14051       };
14052    };
14053 } LDKPaymentPurpose;
14054
14055 /**
14056  * The contents of CResult_PaymentPurposeDecodeErrorZ
14057  */
14058 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
14059    /**
14060     * A pointer to the contents in the success state.
14061     * Reading from this pointer when `result_ok` is not set is undefined.
14062     */
14063    struct LDKPaymentPurpose *result;
14064    /**
14065     * A pointer to the contents in the error state.
14066     * Reading from this pointer when `result_ok` is set is undefined.
14067     */
14068    struct LDKDecodeError *err;
14069 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
14070
14071 /**
14072  * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
14073  * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
14074  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14075  */
14076 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
14077    /**
14078     * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
14079     * `err` or `result` depending on the state of `result_ok`.
14080     */
14081    union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
14082    /**
14083     * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
14084     */
14085    bool result_ok;
14086 } LDKCResult_PaymentPurposeDecodeErrorZ;
14087
14088
14089
14090 /**
14091  * Information about an HTLC that is part of a payment that can be claimed.
14092  */
14093 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
14094    /**
14095     * A pointer to the opaque Rust object.
14096     * Nearly everywhere, inner must be non-null, however in places where
14097     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14098     */
14099    LDKnativeClaimedHTLC *inner;
14100    /**
14101     * Indicates that this is the only struct which contains the same pointer.
14102     * Rust functions which take ownership of an object provided via an argument require
14103     * this to be true and invalidate the object pointed to by inner.
14104     */
14105    bool is_owned;
14106 } LDKClaimedHTLC;
14107
14108 /**
14109  * The contents of CResult_ClaimedHTLCDecodeErrorZ
14110  */
14111 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
14112    /**
14113     * A pointer to the contents in the success state.
14114     * Reading from this pointer when `result_ok` is not set is undefined.
14115     */
14116    struct LDKClaimedHTLC *result;
14117    /**
14118     * A pointer to the contents in the error state.
14119     * Reading from this pointer when `result_ok` is set is undefined.
14120     */
14121    struct LDKDecodeError *err;
14122 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
14123
14124 /**
14125  * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
14126  * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
14127  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14128  */
14129 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
14130    /**
14131     * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
14132     * `err` or `result` depending on the state of `result_ok`.
14133     */
14134    union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
14135    /**
14136     * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
14137     */
14138    bool result_ok;
14139 } LDKCResult_ClaimedHTLCDecodeErrorZ;
14140
14141 /**
14142  * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
14143  * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
14144  *
14145  * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
14146  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
14147  */
14148 typedef enum LDKPathFailure_Tag {
14149    /**
14150     * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
14151     * error.
14152     */
14153    LDKPathFailure_InitialSend,
14154    /**
14155     * A hop on the path failed to forward our payment.
14156     */
14157    LDKPathFailure_OnPath,
14158    /**
14159     * Must be last for serialization purposes
14160     */
14161    LDKPathFailure_Sentinel,
14162 } LDKPathFailure_Tag;
14163
14164 typedef struct LDKPathFailure_LDKInitialSend_Body {
14165    /**
14166     * The error surfaced from initial send.
14167     */
14168    struct LDKAPIError err;
14169 } LDKPathFailure_LDKInitialSend_Body;
14170
14171 typedef struct LDKPathFailure_LDKOnPath_Body {
14172    /**
14173     * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
14174     * decisions can take into account the update.
14175     *
14176     * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
14177     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
14178     */
14179    struct LDKCOption_NetworkUpdateZ network_update;
14180 } LDKPathFailure_LDKOnPath_Body;
14181
14182 typedef struct MUST_USE_STRUCT LDKPathFailure {
14183    LDKPathFailure_Tag tag;
14184    union {
14185       LDKPathFailure_LDKInitialSend_Body initial_send;
14186       LDKPathFailure_LDKOnPath_Body on_path;
14187    };
14188 } LDKPathFailure;
14189
14190 /**
14191  * An enum which can either contain a crate::lightning::events::PathFailure or not
14192  */
14193 typedef enum LDKCOption_PathFailureZ_Tag {
14194    /**
14195     * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
14196     */
14197    LDKCOption_PathFailureZ_Some,
14198    /**
14199     * When we're in this state, this COption_PathFailureZ contains nothing
14200     */
14201    LDKCOption_PathFailureZ_None,
14202    /**
14203     * Must be last for serialization purposes
14204     */
14205    LDKCOption_PathFailureZ_Sentinel,
14206 } LDKCOption_PathFailureZ_Tag;
14207
14208 typedef struct LDKCOption_PathFailureZ {
14209    LDKCOption_PathFailureZ_Tag tag;
14210    union {
14211       struct {
14212          struct LDKPathFailure some;
14213       };
14214    };
14215 } LDKCOption_PathFailureZ;
14216
14217 /**
14218  * The contents of CResult_COption_PathFailureZDecodeErrorZ
14219  */
14220 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
14221    /**
14222     * A pointer to the contents in the success state.
14223     * Reading from this pointer when `result_ok` is not set is undefined.
14224     */
14225    struct LDKCOption_PathFailureZ *result;
14226    /**
14227     * A pointer to the contents in the error state.
14228     * Reading from this pointer when `result_ok` is set is undefined.
14229     */
14230    struct LDKDecodeError *err;
14231 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
14232
14233 /**
14234  * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
14235  * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14236  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14237  */
14238 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
14239    /**
14240     * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
14241     * `err` or `result` depending on the state of `result_ok`.
14242     */
14243    union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
14244    /**
14245     * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
14246     */
14247    bool result_ok;
14248 } LDKCResult_COption_PathFailureZDecodeErrorZ;
14249
14250
14251
14252 /**
14253  * Struct to `Display` fields in a safe way using `PrintableString`
14254  */
14255 typedef struct MUST_USE_STRUCT LDKUntrustedString {
14256    /**
14257     * A pointer to the opaque Rust object.
14258     * Nearly everywhere, inner must be non-null, however in places where
14259     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14260     */
14261    LDKnativeUntrustedString *inner;
14262    /**
14263     * Indicates that this is the only struct which contains the same pointer.
14264     * Rust functions which take ownership of an object provided via an argument require
14265     * this to be true and invalidate the object pointed to by inner.
14266     */
14267    bool is_owned;
14268 } LDKUntrustedString;
14269
14270 /**
14271  * The reason the channel was closed. See individual variants for more details.
14272  */
14273 typedef enum LDKClosureReason_Tag {
14274    /**
14275     * Closure generated from receiving a peer error message.
14276     *
14277     * Our counterparty may have broadcasted their latest commitment state, and we have
14278     * as well.
14279     */
14280    LDKClosureReason_CounterpartyForceClosed,
14281    /**
14282     * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
14283     *
14284     * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
14285     */
14286    LDKClosureReason_HolderForceClosed,
14287    /**
14288     * The channel was closed after negotiating a cooperative close and we've now broadcasted
14289     * the cooperative close transaction. Note the shutdown may have been initiated by us.
14290     */
14291    LDKClosureReason_CooperativeClosure,
14292    /**
14293     * A commitment transaction was confirmed on chain, closing the channel. Most likely this
14294     * commitment transaction came from our counterparty, but it may also have come from
14295     * a copy of our own `ChannelMonitor`.
14296     */
14297    LDKClosureReason_CommitmentTxConfirmed,
14298    /**
14299     * The funding transaction failed to confirm in a timely manner on an inbound channel.
14300     */
14301    LDKClosureReason_FundingTimedOut,
14302    /**
14303     * Closure generated from processing an event, likely a HTLC forward/relay/reception.
14304     */
14305    LDKClosureReason_ProcessingError,
14306    /**
14307     * The peer disconnected prior to funding completing. In this case the spec mandates that we
14308     * forget the channel entirely - we can attempt again if the peer reconnects.
14309     *
14310     * This includes cases where we restarted prior to funding completion, including prior to the
14311     * initial [`ChannelMonitor`] persistence completing.
14312     *
14313     * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
14314     * peer because of mutual incompatibility between us and our channel counterparty.
14315     *
14316     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
14317     */
14318    LDKClosureReason_DisconnectedPeer,
14319    /**
14320     * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
14321     * the [`ChannelManager`] deserialized.
14322     *
14323     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
14324     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14325     */
14326    LDKClosureReason_OutdatedChannelManager,
14327    /**
14328     * The counterparty requested a cooperative close of a channel that had not been funded yet.
14329     * The channel has been immediately closed.
14330     */
14331    LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
14332    /**
14333     * Another channel in the same funding batch closed before the funding transaction
14334     * was ready to be broadcast.
14335     */
14336    LDKClosureReason_FundingBatchClosure,
14337    /**
14338     * Must be last for serialization purposes
14339     */
14340    LDKClosureReason_Sentinel,
14341 } LDKClosureReason_Tag;
14342
14343 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
14344    /**
14345     * The error which the peer sent us.
14346     *
14347     * Be careful about printing the peer_msg, a well-crafted message could exploit
14348     * a security vulnerability in the terminal emulator or the logging subsystem.
14349     * To be safe, use `Display` on `UntrustedString`
14350     *
14351     * [`UntrustedString`]: crate::util::string::UntrustedString
14352     */
14353    struct LDKUntrustedString peer_msg;
14354 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
14355
14356 typedef struct LDKClosureReason_LDKProcessingError_Body {
14357    /**
14358     * A developer-readable error message which we generated.
14359     */
14360    struct LDKStr err;
14361 } LDKClosureReason_LDKProcessingError_Body;
14362
14363 typedef struct MUST_USE_STRUCT LDKClosureReason {
14364    LDKClosureReason_Tag tag;
14365    union {
14366       LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
14367       LDKClosureReason_LDKProcessingError_Body processing_error;
14368    };
14369 } LDKClosureReason;
14370
14371 /**
14372  * An enum which can either contain a crate::lightning::events::ClosureReason or not
14373  */
14374 typedef enum LDKCOption_ClosureReasonZ_Tag {
14375    /**
14376     * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
14377     */
14378    LDKCOption_ClosureReasonZ_Some,
14379    /**
14380     * When we're in this state, this COption_ClosureReasonZ contains nothing
14381     */
14382    LDKCOption_ClosureReasonZ_None,
14383    /**
14384     * Must be last for serialization purposes
14385     */
14386    LDKCOption_ClosureReasonZ_Sentinel,
14387 } LDKCOption_ClosureReasonZ_Tag;
14388
14389 typedef struct LDKCOption_ClosureReasonZ {
14390    LDKCOption_ClosureReasonZ_Tag tag;
14391    union {
14392       struct {
14393          struct LDKClosureReason some;
14394       };
14395    };
14396 } LDKCOption_ClosureReasonZ;
14397
14398 /**
14399  * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
14400  */
14401 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
14402    /**
14403     * A pointer to the contents in the success state.
14404     * Reading from this pointer when `result_ok` is not set is undefined.
14405     */
14406    struct LDKCOption_ClosureReasonZ *result;
14407    /**
14408     * A pointer to the contents in the error state.
14409     * Reading from this pointer when `result_ok` is set is undefined.
14410     */
14411    struct LDKDecodeError *err;
14412 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
14413
14414 /**
14415  * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
14416  * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14417  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14418  */
14419 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
14420    /**
14421     * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
14422     * `err` or `result` depending on the state of `result_ok`.
14423     */
14424    union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
14425    /**
14426     * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
14427     */
14428    bool result_ok;
14429 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
14430
14431 /**
14432  * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
14433  */
14434 typedef enum LDKHTLCDestination_Tag {
14435    /**
14436     * We tried forwarding to a channel but failed to do so. An example of such an instance is when
14437     * there is insufficient capacity in our outbound channel.
14438     */
14439    LDKHTLCDestination_NextHopChannel,
14440    /**
14441     * Scenario where we are unsure of the next node to forward the HTLC to.
14442     */
14443    LDKHTLCDestination_UnknownNextHop,
14444    /**
14445     * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
14446     * intercept HTLC.
14447     */
14448    LDKHTLCDestination_InvalidForward,
14449    /**
14450     * Failure scenario where an HTLC may have been forwarded to be intended for us,
14451     * but is invalid for some reason, so we reject it.
14452     *
14453     * Some of the reasons may include:
14454     * * HTLC Timeouts
14455     * * Excess HTLCs for a payment that we have already fully received, over-paying for the
14456     *   payment,
14457     * * The counterparty node modified the HTLC in transit,
14458     * * A probing attack where an intermediary node is trying to detect if we are the ultimate
14459     *   recipient for a payment.
14460     */
14461    LDKHTLCDestination_FailedPayment,
14462    /**
14463     * Must be last for serialization purposes
14464     */
14465    LDKHTLCDestination_Sentinel,
14466 } LDKHTLCDestination_Tag;
14467
14468 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
14469    /**
14470     * The `node_id` of the next node. For backwards compatibility, this field is
14471     * marked as optional, versions prior to 0.0.110 may not always be able to provide
14472     * counterparty node information.
14473     *
14474     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14475     */
14476    struct LDKPublicKey node_id;
14477    /**
14478     * The outgoing `channel_id` between us and the next node.
14479     */
14480    struct LDKThirtyTwoBytes channel_id;
14481 } LDKHTLCDestination_LDKNextHopChannel_Body;
14482
14483 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
14484    /**
14485     * Short channel id we are requesting to forward an HTLC to.
14486     */
14487    uint64_t requested_forward_scid;
14488 } LDKHTLCDestination_LDKUnknownNextHop_Body;
14489
14490 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
14491    /**
14492     * Short channel id we are requesting to forward an HTLC to.
14493     */
14494    uint64_t requested_forward_scid;
14495 } LDKHTLCDestination_LDKInvalidForward_Body;
14496
14497 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
14498    /**
14499     * The payment hash of the payment we attempted to process.
14500     */
14501    struct LDKThirtyTwoBytes payment_hash;
14502 } LDKHTLCDestination_LDKFailedPayment_Body;
14503
14504 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
14505    LDKHTLCDestination_Tag tag;
14506    union {
14507       LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
14508       LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
14509       LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
14510       LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
14511    };
14512 } LDKHTLCDestination;
14513
14514 /**
14515  * An enum which can either contain a crate::lightning::events::HTLCDestination or not
14516  */
14517 typedef enum LDKCOption_HTLCDestinationZ_Tag {
14518    /**
14519     * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
14520     */
14521    LDKCOption_HTLCDestinationZ_Some,
14522    /**
14523     * When we're in this state, this COption_HTLCDestinationZ contains nothing
14524     */
14525    LDKCOption_HTLCDestinationZ_None,
14526    /**
14527     * Must be last for serialization purposes
14528     */
14529    LDKCOption_HTLCDestinationZ_Sentinel,
14530 } LDKCOption_HTLCDestinationZ_Tag;
14531
14532 typedef struct LDKCOption_HTLCDestinationZ {
14533    LDKCOption_HTLCDestinationZ_Tag tag;
14534    union {
14535       struct {
14536          struct LDKHTLCDestination some;
14537       };
14538    };
14539 } LDKCOption_HTLCDestinationZ;
14540
14541 /**
14542  * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
14543  */
14544 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
14545    /**
14546     * A pointer to the contents in the success state.
14547     * Reading from this pointer when `result_ok` is not set is undefined.
14548     */
14549    struct LDKCOption_HTLCDestinationZ *result;
14550    /**
14551     * A pointer to the contents in the error state.
14552     * Reading from this pointer when `result_ok` is set is undefined.
14553     */
14554    struct LDKDecodeError *err;
14555 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
14556
14557 /**
14558  * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
14559  * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14560  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14561  */
14562 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
14563    /**
14564     * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
14565     * `err` or `result` depending on the state of `result_ok`.
14566     */
14567    union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
14568    /**
14569     * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
14570     */
14571    bool result_ok;
14572 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
14573
14574 /**
14575  * The contents of CResult_PaymentFailureReasonDecodeErrorZ
14576  */
14577 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
14578    /**
14579     * A pointer to the contents in the success state.
14580     * Reading from this pointer when `result_ok` is not set is undefined.
14581     */
14582    enum LDKPaymentFailureReason *result;
14583    /**
14584     * A pointer to the contents in the error state.
14585     * Reading from this pointer when `result_ok` is set is undefined.
14586     */
14587    struct LDKDecodeError *err;
14588 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
14589
14590 /**
14591  * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
14592  * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
14593  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14594  */
14595 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
14596    /**
14597     * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
14598     * `err` or `result` depending on the state of `result_ok`.
14599     */
14600    union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
14601    /**
14602     * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
14603     */
14604    bool result_ok;
14605 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
14606
14607 /**
14608  * An enum which can either contain a crate::c_types::U128 or not
14609  */
14610 typedef enum LDKCOption_U128Z_Tag {
14611    /**
14612     * When we're in this state, this COption_U128Z contains a crate::c_types::U128
14613     */
14614    LDKCOption_U128Z_Some,
14615    /**
14616     * When we're in this state, this COption_U128Z contains nothing
14617     */
14618    LDKCOption_U128Z_None,
14619    /**
14620     * Must be last for serialization purposes
14621     */
14622    LDKCOption_U128Z_Sentinel,
14623 } LDKCOption_U128Z_Tag;
14624
14625 typedef struct LDKCOption_U128Z {
14626    LDKCOption_U128Z_Tag tag;
14627    union {
14628       struct {
14629          struct LDKU128 some;
14630       };
14631    };
14632 } LDKCOption_U128Z;
14633
14634 /**
14635  * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
14636  * This corresponds to std::vector in C++
14637  */
14638 typedef struct LDKCVec_ClaimedHTLCZ {
14639    /**
14640     * The elements in the array.
14641     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14642     */
14643    struct LDKClaimedHTLC *data;
14644    /**
14645     * The number of elements pointed to by `data`.
14646     */
14647    uintptr_t datalen;
14648 } LDKCVec_ClaimedHTLCZ;
14649
14650 /**
14651  * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
14652  */
14653 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
14654    /**
14655     * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
14656     */
14657    LDKCOption_PaymentFailureReasonZ_Some,
14658    /**
14659     * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
14660     */
14661    LDKCOption_PaymentFailureReasonZ_None,
14662    /**
14663     * Must be last for serialization purposes
14664     */
14665    LDKCOption_PaymentFailureReasonZ_Sentinel,
14666 } LDKCOption_PaymentFailureReasonZ_Tag;
14667
14668 typedef struct LDKCOption_PaymentFailureReasonZ {
14669    LDKCOption_PaymentFailureReasonZ_Tag tag;
14670    union {
14671       struct {
14672          enum LDKPaymentFailureReason some;
14673       };
14674    };
14675 } LDKCOption_PaymentFailureReasonZ;
14676
14677
14678
14679 /**
14680  * A descriptor used to sign for a commitment transaction's anchor output.
14681  */
14682 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
14683    /**
14684     * A pointer to the opaque Rust object.
14685     * Nearly everywhere, inner must be non-null, however in places where
14686     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14687     */
14688    LDKnativeAnchorDescriptor *inner;
14689    /**
14690     * Indicates that this is the only struct which contains the same pointer.
14691     * Rust functions which take ownership of an object provided via an argument require
14692     * this to be true and invalidate the object pointed to by inner.
14693     */
14694    bool is_owned;
14695 } LDKAnchorDescriptor;
14696
14697 /**
14698  * Represents the different types of transactions, originating from LDK, to be bumped.
14699  */
14700 typedef enum LDKBumpTransactionEvent_Tag {
14701    /**
14702     * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
14703     * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
14704     * they may need additional fees to be attached through a child transaction using the popular
14705     * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
14706     * child transaction must include the anchor input described within `anchor_descriptor` along
14707     * with additional inputs to meet the target feerate. Failure to meet the target feerate
14708     * decreases the confirmation odds of the transaction package (which includes the commitment
14709     * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
14710     * is constructed, it must be fully signed for and broadcast by the consumer of the event
14711     * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
14712     * broadcast first, as the child anchor transaction depends on it.
14713     *
14714     * The consumer should be able to sign for any of the additional inputs included within the
14715     * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
14716     * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
14717     * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
14718     * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
14719     * full witness required to spend.
14720     *
14721     * It is possible to receive more than one instance of this event if a valid child anchor
14722     * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
14723     * be taken by the consumer of the event to ensure any future iterations of the child anchor
14724     * transaction adhere to the [Replace-By-Fee
14725     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
14726     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
14727     * these events is not user-controlled, users may ignore/drop the event if they are no longer
14728     * able to commit external confirmed funds to the child anchor transaction.
14729     *
14730     * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
14731     * determine whether a significant portion of the channel's funds are allocated to HTLCs,
14732     * enabling users to make their own decisions regarding the importance of the commitment
14733     * transaction's confirmation. Note that this is not required, but simply exists as an option
14734     * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
14735     * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
14736     * be not urgent.
14737     *
14738     * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
14739     * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::EcdsaChannelSigner::sign_holder_anchor_input
14740     * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
14741     */
14742    LDKBumpTransactionEvent_ChannelClose,
14743    /**
14744     * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
14745     * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
14746     * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
14747     * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
14748     * for a timely confirmation within the chain. These additional inputs and/or outputs must be
14749     * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
14750     * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
14751     * loss of funds. Once the transaction meets the target feerate, it must be signed for and
14752     * broadcast by the consumer of the event.
14753     *
14754     * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
14755     * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
14756     * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
14757     * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
14758     * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
14759     * to spend.
14760     *
14761     * It is possible to receive more than one instance of this event if a valid HTLC transaction
14762     * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
14763     * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
14764     * the [Replace-By-Fee
14765     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
14766     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
14767     * these events is not user-controlled, users may ignore/drop the event if either they are no
14768     * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
14769     * to the HTLC transaction is greater in value than the HTLCs being claimed.
14770     *
14771     * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
14772     * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::EcdsaChannelSigner::sign_holder_htlc_transaction
14773     */
14774    LDKBumpTransactionEvent_HTLCResolution,
14775    /**
14776     * Must be last for serialization purposes
14777     */
14778    LDKBumpTransactionEvent_Sentinel,
14779 } LDKBumpTransactionEvent_Tag;
14780
14781 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
14782    /**
14783     * The unique identifier for the claim of the anchor output in the commitment transaction.
14784     *
14785     * The identifier must map to the set of external UTXOs assigned to the claim, such that
14786     * they can be reused when a new claim with the same identifier needs to be made, resulting
14787     * in a fee-bumping attempt.
14788     */
14789    struct LDKThirtyTwoBytes claim_id;
14790    /**
14791     * The target feerate that the transaction package, which consists of the commitment
14792     * transaction and the to-be-crafted child anchor transaction, must meet.
14793     */
14794    uint32_t package_target_feerate_sat_per_1000_weight;
14795    /**
14796     * The channel's commitment transaction to bump the fee of. This transaction should be
14797     * broadcast along with the anchor transaction constructed as a result of consuming this
14798     * event.
14799     */
14800    struct LDKTransaction commitment_tx;
14801    /**
14802     * The absolute fee in satoshis of the commitment transaction. This can be used along the
14803     * with weight of the commitment transaction to determine its feerate.
14804     */
14805    uint64_t commitment_tx_fee_satoshis;
14806    /**
14807     * The descriptor to sign the anchor input of the anchor transaction constructed as a
14808     * result of consuming this event.
14809     */
14810    struct LDKAnchorDescriptor anchor_descriptor;
14811    /**
14812     * The set of pending HTLCs on the commitment transaction that need to be resolved once the
14813     * commitment transaction confirms.
14814     */
14815    struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
14816 } LDKBumpTransactionEvent_LDKChannelClose_Body;
14817
14818 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
14819    /**
14820     * The unique identifier for the claim of the HTLCs in the confirmed commitment
14821     * transaction.
14822     *
14823     * The identifier must map to the set of external UTXOs assigned to the claim, such that
14824     * they can be reused when a new claim with the same identifier needs to be made, resulting
14825     * in a fee-bumping attempt.
14826     */
14827    struct LDKThirtyTwoBytes claim_id;
14828    /**
14829     * The target feerate that the resulting HTLC transaction must meet.
14830     */
14831    uint32_t target_feerate_sat_per_1000_weight;
14832    /**
14833     * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
14834     * by the same transaction.
14835     */
14836    struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
14837    /**
14838     * The locktime required for the resulting HTLC transaction.
14839     */
14840    uint32_t tx_lock_time;
14841 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
14842
14843 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
14844    LDKBumpTransactionEvent_Tag tag;
14845    union {
14846       LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
14847       LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
14848    };
14849 } LDKBumpTransactionEvent;
14850
14851 /**
14852  * An Event which you should probably take some action in response to.
14853  *
14854  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
14855  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
14856  * written as it makes no sense to respond to it after reconnecting to peers).
14857  */
14858 typedef enum LDKEvent_Tag {
14859    /**
14860     * Used to indicate that the client should generate a funding transaction with the given
14861     * parameters and then call [`ChannelManager::funding_transaction_generated`].
14862     * Generated in [`ChannelManager`] message handling.
14863     * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
14864     * counterparty can steal your funds!
14865     *
14866     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14867     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14868     */
14869    LDKEvent_FundingGenerationReady,
14870    /**
14871     * Indicates that we've been offered a payment and it needs to be claimed via calling
14872     * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
14873     *
14874     * Note that if the preimage is not known, you should call
14875     * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
14876     * to free up resources for this HTLC and avoid network congestion.
14877     *
14878     * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
14879     * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
14880     * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
14881     * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
14882     * If you don't intend to check for custom TLVs, you can simply use
14883     * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
14884     *
14885     * If you fail to call [`ChannelManager::claim_funds`],
14886     * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
14887     * [`ChannelManager::fail_htlc_backwards`], or
14888     * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
14889     * be automatically failed.
14890     *
14891     * # Note
14892     * LDK will not stop an inbound payment from being paid multiple times, so multiple
14893     * `PaymentClaimable` events may be generated for the same payment. In such a case it is
14894     * polite (and required in the lightning specification) to fail the payment the second time
14895     * and give the sender their money back rather than accepting double payment.
14896     *
14897     * # Note
14898     * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
14899     *
14900     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14901     * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
14902     * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
14903     * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
14904     * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
14905     */
14906    LDKEvent_PaymentClaimable,
14907    /**
14908     * Indicates a payment has been claimed and we've received money!
14909     *
14910     * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
14911     * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
14912     * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
14913     * [`Event::PaymentClaimable`] event.
14914     *
14915     * # Note
14916     * LDK will not stop an inbound payment from being paid multiple times, so multiple
14917     * `PaymentClaimable` events may be generated for the same payment. If you then call
14918     * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
14919     * multiple `PaymentClaimed` events.
14920     *
14921     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14922     */
14923    LDKEvent_PaymentClaimed,
14924    /**
14925     * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
14926     * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
14927     * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
14928     *
14929     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14930     * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
14931     * [`Offer`]: crate::offers::offer::Offer
14932     * [`Refund`]: crate::offers::refund::Refund
14933     */
14934    LDKEvent_InvoiceRequestFailed,
14935    /**
14936     * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
14937     * and we got back the payment preimage for it).
14938     *
14939     * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
14940     * event. In this situation, you SHOULD treat this payment as having succeeded.
14941     */
14942    LDKEvent_PaymentSent,
14943    /**
14944     * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
14945     * provide failure information for each path attempt in the payment, including retries.
14946     *
14947     * This event is provided once there are no further pending HTLCs for the payment and the
14948     * payment is no longer retryable, due either to the [`Retry`] provided or
14949     * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
14950     *
14951     * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
14952     * a payment after an [`Event::PaymentSent`] event for this same payment has already been
14953     * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
14954     * and the payment MUST be treated as having succeeded.
14955     *
14956     * [`Retry`]: crate::ln::channelmanager::Retry
14957     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14958     */
14959    LDKEvent_PaymentFailed,
14960    /**
14961     * Indicates that a path for an outbound payment was successful.
14962     *
14963     * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
14964     * [`Event::PaymentSent`] for obtaining the payment preimage.
14965     */
14966    LDKEvent_PaymentPathSuccessful,
14967    /**
14968     * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
14969     * handle the HTLC.
14970     *
14971     * Note that this does *not* indicate that all paths for an MPP payment have failed, see
14972     * [`Event::PaymentFailed`].
14973     *
14974     * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
14975     * been exhausted.
14976     *
14977     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14978     */
14979    LDKEvent_PaymentPathFailed,
14980    /**
14981     * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
14982     */
14983    LDKEvent_ProbeSuccessful,
14984    /**
14985     * Indicates that a probe payment we sent failed at an intermediary node on the path.
14986     */
14987    LDKEvent_ProbeFailed,
14988    /**
14989     * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
14990     * a time in the future.
14991     *
14992     * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
14993     */
14994    LDKEvent_PendingHTLCsForwardable,
14995    /**
14996     * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
14997     * you've encoded an intercept scid in the receiver's invoice route hints using
14998     * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
14999     *
15000     * [`ChannelManager::forward_intercepted_htlc`] or
15001     * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
15002     * their docs for more information.
15003     *
15004     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
15005     * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
15006     * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
15007     * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
15008     */
15009    LDKEvent_HTLCIntercepted,
15010    /**
15011     * Used to indicate that an output which you should know how to spend was confirmed on chain
15012     * and is now spendable.
15013     * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
15014     * counterparty spending them due to some kind of timeout. Thus, you need to store them
15015     * somewhere and spend them when you create on-chain transactions.
15016     */
15017    LDKEvent_SpendableOutputs,
15018    /**
15019     * This event is generated when a payment has been successfully forwarded through us and a
15020     * forwarding fee earned.
15021     */
15022    LDKEvent_PaymentForwarded,
15023    /**
15024     * Used to indicate that a channel with the given `channel_id` is being opened and pending
15025     * confirmation on-chain.
15026     *
15027     * This event is emitted when the funding transaction has been signed and is broadcast to the
15028     * network. For 0conf channels it will be immediately followed by the corresponding
15029     * [`Event::ChannelReady`] event.
15030     */
15031    LDKEvent_ChannelPending,
15032    /**
15033     * Used to indicate that a channel with the given `channel_id` is ready to
15034     * be used. This event is emitted either when the funding transaction has been confirmed
15035     * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
15036     * establishment.
15037     */
15038    LDKEvent_ChannelReady,
15039    /**
15040     * Used to indicate that a previously opened channel with the given `channel_id` is in the
15041     * process of closure.
15042     *
15043     * Note that this event is only triggered for accepted channels: if the
15044     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
15045     * rejected, no `ChannelClosed` event will be sent.
15046     *
15047     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15048     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15049     */
15050    LDKEvent_ChannelClosed,
15051    /**
15052     * Used to indicate to the user that they can abandon the funding transaction and recycle the
15053     * inputs for another purpose.
15054     *
15055     * This event is not guaranteed to be generated for channels that are closed due to a restart.
15056     */
15057    LDKEvent_DiscardFunding,
15058    /**
15059     * Indicates a request to open a new channel by a peer.
15060     *
15061     * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
15062     * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
15063     * event will _not_ be triggered if the channel is rejected.
15064     *
15065     * The event is only triggered when a new open channel request is received and the
15066     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
15067     *
15068     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15069     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15070     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15071     */
15072    LDKEvent_OpenChannelRequest,
15073    /**
15074     * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
15075     * forward it.
15076     *
15077     * Some scenarios where this event may be sent include:
15078     * * Insufficient capacity in the outbound channel
15079     * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
15080     * * When an unknown SCID is requested for forwarding a payment.
15081     * * Expected MPP amount has already been reached
15082     * * The HTLC has timed out
15083     *
15084     * This event, however, does not get generated if an HTLC fails to meet the forwarding
15085     * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
15086     */
15087    LDKEvent_HTLCHandlingFailed,
15088    /**
15089     * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
15090     * requires confirmed external funds to be readily available to spend.
15091     *
15092     * LDK does not currently generate this event unless the
15093     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
15094     * It is limited to the scope of channels with anchor outputs.
15095     *
15096     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
15097     */
15098    LDKEvent_BumpTransaction,
15099    /**
15100     * Must be last for serialization purposes
15101     */
15102    LDKEvent_Sentinel,
15103 } LDKEvent_Tag;
15104
15105 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
15106    /**
15107     * The random channel_id we picked which you'll need to pass into
15108     * [`ChannelManager::funding_transaction_generated`].
15109     *
15110     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
15111     */
15112    struct LDKThirtyTwoBytes temporary_channel_id;
15113    /**
15114     * The counterparty's node_id, which you'll need to pass back into
15115     * [`ChannelManager::funding_transaction_generated`].
15116     *
15117     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
15118     */
15119    struct LDKPublicKey counterparty_node_id;
15120    /**
15121     * The value, in satoshis, that the output should have.
15122     */
15123    uint64_t channel_value_satoshis;
15124    /**
15125     * The script which should be used in the transaction output.
15126     */
15127    struct LDKCVec_u8Z output_script;
15128    /**
15129     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15130     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15131     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15132     * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
15133     * serialized with LDK versions prior to 0.0.113.
15134     *
15135     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15136     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15137     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15138     */
15139    struct LDKU128 user_channel_id;
15140 } LDKEvent_LDKFundingGenerationReady_Body;
15141
15142 typedef struct LDKEvent_LDKPaymentClaimable_Body {
15143    /**
15144     * The node that will receive the payment after it has been claimed.
15145     * This is useful to identify payments received via [phantom nodes].
15146     * This field will always be filled in when the event was generated by LDK versions
15147     * 0.0.113 and above.
15148     *
15149     * [phantom nodes]: crate::sign::PhantomKeysManager
15150     *
15151     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15152     */
15153    struct LDKPublicKey receiver_node_id;
15154    /**
15155     * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
15156     * not stop you from registering duplicate payment hashes for inbound payments.
15157     */
15158    struct LDKThirtyTwoBytes payment_hash;
15159    /**
15160     * The fields in the onion which were received with each HTLC. Only fields which were
15161     * identical in each HTLC involved in the payment will be included here.
15162     *
15163     * Payments received on LDK versions prior to 0.0.115 will have this field unset.
15164     *
15165     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15166     */
15167    struct LDKRecipientOnionFields onion_fields;
15168    /**
15169     * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
15170     * than the invoice amount.
15171     *
15172     * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
15173     * and the previous hop took an extra fee.
15174     *
15175     * # Note
15176     * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
15177     * field, you may lose money!
15178     *
15179     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
15180     */
15181    uint64_t amount_msat;
15182    /**
15183     * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
15184     * taken by our channel counterparty.
15185     *
15186     * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
15187     *
15188     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
15189     */
15190    uint64_t counterparty_skimmed_fee_msat;
15191    /**
15192     * Information for claiming this received payment, based on whether the purpose of the
15193     * payment is to pay an invoice or to send a spontaneous payment.
15194     */
15195    struct LDKPaymentPurpose purpose;
15196    /**
15197     * The `channel_id` indicating over which channel we received the payment.
15198     */
15199    struct LDKCOption_ThirtyTwoBytesZ via_channel_id;
15200    /**
15201     * The `user_channel_id` indicating over which channel we received the payment.
15202     */
15203    struct LDKCOption_U128Z via_user_channel_id;
15204    /**
15205     * The block height at which this payment will be failed back and will no longer be
15206     * eligible for claiming.
15207     *
15208     * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
15209     * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
15210     *
15211     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
15212     */
15213    struct LDKCOption_u32Z claim_deadline;
15214 } LDKEvent_LDKPaymentClaimable_Body;
15215
15216 typedef struct LDKEvent_LDKPaymentClaimed_Body {
15217    /**
15218     * The node that received the payment.
15219     * This is useful to identify payments which were received via [phantom nodes].
15220     * This field will always be filled in when the event was generated by LDK versions
15221     * 0.0.113 and above.
15222     *
15223     * [phantom nodes]: crate::sign::PhantomKeysManager
15224     *
15225     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15226     */
15227    struct LDKPublicKey receiver_node_id;
15228    /**
15229     * The payment hash of the claimed payment. Note that LDK will not stop you from
15230     * registering duplicate payment hashes for inbound payments.
15231     */
15232    struct LDKThirtyTwoBytes payment_hash;
15233    /**
15234     * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
15235     * invoice amount.
15236     */
15237    uint64_t amount_msat;
15238    /**
15239     * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
15240     * spontaneous payment.
15241     */
15242    struct LDKPaymentPurpose purpose;
15243    /**
15244     * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
15245     * to LDK version 0.0.117.
15246     */
15247    struct LDKCVec_ClaimedHTLCZ htlcs;
15248    /**
15249     * The sender-intended sum total of all the MPP parts. This will be `None` for events
15250     * serialized prior to LDK version 0.0.117.
15251     */
15252    struct LDKCOption_u64Z sender_intended_total_msat;
15253 } LDKEvent_LDKPaymentClaimed_Body;
15254
15255 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
15256    /**
15257     * The `payment_id` to have been associated with payment for the requested invoice.
15258     */
15259    struct LDKThirtyTwoBytes payment_id;
15260 } LDKEvent_LDKInvoiceRequestFailed_Body;
15261
15262 typedef struct LDKEvent_LDKPaymentSent_Body {
15263    /**
15264     * The `payment_id` passed to [`ChannelManager::send_payment`].
15265     *
15266     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15267     */
15268    struct LDKCOption_ThirtyTwoBytesZ payment_id;
15269    /**
15270     * The preimage to the hash given to ChannelManager::send_payment.
15271     * Note that this serves as a payment receipt, if you wish to have such a thing, you must
15272     * store it somehow!
15273     */
15274    struct LDKThirtyTwoBytes payment_preimage;
15275    /**
15276     * The hash that was given to [`ChannelManager::send_payment`].
15277     *
15278     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15279     */
15280    struct LDKThirtyTwoBytes payment_hash;
15281    /**
15282     * The total fee which was spent at intermediate hops in this payment, across all paths.
15283     *
15284     * Note that, like [`Route::get_total_fees`] this does *not* include any potential
15285     * overpayment to the recipient node.
15286     *
15287     * If the recipient or an intermediate node misbehaves and gives us free money, this may
15288     * overstate the amount paid, though this is unlikely.
15289     *
15290     * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
15291     */
15292    struct LDKCOption_u64Z fee_paid_msat;
15293 } LDKEvent_LDKPaymentSent_Body;
15294
15295 typedef struct LDKEvent_LDKPaymentFailed_Body {
15296    /**
15297     * The `payment_id` passed to [`ChannelManager::send_payment`].
15298     *
15299     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15300     */
15301    struct LDKThirtyTwoBytes payment_id;
15302    /**
15303     * The hash that was given to [`ChannelManager::send_payment`].
15304     *
15305     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15306     */
15307    struct LDKThirtyTwoBytes payment_hash;
15308    /**
15309     * The reason the payment failed. This is only `None` for events generated or serialized
15310     * by versions prior to 0.0.115.
15311     */
15312    struct LDKCOption_PaymentFailureReasonZ reason;
15313 } LDKEvent_LDKPaymentFailed_Body;
15314
15315 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
15316    /**
15317     * The `payment_id` passed to [`ChannelManager::send_payment`].
15318     *
15319     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15320     */
15321    struct LDKThirtyTwoBytes payment_id;
15322    /**
15323     * The hash that was given to [`ChannelManager::send_payment`].
15324     *
15325     * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
15326     *
15327     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15328     */
15329    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
15330    /**
15331     * The payment path that was successful.
15332     *
15333     * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
15334     */
15335    struct LDKPath path;
15336 } LDKEvent_LDKPaymentPathSuccessful_Body;
15337
15338 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
15339    /**
15340     * The `payment_id` passed to [`ChannelManager::send_payment`].
15341     *
15342     * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
15343     *
15344     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15345     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
15346     */
15347    struct LDKCOption_ThirtyTwoBytesZ payment_id;
15348    /**
15349     * The hash that was given to [`ChannelManager::send_payment`].
15350     *
15351     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15352     */
15353    struct LDKThirtyTwoBytes payment_hash;
15354    /**
15355     * Indicates the payment was rejected for some reason by the recipient. This implies that
15356     * the payment has failed, not just the route in question. If this is not set, the payment may
15357     * be retried via a different route.
15358     */
15359    bool payment_failed_permanently;
15360    /**
15361     * Extra error details based on the failure type. May contain an update that needs to be
15362     * applied to the [`NetworkGraph`].
15363     *
15364     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
15365     */
15366    struct LDKPathFailure failure;
15367    /**
15368     * The payment path that failed.
15369     */
15370    struct LDKPath path;
15371    /**
15372     * The channel responsible for the failed payment path.
15373     *
15374     * Note that for route hints or for the first hop in a path this may be an SCID alias and
15375     * may not refer to a channel in the public network graph. These aliases may also collide
15376     * with channels in the public network graph.
15377     *
15378     * If this is `Some`, then the corresponding channel should be avoided when the payment is
15379     * retried. May be `None` for older [`Event`] serializations.
15380     */
15381    struct LDKCOption_u64Z short_channel_id;
15382 } LDKEvent_LDKPaymentPathFailed_Body;
15383
15384 typedef struct LDKEvent_LDKProbeSuccessful_Body {
15385    /**
15386     * The id returned by [`ChannelManager::send_probe`].
15387     *
15388     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15389     */
15390    struct LDKThirtyTwoBytes payment_id;
15391    /**
15392     * The hash generated by [`ChannelManager::send_probe`].
15393     *
15394     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15395     */
15396    struct LDKThirtyTwoBytes payment_hash;
15397    /**
15398     * The payment path that was successful.
15399     */
15400    struct LDKPath path;
15401 } LDKEvent_LDKProbeSuccessful_Body;
15402
15403 typedef struct LDKEvent_LDKProbeFailed_Body {
15404    /**
15405     * The id returned by [`ChannelManager::send_probe`].
15406     *
15407     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15408     */
15409    struct LDKThirtyTwoBytes payment_id;
15410    /**
15411     * The hash generated by [`ChannelManager::send_probe`].
15412     *
15413     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15414     */
15415    struct LDKThirtyTwoBytes payment_hash;
15416    /**
15417     * The payment path that failed.
15418     */
15419    struct LDKPath path;
15420    /**
15421     * The channel responsible for the failed probe.
15422     *
15423     * Note that for route hints or for the first hop in a path this may be an SCID alias and
15424     * may not refer to a channel in the public network graph. These aliases may also collide
15425     * with channels in the public network graph.
15426     */
15427    struct LDKCOption_u64Z short_channel_id;
15428 } LDKEvent_LDKProbeFailed_Body;
15429
15430 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
15431    /**
15432     * The minimum amount of time that should be waited prior to calling
15433     * process_pending_htlc_forwards. To increase the effort required to correlate payments,
15434     * you should wait a random amount of time in roughly the range (now + time_forwardable,
15435     * now + 5*time_forwardable).
15436     */
15437    uint64_t time_forwardable;
15438 } LDKEvent_LDKPendingHTLCsForwardable_Body;
15439
15440 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
15441    /**
15442     * An id to help LDK identify which HTLC is being forwarded or failed.
15443     */
15444    struct LDKThirtyTwoBytes intercept_id;
15445    /**
15446     * The fake scid that was programmed as the next hop's scid, generated using
15447     * [`ChannelManager::get_intercept_scid`].
15448     *
15449     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
15450     */
15451    uint64_t requested_next_hop_scid;
15452    /**
15453     * The payment hash used for this HTLC.
15454     */
15455    struct LDKThirtyTwoBytes payment_hash;
15456    /**
15457     * How many msats were received on the inbound edge of this HTLC.
15458     */
15459    uint64_t inbound_amount_msat;
15460    /**
15461     * How many msats the payer intended to route to the next node. Depending on the reason you are
15462     * intercepting this payment, you might take a fee by forwarding less than this amount.
15463     * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
15464     *
15465     * Note that LDK will NOT check that expected fees were factored into this value. You MUST
15466     * check that whatever fee you want has been included here or subtract it as required. Further,
15467     * LDK will not stop you from forwarding more than you received.
15468     */
15469    uint64_t expected_outbound_amount_msat;
15470 } LDKEvent_LDKHTLCIntercepted_Body;
15471
15472 typedef struct LDKEvent_LDKSpendableOutputs_Body {
15473    /**
15474     * The outputs which you should store as spendable by you.
15475     */
15476    struct LDKCVec_SpendableOutputDescriptorZ outputs;
15477    /**
15478     * The `channel_id` indicating which channel the spendable outputs belong to.
15479     *
15480     * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
15481     */
15482    struct LDKCOption_ThirtyTwoBytesZ channel_id;
15483 } LDKEvent_LDKSpendableOutputs_Body;
15484
15485 typedef struct LDKEvent_LDKPaymentForwarded_Body {
15486    /**
15487     * The incoming channel between the previous node and us. This is only `None` for events
15488     * generated or serialized by versions prior to 0.0.107.
15489     */
15490    struct LDKCOption_ThirtyTwoBytesZ prev_channel_id;
15491    /**
15492     * The outgoing channel between the next node and us. This is only `None` for events
15493     * generated or serialized by versions prior to 0.0.107.
15494     */
15495    struct LDKCOption_ThirtyTwoBytesZ next_channel_id;
15496    /**
15497     * The fee, in milli-satoshis, which was earned as a result of the payment.
15498     *
15499     * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
15500     * was pending, the amount the next hop claimed will have been rounded down to the nearest
15501     * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
15502     * claimed the full value in millisatoshis from the source. In this case,
15503     * `claim_from_onchain_tx` will be set.
15504     *
15505     * If the channel which sent us the payment has been force-closed, we will claim the funds
15506     * via an on-chain transaction. In that case we do not yet know the on-chain transaction
15507     * fees which we will spend and will instead set this to `None`. It is possible duplicate
15508     * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
15509     * `None`.
15510     */
15511    struct LDKCOption_u64Z fee_earned_msat;
15512    /**
15513     * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
15514     * transaction.
15515     */
15516    bool claim_from_onchain_tx;
15517    /**
15518     * The final amount forwarded, in milli-satoshis, after the fee is deducted.
15519     *
15520     * The caveat described above the `fee_earned_msat` field applies here as well.
15521     */
15522    struct LDKCOption_u64Z outbound_amount_forwarded_msat;
15523 } LDKEvent_LDKPaymentForwarded_Body;
15524
15525 typedef struct LDKEvent_LDKChannelPending_Body {
15526    /**
15527     * The `channel_id` of the channel that is pending confirmation.
15528     */
15529    struct LDKThirtyTwoBytes channel_id;
15530    /**
15531     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15532     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15533     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15534     * `user_channel_id` will be randomized for an inbound channel.
15535     *
15536     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15537     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15538     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15539     */
15540    struct LDKU128 user_channel_id;
15541    /**
15542     * The `temporary_channel_id` this channel used to be known by during channel establishment.
15543     *
15544     * Will be `None` for channels created prior to LDK version 0.0.115.
15545     */
15546    struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id;
15547    /**
15548     * The `node_id` of the channel counterparty.
15549     */
15550    struct LDKPublicKey counterparty_node_id;
15551    /**
15552     * The outpoint of the channel's funding transaction.
15553     */
15554    struct LDKOutPoint funding_txo;
15555 } LDKEvent_LDKChannelPending_Body;
15556
15557 typedef struct LDKEvent_LDKChannelReady_Body {
15558    /**
15559     * The `channel_id` of the channel that is ready.
15560     */
15561    struct LDKThirtyTwoBytes channel_id;
15562    /**
15563     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15564     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15565     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15566     * `user_channel_id` will be randomized for an inbound channel.
15567     *
15568     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15569     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15570     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15571     */
15572    struct LDKU128 user_channel_id;
15573    /**
15574     * The `node_id` of the channel counterparty.
15575     */
15576    struct LDKPublicKey counterparty_node_id;
15577    /**
15578     * The features that this channel will operate with.
15579     */
15580    struct LDKChannelTypeFeatures channel_type;
15581 } LDKEvent_LDKChannelReady_Body;
15582
15583 typedef struct LDKEvent_LDKChannelClosed_Body {
15584    /**
15585     * The `channel_id` of the channel which has been closed. Note that on-chain transactions
15586     * resolving the channel are likely still awaiting confirmation.
15587     */
15588    struct LDKThirtyTwoBytes channel_id;
15589    /**
15590     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15591     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15592     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15593     * `user_channel_id` will be randomized for inbound channels.
15594     * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
15595     * zero for objects serialized with LDK versions prior to 0.0.102.
15596     *
15597     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15598     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15599     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15600     */
15601    struct LDKU128 user_channel_id;
15602    /**
15603     * The reason the channel was closed.
15604     */
15605    struct LDKClosureReason reason;
15606    /**
15607     * Counterparty in the closed channel.
15608     *
15609     * This field will be `None` for objects serialized prior to LDK 0.0.117.
15610     *
15611     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15612     */
15613    struct LDKPublicKey counterparty_node_id;
15614    /**
15615     * Channel capacity of the closing channel (sats).
15616     *
15617     * This field will be `None` for objects serialized prior to LDK 0.0.117.
15618     */
15619    struct LDKCOption_u64Z channel_capacity_sats;
15620 } LDKEvent_LDKChannelClosed_Body;
15621
15622 typedef struct LDKEvent_LDKDiscardFunding_Body {
15623    /**
15624     * The channel_id of the channel which has been closed.
15625     */
15626    struct LDKThirtyTwoBytes channel_id;
15627    /**
15628     * The full transaction received from the user
15629     */
15630    struct LDKTransaction transaction;
15631 } LDKEvent_LDKDiscardFunding_Body;
15632
15633 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
15634    /**
15635     * The temporary channel ID of the channel requested to be opened.
15636     *
15637     * When responding to the request, the `temporary_channel_id` should be passed
15638     * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
15639     * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
15640     *
15641     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15642     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15643     */
15644    struct LDKThirtyTwoBytes temporary_channel_id;
15645    /**
15646     * The node_id of the counterparty requesting to open the channel.
15647     *
15648     * When responding to the request, the `counterparty_node_id` should be passed
15649     * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
15650     * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
15651     * request.
15652     *
15653     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15654     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15655     */
15656    struct LDKPublicKey counterparty_node_id;
15657    /**
15658     * The channel value of the requested channel.
15659     */
15660    uint64_t funding_satoshis;
15661    /**
15662     * Our starting balance in the channel if the request is accepted, in milli-satoshi.
15663     */
15664    uint64_t push_msat;
15665    /**
15666     * The features that this channel will operate with. If you reject the channel, a
15667     * well-behaved counterparty may automatically re-attempt the channel with a new set of
15668     * feature flags.
15669     *
15670     * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
15671     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
15672     * 0.0.106.
15673     *
15674     * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
15675     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
15676     * 0.0.107. Channels setting this type also need to get manually accepted via
15677     * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
15678     * or will be rejected otherwise.
15679     *
15680     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15681     */
15682    struct LDKChannelTypeFeatures channel_type;
15683 } LDKEvent_LDKOpenChannelRequest_Body;
15684
15685 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
15686    /**
15687     * The channel over which the HTLC was received.
15688     */
15689    struct LDKThirtyTwoBytes prev_channel_id;
15690    /**
15691     * Destination of the HTLC that failed to be processed.
15692     */
15693    struct LDKHTLCDestination failed_next_destination;
15694 } LDKEvent_LDKHTLCHandlingFailed_Body;
15695
15696 typedef struct MUST_USE_STRUCT LDKEvent {
15697    LDKEvent_Tag tag;
15698    union {
15699       LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
15700       LDKEvent_LDKPaymentClaimable_Body payment_claimable;
15701       LDKEvent_LDKPaymentClaimed_Body payment_claimed;
15702       LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
15703       LDKEvent_LDKPaymentSent_Body payment_sent;
15704       LDKEvent_LDKPaymentFailed_Body payment_failed;
15705       LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
15706       LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
15707       LDKEvent_LDKProbeSuccessful_Body probe_successful;
15708       LDKEvent_LDKProbeFailed_Body probe_failed;
15709       LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
15710       LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
15711       LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
15712       LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
15713       LDKEvent_LDKChannelPending_Body channel_pending;
15714       LDKEvent_LDKChannelReady_Body channel_ready;
15715       LDKEvent_LDKChannelClosed_Body channel_closed;
15716       LDKEvent_LDKDiscardFunding_Body discard_funding;
15717       LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
15718       LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
15719       struct {
15720          struct LDKBumpTransactionEvent bump_transaction;
15721       };
15722    };
15723 } LDKEvent;
15724
15725 /**
15726  * An enum which can either contain a crate::lightning::events::Event or not
15727  */
15728 typedef enum LDKCOption_EventZ_Tag {
15729    /**
15730     * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
15731     */
15732    LDKCOption_EventZ_Some,
15733    /**
15734     * When we're in this state, this COption_EventZ contains nothing
15735     */
15736    LDKCOption_EventZ_None,
15737    /**
15738     * Must be last for serialization purposes
15739     */
15740    LDKCOption_EventZ_Sentinel,
15741 } LDKCOption_EventZ_Tag;
15742
15743 typedef struct LDKCOption_EventZ {
15744    LDKCOption_EventZ_Tag tag;
15745    union {
15746       struct {
15747          struct LDKEvent some;
15748       };
15749    };
15750 } LDKCOption_EventZ;
15751
15752 /**
15753  * The contents of CResult_COption_EventZDecodeErrorZ
15754  */
15755 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
15756    /**
15757     * A pointer to the contents in the success state.
15758     * Reading from this pointer when `result_ok` is not set is undefined.
15759     */
15760    struct LDKCOption_EventZ *result;
15761    /**
15762     * A pointer to the contents in the error state.
15763     * Reading from this pointer when `result_ok` is set is undefined.
15764     */
15765    struct LDKDecodeError *err;
15766 } LDKCResult_COption_EventZDecodeErrorZPtr;
15767
15768 /**
15769  * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
15770  * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15771  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15772  */
15773 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
15774    /**
15775     * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
15776     * `err` or `result` depending on the state of `result_ok`.
15777     */
15778    union LDKCResult_COption_EventZDecodeErrorZPtr contents;
15779    /**
15780     * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
15781     */
15782    bool result_ok;
15783 } LDKCResult_COption_EventZDecodeErrorZ;
15784
15785 /**
15786  * Sub-errors which don't have specific information in them use this type.
15787  */
15788 typedef struct LDKError {
15789    /**
15790     * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
15791     */
15792    uint8_t _dummy;
15793 } LDKError;
15794
15795 /**
15796  * Errors that indicate what is wrong with the invoice. They have some granularity for debug
15797  * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
15798  */
15799 typedef enum LDKBolt11ParseError_Tag {
15800    LDKBolt11ParseError_Bech32Error,
15801    LDKBolt11ParseError_ParseAmountError,
15802    LDKBolt11ParseError_MalformedSignature,
15803    LDKBolt11ParseError_BadPrefix,
15804    LDKBolt11ParseError_UnknownCurrency,
15805    LDKBolt11ParseError_UnknownSiPrefix,
15806    LDKBolt11ParseError_MalformedHRP,
15807    LDKBolt11ParseError_TooShortDataPart,
15808    LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
15809    LDKBolt11ParseError_DescriptionDecodeError,
15810    LDKBolt11ParseError_PaddingError,
15811    LDKBolt11ParseError_IntegerOverflowError,
15812    LDKBolt11ParseError_InvalidSegWitProgramLength,
15813    LDKBolt11ParseError_InvalidPubKeyHashLength,
15814    LDKBolt11ParseError_InvalidScriptHashLength,
15815    LDKBolt11ParseError_InvalidRecoveryId,
15816    LDKBolt11ParseError_InvalidSliceLength,
15817    /**
15818     * Not an error, but used internally to signal that a part of the invoice should be ignored
15819     * according to BOLT11
15820     */
15821    LDKBolt11ParseError_Skip,
15822    /**
15823     * Must be last for serialization purposes
15824     */
15825    LDKBolt11ParseError_Sentinel,
15826 } LDKBolt11ParseError_Tag;
15827
15828 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
15829    LDKBolt11ParseError_Tag tag;
15830    union {
15831       struct {
15832          struct LDKBech32Error bech32_error;
15833       };
15834       struct {
15835          struct LDKError parse_amount_error;
15836       };
15837       struct {
15838          enum LDKSecp256k1Error malformed_signature;
15839       };
15840       struct {
15841          struct LDKError description_decode_error;
15842       };
15843       struct {
15844          struct LDKStr invalid_slice_length;
15845       };
15846    };
15847 } LDKBolt11ParseError;
15848
15849 /**
15850  * The contents of CResult_SiPrefixBolt11ParseErrorZ
15851  */
15852 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
15853    /**
15854     * A pointer to the contents in the success state.
15855     * Reading from this pointer when `result_ok` is not set is undefined.
15856     */
15857    enum LDKSiPrefix *result;
15858    /**
15859     * A pointer to the contents in the error state.
15860     * Reading from this pointer when `result_ok` is set is undefined.
15861     */
15862    struct LDKBolt11ParseError *err;
15863 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
15864
15865 /**
15866  * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
15867  * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15868  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15869  */
15870 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
15871    /**
15872     * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
15873     * `err` or `result` depending on the state of `result_ok`.
15874     */
15875    union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
15876    /**
15877     * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
15878     */
15879    bool result_ok;
15880 } LDKCResult_SiPrefixBolt11ParseErrorZ;
15881
15882 /**
15883  * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
15884  * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
15885  * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
15886  */
15887 typedef enum LDKParseOrSemanticError_Tag {
15888    /**
15889     * The invoice couldn't be decoded
15890     */
15891    LDKParseOrSemanticError_ParseError,
15892    /**
15893     * The invoice could be decoded but violates the BOLT11 standard
15894     */
15895    LDKParseOrSemanticError_SemanticError,
15896    /**
15897     * Must be last for serialization purposes
15898     */
15899    LDKParseOrSemanticError_Sentinel,
15900 } LDKParseOrSemanticError_Tag;
15901
15902 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
15903    LDKParseOrSemanticError_Tag tag;
15904    union {
15905       struct {
15906          struct LDKBolt11ParseError parse_error;
15907       };
15908       struct {
15909          enum LDKBolt11SemanticError semantic_error;
15910       };
15911    };
15912 } LDKParseOrSemanticError;
15913
15914 /**
15915  * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
15916  */
15917 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
15918    /**
15919     * A pointer to the contents in the success state.
15920     * Reading from this pointer when `result_ok` is not set is undefined.
15921     */
15922    struct LDKBolt11Invoice *result;
15923    /**
15924     * A pointer to the contents in the error state.
15925     * Reading from this pointer when `result_ok` is set is undefined.
15926     */
15927    struct LDKParseOrSemanticError *err;
15928 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
15929
15930 /**
15931  * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
15932  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
15933  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15934  */
15935 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
15936    /**
15937     * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
15938     * `err` or `result` depending on the state of `result_ok`.
15939     */
15940    union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
15941    /**
15942     * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
15943     */
15944    bool result_ok;
15945 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
15946
15947
15948
15949 /**
15950  * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
15951  * invalid.
15952  *
15953  * # Invariants
15954  * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
15955  */
15956 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
15957    /**
15958     * A pointer to the opaque Rust object.
15959     * Nearly everywhere, inner must be non-null, however in places where
15960     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15961     */
15962    LDKnativeSignedRawBolt11Invoice *inner;
15963    /**
15964     * Indicates that this is the only struct which contains the same pointer.
15965     * Rust functions which take ownership of an object provided via an argument require
15966     * this to be true and invalidate the object pointed to by inner.
15967     */
15968    bool is_owned;
15969 } LDKSignedRawBolt11Invoice;
15970
15971 /**
15972  * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
15973  */
15974 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
15975    /**
15976     * A pointer to the contents in the success state.
15977     * Reading from this pointer when `result_ok` is not set is undefined.
15978     */
15979    struct LDKSignedRawBolt11Invoice *result;
15980    /**
15981     * A pointer to the contents in the error state.
15982     * Reading from this pointer when `result_ok` is set is undefined.
15983     */
15984    struct LDKBolt11ParseError *err;
15985 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
15986
15987 /**
15988  * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
15989  * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15990  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15991  */
15992 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
15993    /**
15994     * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
15995     * `err` or `result` depending on the state of `result_ok`.
15996     */
15997    union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
15998    /**
15999     * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
16000     */
16001    bool result_ok;
16002 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
16003
16004
16005
16006 /**
16007  * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
16008  * but without the signature information.
16009  * Decoding and encoding should not lead to information loss but may lead to different hashes.
16010  *
16011  * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
16012  */
16013 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
16014    /**
16015     * A pointer to the opaque Rust object.
16016     * Nearly everywhere, inner must be non-null, however in places where
16017     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16018     */
16019    LDKnativeRawBolt11Invoice *inner;
16020    /**
16021     * Indicates that this is the only struct which contains the same pointer.
16022     * Rust functions which take ownership of an object provided via an argument require
16023     * this to be true and invalidate the object pointed to by inner.
16024     */
16025    bool is_owned;
16026 } LDKRawBolt11Invoice;
16027
16028
16029
16030 /**
16031  * Recoverable signature
16032  */
16033 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
16034    /**
16035     * A pointer to the opaque Rust object.
16036     * Nearly everywhere, inner must be non-null, however in places where
16037     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16038     */
16039    LDKnativeBolt11InvoiceSignature *inner;
16040    /**
16041     * Indicates that this is the only struct which contains the same pointer.
16042     * Rust functions which take ownership of an object provided via an argument require
16043     * this to be true and invalidate the object pointed to by inner.
16044     */
16045    bool is_owned;
16046 } LDKBolt11InvoiceSignature;
16047
16048 /**
16049  * A tuple of 3 elements. See the individual fields for the types contained.
16050  */
16051 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
16052    /**
16053     * The element at position 0
16054     */
16055    struct LDKRawBolt11Invoice a;
16056    /**
16057     * The element at position 1
16058     */
16059    struct LDKThirtyTwoBytes b;
16060    /**
16061     * The element at position 2
16062     */
16063    struct LDKBolt11InvoiceSignature c;
16064 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
16065
16066
16067
16068 /**
16069  * Payee public key
16070  */
16071 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
16072    /**
16073     * A pointer to the opaque Rust object.
16074     * Nearly everywhere, inner must be non-null, however in places where
16075     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16076     */
16077    LDKnativePayeePubKey *inner;
16078    /**
16079     * Indicates that this is the only struct which contains the same pointer.
16080     * Rust functions which take ownership of an object provided via an argument require
16081     * this to be true and invalidate the object pointed to by inner.
16082     */
16083    bool is_owned;
16084 } LDKPayeePubKey;
16085
16086 /**
16087  * The contents of CResult_PayeePubKeySecp256k1ErrorZ
16088  */
16089 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
16090    /**
16091     * A pointer to the contents in the success state.
16092     * Reading from this pointer when `result_ok` is not set is undefined.
16093     */
16094    struct LDKPayeePubKey *result;
16095    /**
16096     * A pointer to the contents in the error state.
16097     * Reading from this pointer when `result_ok` is set is undefined.
16098     */
16099    enum LDKSecp256k1Error *err;
16100 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
16101
16102 /**
16103  * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
16104  * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
16105  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16106  */
16107 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
16108    /**
16109     * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
16110     * `err` or `result` depending on the state of `result_ok`.
16111     */
16112    union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
16113    /**
16114     * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
16115     */
16116    bool result_ok;
16117 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
16118
16119
16120
16121 /**
16122  * Private routing information
16123  *
16124  * # Invariants
16125  * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
16126  *
16127  */
16128 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
16129    /**
16130     * A pointer to the opaque Rust object.
16131     * Nearly everywhere, inner must be non-null, however in places where
16132     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16133     */
16134    LDKnativePrivateRoute *inner;
16135    /**
16136     * Indicates that this is the only struct which contains the same pointer.
16137     * Rust functions which take ownership of an object provided via an argument require
16138     * this to be true and invalidate the object pointed to by inner.
16139     */
16140    bool is_owned;
16141 } LDKPrivateRoute;
16142
16143 /**
16144  * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
16145  * This corresponds to std::vector in C++
16146  */
16147 typedef struct LDKCVec_PrivateRouteZ {
16148    /**
16149     * The elements in the array.
16150     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16151     */
16152    struct LDKPrivateRoute *data;
16153    /**
16154     * The number of elements pointed to by `data`.
16155     */
16156    uintptr_t datalen;
16157 } LDKCVec_PrivateRouteZ;
16158
16159
16160
16161 /**
16162  * A timestamp that refers to a date after 1 January 1970.
16163  *
16164  * # Invariants
16165  *
16166  * The Unix timestamp representing the stored time has to be positive and no greater than
16167  * [`MAX_TIMESTAMP`].
16168  */
16169 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
16170    /**
16171     * A pointer to the opaque Rust object.
16172     * Nearly everywhere, inner must be non-null, however in places where
16173     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16174     */
16175    LDKnativePositiveTimestamp *inner;
16176    /**
16177     * Indicates that this is the only struct which contains the same pointer.
16178     * Rust functions which take ownership of an object provided via an argument require
16179     * this to be true and invalidate the object pointed to by inner.
16180     */
16181    bool is_owned;
16182 } LDKPositiveTimestamp;
16183
16184 /**
16185  * The contents of CResult_PositiveTimestampCreationErrorZ
16186  */
16187 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
16188    /**
16189     * A pointer to the contents in the success state.
16190     * Reading from this pointer when `result_ok` is not set is undefined.
16191     */
16192    struct LDKPositiveTimestamp *result;
16193    /**
16194     * A pointer to the contents in the error state.
16195     * Reading from this pointer when `result_ok` is set is undefined.
16196     */
16197    enum LDKCreationError *err;
16198 } LDKCResult_PositiveTimestampCreationErrorZPtr;
16199
16200 /**
16201  * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
16202  * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
16203  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16204  */
16205 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
16206    /**
16207     * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
16208     * `err` or `result` depending on the state of `result_ok`.
16209     */
16210    union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
16211    /**
16212     * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
16213     */
16214    bool result_ok;
16215 } LDKCResult_PositiveTimestampCreationErrorZ;
16216
16217 /**
16218  * The contents of CResult_NoneBolt11SemanticErrorZ
16219  */
16220 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
16221    /**
16222     * Note that this value is always NULL, as there are no contents in the OK variant
16223     */
16224    void *result;
16225    /**
16226     * A pointer to the contents in the error state.
16227     * Reading from this pointer when `result_ok` is set is undefined.
16228     */
16229    enum LDKBolt11SemanticError *err;
16230 } LDKCResult_NoneBolt11SemanticErrorZPtr;
16231
16232 /**
16233  * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
16234  * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
16235  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16236  */
16237 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
16238    /**
16239     * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
16240     * `err` or `result` depending on the state of `result_ok`.
16241     */
16242    union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
16243    /**
16244     * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
16245     */
16246    bool result_ok;
16247 } LDKCResult_NoneBolt11SemanticErrorZ;
16248
16249 /**
16250  * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
16251  */
16252 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
16253    /**
16254     * A pointer to the contents in the success state.
16255     * Reading from this pointer when `result_ok` is not set is undefined.
16256     */
16257    struct LDKBolt11Invoice *result;
16258    /**
16259     * A pointer to the contents in the error state.
16260     * Reading from this pointer when `result_ok` is set is undefined.
16261     */
16262    enum LDKBolt11SemanticError *err;
16263 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
16264
16265 /**
16266  * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
16267  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
16268  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16269  */
16270 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
16271    /**
16272     * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
16273     * `err` or `result` depending on the state of `result_ok`.
16274     */
16275    union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
16276    /**
16277     * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
16278     */
16279    bool result_ok;
16280 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
16281
16282
16283
16284 /**
16285  * Description string
16286  *
16287  * # Invariants
16288  * The description can be at most 639 __bytes__ long
16289  */
16290 typedef struct MUST_USE_STRUCT LDKDescription {
16291    /**
16292     * A pointer to the opaque Rust object.
16293     * Nearly everywhere, inner must be non-null, however in places where
16294     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16295     */
16296    LDKnativeDescription *inner;
16297    /**
16298     * Indicates that this is the only struct which contains the same pointer.
16299     * Rust functions which take ownership of an object provided via an argument require
16300     * this to be true and invalidate the object pointed to by inner.
16301     */
16302    bool is_owned;
16303 } LDKDescription;
16304
16305 /**
16306  * The contents of CResult_DescriptionCreationErrorZ
16307  */
16308 typedef union LDKCResult_DescriptionCreationErrorZPtr {
16309    /**
16310     * A pointer to the contents in the success state.
16311     * Reading from this pointer when `result_ok` is not set is undefined.
16312     */
16313    struct LDKDescription *result;
16314    /**
16315     * A pointer to the contents in the error state.
16316     * Reading from this pointer when `result_ok` is set is undefined.
16317     */
16318    enum LDKCreationError *err;
16319 } LDKCResult_DescriptionCreationErrorZPtr;
16320
16321 /**
16322  * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
16323  * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
16324  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16325  */
16326 typedef struct LDKCResult_DescriptionCreationErrorZ {
16327    /**
16328     * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
16329     * `err` or `result` depending on the state of `result_ok`.
16330     */
16331    union LDKCResult_DescriptionCreationErrorZPtr contents;
16332    /**
16333     * Whether this CResult_DescriptionCreationErrorZ represents a success state.
16334     */
16335    bool result_ok;
16336 } LDKCResult_DescriptionCreationErrorZ;
16337
16338 /**
16339  * The contents of CResult_PrivateRouteCreationErrorZ
16340  */
16341 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
16342    /**
16343     * A pointer to the contents in the success state.
16344     * Reading from this pointer when `result_ok` is not set is undefined.
16345     */
16346    struct LDKPrivateRoute *result;
16347    /**
16348     * A pointer to the contents in the error state.
16349     * Reading from this pointer when `result_ok` is set is undefined.
16350     */
16351    enum LDKCreationError *err;
16352 } LDKCResult_PrivateRouteCreationErrorZPtr;
16353
16354 /**
16355  * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
16356  * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
16357  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16358  */
16359 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
16360    /**
16361     * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
16362     * `err` or `result` depending on the state of `result_ok`.
16363     */
16364    union LDKCResult_PrivateRouteCreationErrorZPtr contents;
16365    /**
16366     * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
16367     */
16368    bool result_ok;
16369 } LDKCResult_PrivateRouteCreationErrorZ;
16370
16371 /**
16372  * The contents of CResult_OutPointDecodeErrorZ
16373  */
16374 typedef union LDKCResult_OutPointDecodeErrorZPtr {
16375    /**
16376     * A pointer to the contents in the success state.
16377     * Reading from this pointer when `result_ok` is not set is undefined.
16378     */
16379    struct LDKOutPoint *result;
16380    /**
16381     * A pointer to the contents in the error state.
16382     * Reading from this pointer when `result_ok` is set is undefined.
16383     */
16384    struct LDKDecodeError *err;
16385 } LDKCResult_OutPointDecodeErrorZPtr;
16386
16387 /**
16388  * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
16389  * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
16390  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16391  */
16392 typedef struct LDKCResult_OutPointDecodeErrorZ {
16393    /**
16394     * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
16395     * `err` or `result` depending on the state of `result_ok`.
16396     */
16397    union LDKCResult_OutPointDecodeErrorZPtr contents;
16398    /**
16399     * Whether this CResult_OutPointDecodeErrorZ represents a success state.
16400     */
16401    bool result_ok;
16402 } LDKCResult_OutPointDecodeErrorZ;
16403
16404
16405
16406 /**
16407  * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
16408  * variable-length integers except that it is serialized in big-endian instead of little-endian.
16409  *
16410  * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
16411  * encoded in several different ways, which we must check for at deserialization-time. Thus, if
16412  * you're looking for an example of a variable-length integer to use for your own project, move
16413  * along, this is a rather poor design.
16414  */
16415 typedef struct MUST_USE_STRUCT LDKBigSize {
16416    /**
16417     * A pointer to the opaque Rust object.
16418     * Nearly everywhere, inner must be non-null, however in places where
16419     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16420     */
16421    LDKnativeBigSize *inner;
16422    /**
16423     * Indicates that this is the only struct which contains the same pointer.
16424     * Rust functions which take ownership of an object provided via an argument require
16425     * this to be true and invalidate the object pointed to by inner.
16426     */
16427    bool is_owned;
16428 } LDKBigSize;
16429
16430 /**
16431  * The contents of CResult_BigSizeDecodeErrorZ
16432  */
16433 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
16434    /**
16435     * A pointer to the contents in the success state.
16436     * Reading from this pointer when `result_ok` is not set is undefined.
16437     */
16438    struct LDKBigSize *result;
16439    /**
16440     * A pointer to the contents in the error state.
16441     * Reading from this pointer when `result_ok` is set is undefined.
16442     */
16443    struct LDKDecodeError *err;
16444 } LDKCResult_BigSizeDecodeErrorZPtr;
16445
16446 /**
16447  * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
16448  * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
16449  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16450  */
16451 typedef struct LDKCResult_BigSizeDecodeErrorZ {
16452    /**
16453     * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
16454     * `err` or `result` depending on the state of `result_ok`.
16455     */
16456    union LDKCResult_BigSizeDecodeErrorZPtr contents;
16457    /**
16458     * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
16459     */
16460    bool result_ok;
16461 } LDKCResult_BigSizeDecodeErrorZ;
16462
16463 /**
16464  * The contents of CResult_HostnameDecodeErrorZ
16465  */
16466 typedef union LDKCResult_HostnameDecodeErrorZPtr {
16467    /**
16468     * A pointer to the contents in the success state.
16469     * Reading from this pointer when `result_ok` is not set is undefined.
16470     */
16471    struct LDKHostname *result;
16472    /**
16473     * A pointer to the contents in the error state.
16474     * Reading from this pointer when `result_ok` is set is undefined.
16475     */
16476    struct LDKDecodeError *err;
16477 } LDKCResult_HostnameDecodeErrorZPtr;
16478
16479 /**
16480  * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
16481  * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
16482  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16483  */
16484 typedef struct LDKCResult_HostnameDecodeErrorZ {
16485    /**
16486     * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
16487     * `err` or `result` depending on the state of `result_ok`.
16488     */
16489    union LDKCResult_HostnameDecodeErrorZPtr contents;
16490    /**
16491     * Whether this CResult_HostnameDecodeErrorZ represents a success state.
16492     */
16493    bool result_ok;
16494 } LDKCResult_HostnameDecodeErrorZ;
16495
16496
16497
16498 /**
16499  * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
16500  * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
16501  *
16502  * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
16503  */
16504 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
16505    /**
16506     * A pointer to the opaque Rust object.
16507     * Nearly everywhere, inner must be non-null, however in places where
16508     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16509     */
16510    LDKnativeTransactionU16LenLimited *inner;
16511    /**
16512     * Indicates that this is the only struct which contains the same pointer.
16513     * Rust functions which take ownership of an object provided via an argument require
16514     * this to be true and invalidate the object pointed to by inner.
16515     */
16516    bool is_owned;
16517 } LDKTransactionU16LenLimited;
16518
16519 /**
16520  * The contents of CResult_TransactionU16LenLimitedNoneZ
16521  */
16522 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
16523    /**
16524     * A pointer to the contents in the success state.
16525     * Reading from this pointer when `result_ok` is not set is undefined.
16526     */
16527    struct LDKTransactionU16LenLimited *result;
16528    /**
16529     * Note that this value is always NULL, as there are no contents in the Err variant
16530     */
16531    void *err;
16532 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
16533
16534 /**
16535  * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
16536  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
16537  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16538  */
16539 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
16540    /**
16541     * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
16542     * `err` or `result` depending on the state of `result_ok`.
16543     */
16544    union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
16545    /**
16546     * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
16547     */
16548    bool result_ok;
16549 } LDKCResult_TransactionU16LenLimitedNoneZ;
16550
16551 /**
16552  * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
16553  */
16554 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
16555    /**
16556     * A pointer to the contents in the success state.
16557     * Reading from this pointer when `result_ok` is not set is undefined.
16558     */
16559    struct LDKTransactionU16LenLimited *result;
16560    /**
16561     * A pointer to the contents in the error state.
16562     * Reading from this pointer when `result_ok` is set is undefined.
16563     */
16564    struct LDKDecodeError *err;
16565 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
16566
16567 /**
16568  * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
16569  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
16570  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16571  */
16572 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
16573    /**
16574     * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
16575     * `err` or `result` depending on the state of `result_ok`.
16576     */
16577    union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
16578    /**
16579     * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
16580     */
16581    bool result_ok;
16582 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
16583
16584 /**
16585  * The contents of CResult_UntrustedStringDecodeErrorZ
16586  */
16587 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
16588    /**
16589     * A pointer to the contents in the success state.
16590     * Reading from this pointer when `result_ok` is not set is undefined.
16591     */
16592    struct LDKUntrustedString *result;
16593    /**
16594     * A pointer to the contents in the error state.
16595     * Reading from this pointer when `result_ok` is set is undefined.
16596     */
16597    struct LDKDecodeError *err;
16598 } LDKCResult_UntrustedStringDecodeErrorZPtr;
16599
16600 /**
16601  * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
16602  * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
16603  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16604  */
16605 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
16606    /**
16607     * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
16608     * `err` or `result` depending on the state of `result_ok`.
16609     */
16610    union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
16611    /**
16612     * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
16613     */
16614    bool result_ok;
16615 } LDKCResult_UntrustedStringDecodeErrorZ;
16616
16617
16618
16619 /**
16620  * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
16621  * may not be valid if received by another lightning implementation.
16622  */
16623 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
16624    /**
16625     * A pointer to the opaque Rust object.
16626     * Nearly everywhere, inner must be non-null, however in places where
16627     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16628     */
16629    LDKnativeReceiveTlvs *inner;
16630    /**
16631     * Indicates that this is the only struct which contains the same pointer.
16632     * Rust functions which take ownership of an object provided via an argument require
16633     * this to be true and invalidate the object pointed to by inner.
16634     */
16635    bool is_owned;
16636 } LDKReceiveTlvs;
16637
16638 /**
16639  * The contents of CResult_ReceiveTlvsDecodeErrorZ
16640  */
16641 typedef union LDKCResult_ReceiveTlvsDecodeErrorZPtr {
16642    /**
16643     * A pointer to the contents in the success state.
16644     * Reading from this pointer when `result_ok` is not set is undefined.
16645     */
16646    struct LDKReceiveTlvs *result;
16647    /**
16648     * A pointer to the contents in the error state.
16649     * Reading from this pointer when `result_ok` is set is undefined.
16650     */
16651    struct LDKDecodeError *err;
16652 } LDKCResult_ReceiveTlvsDecodeErrorZPtr;
16653
16654 /**
16655  * A CResult_ReceiveTlvsDecodeErrorZ represents the result of a fallible operation,
16656  * containing a crate::lightning::blinded_path::payment::ReceiveTlvs on success and a crate::lightning::ln::msgs::DecodeError on failure.
16657  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16658  */
16659 typedef struct LDKCResult_ReceiveTlvsDecodeErrorZ {
16660    /**
16661     * The contents of this CResult_ReceiveTlvsDecodeErrorZ, accessible via either
16662     * `err` or `result` depending on the state of `result_ok`.
16663     */
16664    union LDKCResult_ReceiveTlvsDecodeErrorZPtr contents;
16665    /**
16666     * Whether this CResult_ReceiveTlvsDecodeErrorZ represents a success state.
16667     */
16668    bool result_ok;
16669 } LDKCResult_ReceiveTlvsDecodeErrorZ;
16670
16671
16672
16673 /**
16674  * Parameters for relaying over a given [`BlindedHop`].
16675  *
16676  * [`BlindedHop`]: crate::blinded_path::BlindedHop
16677  */
16678 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
16679    /**
16680     * A pointer to the opaque Rust object.
16681     * Nearly everywhere, inner must be non-null, however in places where
16682     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16683     */
16684    LDKnativePaymentRelay *inner;
16685    /**
16686     * Indicates that this is the only struct which contains the same pointer.
16687     * Rust functions which take ownership of an object provided via an argument require
16688     * this to be true and invalidate the object pointed to by inner.
16689     */
16690    bool is_owned;
16691 } LDKPaymentRelay;
16692
16693 /**
16694  * The contents of CResult_PaymentRelayDecodeErrorZ
16695  */
16696 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
16697    /**
16698     * A pointer to the contents in the success state.
16699     * Reading from this pointer when `result_ok` is not set is undefined.
16700     */
16701    struct LDKPaymentRelay *result;
16702    /**
16703     * A pointer to the contents in the error state.
16704     * Reading from this pointer when `result_ok` is set is undefined.
16705     */
16706    struct LDKDecodeError *err;
16707 } LDKCResult_PaymentRelayDecodeErrorZPtr;
16708
16709 /**
16710  * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
16711  * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
16712  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16713  */
16714 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
16715    /**
16716     * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
16717     * `err` or `result` depending on the state of `result_ok`.
16718     */
16719    union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
16720    /**
16721     * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
16722     */
16723    bool result_ok;
16724 } LDKCResult_PaymentRelayDecodeErrorZ;
16725
16726
16727
16728 /**
16729  * Constraints for relaying over a given [`BlindedHop`].
16730  *
16731  * [`BlindedHop`]: crate::blinded_path::BlindedHop
16732  */
16733 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
16734    /**
16735     * A pointer to the opaque Rust object.
16736     * Nearly everywhere, inner must be non-null, however in places where
16737     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16738     */
16739    LDKnativePaymentConstraints *inner;
16740    /**
16741     * Indicates that this is the only struct which contains the same pointer.
16742     * Rust functions which take ownership of an object provided via an argument require
16743     * this to be true and invalidate the object pointed to by inner.
16744     */
16745    bool is_owned;
16746 } LDKPaymentConstraints;
16747
16748 /**
16749  * The contents of CResult_PaymentConstraintsDecodeErrorZ
16750  */
16751 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
16752    /**
16753     * A pointer to the contents in the success state.
16754     * Reading from this pointer when `result_ok` is not set is undefined.
16755     */
16756    struct LDKPaymentConstraints *result;
16757    /**
16758     * A pointer to the contents in the error state.
16759     * Reading from this pointer when `result_ok` is set is undefined.
16760     */
16761    struct LDKDecodeError *err;
16762 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
16763
16764 /**
16765  * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
16766  * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
16767  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16768  */
16769 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
16770    /**
16771     * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
16772     * `err` or `result` depending on the state of `result_ok`.
16773     */
16774    union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
16775    /**
16776     * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
16777     */
16778    bool result_ok;
16779 } LDKCResult_PaymentConstraintsDecodeErrorZ;
16780
16781 /**
16782  * An error that may occur when making a payment.
16783  */
16784 typedef enum LDKPaymentError_Tag {
16785    /**
16786     * An error resulting from the provided [`Bolt11Invoice`] or payment hash.
16787     */
16788    LDKPaymentError_Invoice,
16789    /**
16790     * An error occurring when sending a payment.
16791     */
16792    LDKPaymentError_Sending,
16793    /**
16794     * Must be last for serialization purposes
16795     */
16796    LDKPaymentError_Sentinel,
16797 } LDKPaymentError_Tag;
16798
16799 typedef struct MUST_USE_STRUCT LDKPaymentError {
16800    LDKPaymentError_Tag tag;
16801    union {
16802       struct {
16803          struct LDKStr invoice;
16804       };
16805       struct {
16806          enum LDKRetryableSendFailure sending;
16807       };
16808    };
16809 } LDKPaymentError;
16810
16811 /**
16812  * The contents of CResult_ThirtyTwoBytesPaymentErrorZ
16813  */
16814 typedef union LDKCResult_ThirtyTwoBytesPaymentErrorZPtr {
16815    /**
16816     * A pointer to the contents in the success state.
16817     * Reading from this pointer when `result_ok` is not set is undefined.
16818     */
16819    struct LDKThirtyTwoBytes *result;
16820    /**
16821     * A pointer to the contents in the error state.
16822     * Reading from this pointer when `result_ok` is set is undefined.
16823     */
16824    struct LDKPaymentError *err;
16825 } LDKCResult_ThirtyTwoBytesPaymentErrorZPtr;
16826
16827 /**
16828  * A CResult_ThirtyTwoBytesPaymentErrorZ represents the result of a fallible operation,
16829  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
16830  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16831  */
16832 typedef struct LDKCResult_ThirtyTwoBytesPaymentErrorZ {
16833    /**
16834     * The contents of this CResult_ThirtyTwoBytesPaymentErrorZ, accessible via either
16835     * `err` or `result` depending on the state of `result_ok`.
16836     */
16837    union LDKCResult_ThirtyTwoBytesPaymentErrorZPtr contents;
16838    /**
16839     * Whether this CResult_ThirtyTwoBytesPaymentErrorZ represents a success state.
16840     */
16841    bool result_ok;
16842 } LDKCResult_ThirtyTwoBytesPaymentErrorZ;
16843
16844 /**
16845  * The contents of CResult_NonePaymentErrorZ
16846  */
16847 typedef union LDKCResult_NonePaymentErrorZPtr {
16848    /**
16849     * Note that this value is always NULL, as there are no contents in the OK variant
16850     */
16851    void *result;
16852    /**
16853     * A pointer to the contents in the error state.
16854     * Reading from this pointer when `result_ok` is set is undefined.
16855     */
16856    struct LDKPaymentError *err;
16857 } LDKCResult_NonePaymentErrorZPtr;
16858
16859 /**
16860  * A CResult_NonePaymentErrorZ represents the result of a fallible operation,
16861  * containing a () on success and a crate::lightning_invoice::payment::PaymentError on failure.
16862  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16863  */
16864 typedef struct LDKCResult_NonePaymentErrorZ {
16865    /**
16866     * The contents of this CResult_NonePaymentErrorZ, accessible via either
16867     * `err` or `result` depending on the state of `result_ok`.
16868     */
16869    union LDKCResult_NonePaymentErrorZPtr contents;
16870    /**
16871     * Whether this CResult_NonePaymentErrorZ represents a success state.
16872     */
16873    bool result_ok;
16874 } LDKCResult_NonePaymentErrorZ;
16875
16876 /**
16877  * An error that may occur when sending a payment probe.
16878  */
16879 typedef enum LDKProbingError_Tag {
16880    /**
16881     * An error resulting from the provided [`Bolt11Invoice`].
16882     */
16883    LDKProbingError_Invoice,
16884    /**
16885     * An error occurring when sending a payment probe.
16886     */
16887    LDKProbingError_Sending,
16888    /**
16889     * Must be last for serialization purposes
16890     */
16891    LDKProbingError_Sentinel,
16892 } LDKProbingError_Tag;
16893
16894 typedef struct MUST_USE_STRUCT LDKProbingError {
16895    LDKProbingError_Tag tag;
16896    union {
16897       struct {
16898          struct LDKStr invoice;
16899       };
16900       struct {
16901          struct LDKProbeSendFailure sending;
16902       };
16903    };
16904 } LDKProbingError;
16905
16906 /**
16907  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ
16908  */
16909 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr {
16910    /**
16911     * A pointer to the contents in the success state.
16912     * Reading from this pointer when `result_ok` is not set is undefined.
16913     */
16914    struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
16915    /**
16916     * A pointer to the contents in the error state.
16917     * Reading from this pointer when `result_ok` is set is undefined.
16918     */
16919    struct LDKProbingError *err;
16920 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr;
16921
16922 /**
16923  * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ represents the result of a fallible operation,
16924  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning_invoice::payment::ProbingError on failure.
16925  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16926  */
16927 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ {
16928    /**
16929     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ, accessible via either
16930     * `err` or `result` depending on the state of `result_ok`.
16931     */
16932    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr contents;
16933    /**
16934     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ represents a success state.
16935     */
16936    bool result_ok;
16937 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ;
16938
16939 /**
16940  * The contents of CResult_StrSecp256k1ErrorZ
16941  */
16942 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
16943    /**
16944     * A pointer to the contents in the success state.
16945     * Reading from this pointer when `result_ok` is not set is undefined.
16946     */
16947    struct LDKStr *result;
16948    /**
16949     * A pointer to the contents in the error state.
16950     * Reading from this pointer when `result_ok` is set is undefined.
16951     */
16952    enum LDKSecp256k1Error *err;
16953 } LDKCResult_StrSecp256k1ErrorZPtr;
16954
16955 /**
16956  * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
16957  * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
16958  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16959  */
16960 typedef struct LDKCResult_StrSecp256k1ErrorZ {
16961    /**
16962     * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
16963     * `err` or `result` depending on the state of `result_ok`.
16964     */
16965    union LDKCResult_StrSecp256k1ErrorZPtr contents;
16966    /**
16967     * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
16968     */
16969    bool result_ok;
16970 } LDKCResult_StrSecp256k1ErrorZ;
16971
16972
16973
16974 /**
16975  * A path for sending an [`OnionMessage`].
16976  */
16977 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
16978    /**
16979     * A pointer to the opaque Rust object.
16980     * Nearly everywhere, inner must be non-null, however in places where
16981     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16982     */
16983    LDKnativeOnionMessagePath *inner;
16984    /**
16985     * Indicates that this is the only struct which contains the same pointer.
16986     * Rust functions which take ownership of an object provided via an argument require
16987     * this to be true and invalidate the object pointed to by inner.
16988     */
16989    bool is_owned;
16990 } LDKOnionMessagePath;
16991
16992 /**
16993  * The contents of CResult_OnionMessagePathNoneZ
16994  */
16995 typedef union LDKCResult_OnionMessagePathNoneZPtr {
16996    /**
16997     * A pointer to the contents in the success state.
16998     * Reading from this pointer when `result_ok` is not set is undefined.
16999     */
17000    struct LDKOnionMessagePath *result;
17001    /**
17002     * Note that this value is always NULL, as there are no contents in the Err variant
17003     */
17004    void *err;
17005 } LDKCResult_OnionMessagePathNoneZPtr;
17006
17007 /**
17008  * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
17009  * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
17010  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17011  */
17012 typedef struct LDKCResult_OnionMessagePathNoneZ {
17013    /**
17014     * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
17015     * `err` or `result` depending on the state of `result_ok`.
17016     */
17017    union LDKCResult_OnionMessagePathNoneZPtr contents;
17018    /**
17019     * Whether this CResult_OnionMessagePathNoneZ represents a success state.
17020     */
17021    bool result_ok;
17022 } LDKCResult_OnionMessagePathNoneZ;
17023
17024 /**
17025  * A tuple of 2 elements. See the individual fields for the types contained.
17026  */
17027 typedef struct LDKC2Tuple_PublicKeyOnionMessageZ {
17028    /**
17029     * The element at position 0
17030     */
17031    struct LDKPublicKey a;
17032    /**
17033     * The element at position 1
17034     */
17035    struct LDKOnionMessage b;
17036 } LDKC2Tuple_PublicKeyOnionMessageZ;
17037
17038 /**
17039  * Errors that may occur when [sending an onion message].
17040  *
17041  * [sending an onion message]: OnionMessenger::send_onion_message
17042  */
17043 typedef enum LDKSendError_Tag {
17044    /**
17045     * Errored computing onion message packet keys.
17046     */
17047    LDKSendError_Secp256k1,
17048    /**
17049     * Because implementations such as Eclair will drop onion messages where the message packet
17050     * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
17051     */
17052    LDKSendError_TooBigPacket,
17053    /**
17054     * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
17055     * hops.
17056     */
17057    LDKSendError_TooFewBlindedHops,
17058    /**
17059     * Our next-hop peer was offline or does not support onion message forwarding.
17060     */
17061    LDKSendError_InvalidFirstHop,
17062    /**
17063     * Onion message contents must have a TLV type >= 64.
17064     */
17065    LDKSendError_InvalidMessage,
17066    /**
17067     * Our next-hop peer's buffer was full or our total outbound buffer was full.
17068     */
17069    LDKSendError_BufferFull,
17070    /**
17071     * Failed to retrieve our node id from the provided [`NodeSigner`].
17072     *
17073     * [`NodeSigner`]: crate::sign::NodeSigner
17074     */
17075    LDKSendError_GetNodeIdFailed,
17076    /**
17077     * We attempted to send to a blinded path where we are the introduction node, and failed to
17078     * advance the blinded path to make the second hop the new introduction node. Either
17079     * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
17080     * new blinding point, or we were attempting to send to ourselves.
17081     */
17082    LDKSendError_BlindedPathAdvanceFailed,
17083    /**
17084     * Must be last for serialization purposes
17085     */
17086    LDKSendError_Sentinel,
17087 } LDKSendError_Tag;
17088
17089 typedef struct MUST_USE_STRUCT LDKSendError {
17090    LDKSendError_Tag tag;
17091    union {
17092       struct {
17093          enum LDKSecp256k1Error secp256k1;
17094       };
17095    };
17096 } LDKSendError;
17097
17098 /**
17099  * The contents of CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ
17100  */
17101 typedef union LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr {
17102    /**
17103     * A pointer to the contents in the success state.
17104     * Reading from this pointer when `result_ok` is not set is undefined.
17105     */
17106    struct LDKC2Tuple_PublicKeyOnionMessageZ *result;
17107    /**
17108     * A pointer to the contents in the error state.
17109     * Reading from this pointer when `result_ok` is set is undefined.
17110     */
17111    struct LDKSendError *err;
17112 } LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr;
17113
17114 /**
17115  * A CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ represents the result of a fallible operation,
17116  * containing a crate::c_types::derived::C2Tuple_PublicKeyOnionMessageZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
17117  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17118  */
17119 typedef struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ {
17120    /**
17121     * The contents of this CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ, accessible via either
17122     * `err` or `result` depending on the state of `result_ok`.
17123     */
17124    union LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr contents;
17125    /**
17126     * Whether this CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ represents a success state.
17127     */
17128    bool result_ok;
17129 } LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ;
17130
17131 /**
17132  * The contents of an [`OnionMessage`] as read from the wire.
17133  *
17134  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
17135  */
17136 typedef enum LDKParsedOnionMessageContents_Tag {
17137    /**
17138     * A message related to BOLT 12 Offers.
17139     */
17140    LDKParsedOnionMessageContents_Offers,
17141    /**
17142     * A custom onion message specified by the user.
17143     */
17144    LDKParsedOnionMessageContents_Custom,
17145    /**
17146     * Must be last for serialization purposes
17147     */
17148    LDKParsedOnionMessageContents_Sentinel,
17149 } LDKParsedOnionMessageContents_Tag;
17150
17151 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
17152    LDKParsedOnionMessageContents_Tag tag;
17153    union {
17154       struct {
17155          struct LDKOffersMessage offers;
17156       };
17157       struct {
17158          struct LDKOnionMessageContents custom;
17159       };
17160    };
17161 } LDKParsedOnionMessageContents;
17162
17163 /**
17164  * A processed incoming onion message, containing either a Forward (another onion message)
17165  * or a Receive payload with decrypted contents.
17166  */
17167 typedef enum LDKPeeledOnion_Tag {
17168    /**
17169     * Forwarded onion, with the next node id and a new onion
17170     */
17171    LDKPeeledOnion_Forward,
17172    /**
17173     * Received onion message, with decrypted contents, path_id, and reply path
17174     */
17175    LDKPeeledOnion_Receive,
17176    /**
17177     * Must be last for serialization purposes
17178     */
17179    LDKPeeledOnion_Sentinel,
17180 } LDKPeeledOnion_Tag;
17181
17182 typedef struct LDKPeeledOnion_LDKForward_Body {
17183    struct LDKPublicKey _0;
17184    struct LDKOnionMessage _1;
17185 } LDKPeeledOnion_LDKForward_Body;
17186
17187 typedef struct LDKPeeledOnion_LDKReceive_Body {
17188    struct LDKParsedOnionMessageContents _0;
17189    /**
17190     *
17191     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
17192     */
17193    struct LDKThirtyTwoBytes _1;
17194    /**
17195     *
17196     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
17197     */
17198    struct LDKBlindedPath _2;
17199 } LDKPeeledOnion_LDKReceive_Body;
17200
17201 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
17202    LDKPeeledOnion_Tag tag;
17203    union {
17204       LDKPeeledOnion_LDKForward_Body forward;
17205       LDKPeeledOnion_LDKReceive_Body receive;
17206    };
17207 } LDKPeeledOnion;
17208
17209 /**
17210  * The contents of CResult_PeeledOnionNoneZ
17211  */
17212 typedef union LDKCResult_PeeledOnionNoneZPtr {
17213    /**
17214     * A pointer to the contents in the success state.
17215     * Reading from this pointer when `result_ok` is not set is undefined.
17216     */
17217    struct LDKPeeledOnion *result;
17218    /**
17219     * Note that this value is always NULL, as there are no contents in the Err variant
17220     */
17221    void *err;
17222 } LDKCResult_PeeledOnionNoneZPtr;
17223
17224 /**
17225  * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
17226  * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
17227  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17228  */
17229 typedef struct LDKCResult_PeeledOnionNoneZ {
17230    /**
17231     * The contents of this CResult_PeeledOnionNoneZ, accessible via either
17232     * `err` or `result` depending on the state of `result_ok`.
17233     */
17234    union LDKCResult_PeeledOnionNoneZPtr contents;
17235    /**
17236     * Whether this CResult_PeeledOnionNoneZ represents a success state.
17237     */
17238    bool result_ok;
17239 } LDKCResult_PeeledOnionNoneZ;
17240
17241 /**
17242  * The contents of CResult_NoneSendErrorZ
17243  */
17244 typedef union LDKCResult_NoneSendErrorZPtr {
17245    /**
17246     * Note that this value is always NULL, as there are no contents in the OK variant
17247     */
17248    void *result;
17249    /**
17250     * A pointer to the contents in the error state.
17251     * Reading from this pointer when `result_ok` is set is undefined.
17252     */
17253    struct LDKSendError *err;
17254 } LDKCResult_NoneSendErrorZPtr;
17255
17256 /**
17257  * A CResult_NoneSendErrorZ represents the result of a fallible operation,
17258  * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
17259  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17260  */
17261 typedef struct LDKCResult_NoneSendErrorZ {
17262    /**
17263     * The contents of this CResult_NoneSendErrorZ, accessible via either
17264     * `err` or `result` depending on the state of `result_ok`.
17265     */
17266    union LDKCResult_NoneSendErrorZPtr contents;
17267    /**
17268     * Whether this CResult_NoneSendErrorZ represents a success state.
17269     */
17270    bool result_ok;
17271 } LDKCResult_NoneSendErrorZ;
17272
17273 /**
17274  * The contents of CResult_BlindedPathNoneZ
17275  */
17276 typedef union LDKCResult_BlindedPathNoneZPtr {
17277    /**
17278     * A pointer to the contents in the success state.
17279     * Reading from this pointer when `result_ok` is not set is undefined.
17280     */
17281    struct LDKBlindedPath *result;
17282    /**
17283     * Note that this value is always NULL, as there are no contents in the Err variant
17284     */
17285    void *err;
17286 } LDKCResult_BlindedPathNoneZPtr;
17287
17288 /**
17289  * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
17290  * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
17291  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17292  */
17293 typedef struct LDKCResult_BlindedPathNoneZ {
17294    /**
17295     * The contents of this CResult_BlindedPathNoneZ, accessible via either
17296     * `err` or `result` depending on the state of `result_ok`.
17297     */
17298    union LDKCResult_BlindedPathNoneZPtr contents;
17299    /**
17300     * Whether this CResult_BlindedPathNoneZ represents a success state.
17301     */
17302    bool result_ok;
17303 } LDKCResult_BlindedPathNoneZ;
17304
17305 /**
17306  * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
17307  */
17308 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
17309    /**
17310     * A pointer to the contents in the success state.
17311     * Reading from this pointer when `result_ok` is not set is undefined.
17312     */
17313    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
17314    /**
17315     * Note that this value is always NULL, as there are no contents in the Err variant
17316     */
17317    void *err;
17318 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
17319
17320 /**
17321  * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
17322  * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
17323  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17324  */
17325 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
17326    /**
17327     * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
17328     * `err` or `result` depending on the state of `result_ok`.
17329     */
17330    union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
17331    /**
17332     * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
17333     */
17334    bool result_ok;
17335 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
17336
17337 /**
17338  * The contents of CResult_BlindedPathDecodeErrorZ
17339  */
17340 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
17341    /**
17342     * A pointer to the contents in the success state.
17343     * Reading from this pointer when `result_ok` is not set is undefined.
17344     */
17345    struct LDKBlindedPath *result;
17346    /**
17347     * A pointer to the contents in the error state.
17348     * Reading from this pointer when `result_ok` is set is undefined.
17349     */
17350    struct LDKDecodeError *err;
17351 } LDKCResult_BlindedPathDecodeErrorZPtr;
17352
17353 /**
17354  * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
17355  * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
17356  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17357  */
17358 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
17359    /**
17360     * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
17361     * `err` or `result` depending on the state of `result_ok`.
17362     */
17363    union LDKCResult_BlindedPathDecodeErrorZPtr contents;
17364    /**
17365     * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
17366     */
17367    bool result_ok;
17368 } LDKCResult_BlindedPathDecodeErrorZ;
17369
17370 /**
17371  * The contents of CResult_BlindedHopDecodeErrorZ
17372  */
17373 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
17374    /**
17375     * A pointer to the contents in the success state.
17376     * Reading from this pointer when `result_ok` is not set is undefined.
17377     */
17378    struct LDKBlindedHop *result;
17379    /**
17380     * A pointer to the contents in the error state.
17381     * Reading from this pointer when `result_ok` is set is undefined.
17382     */
17383    struct LDKDecodeError *err;
17384 } LDKCResult_BlindedHopDecodeErrorZPtr;
17385
17386 /**
17387  * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
17388  * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
17389  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17390  */
17391 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
17392    /**
17393     * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
17394     * `err` or `result` depending on the state of `result_ok`.
17395     */
17396    union LDKCResult_BlindedHopDecodeErrorZPtr contents;
17397    /**
17398     * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
17399     */
17400    bool result_ok;
17401 } LDKCResult_BlindedHopDecodeErrorZ;
17402
17403 /**
17404  * The contents of CResult_InvoiceErrorDecodeErrorZ
17405  */
17406 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
17407    /**
17408     * A pointer to the contents in the success state.
17409     * Reading from this pointer when `result_ok` is not set is undefined.
17410     */
17411    struct LDKInvoiceError *result;
17412    /**
17413     * A pointer to the contents in the error state.
17414     * Reading from this pointer when `result_ok` is set is undefined.
17415     */
17416    struct LDKDecodeError *err;
17417 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
17418
17419 /**
17420  * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
17421  * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
17422  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17423  */
17424 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
17425    /**
17426     * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
17427     * `err` or `result` depending on the state of `result_ok`.
17428     */
17429    union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
17430    /**
17431     * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
17432     */
17433    bool result_ok;
17434 } LDKCResult_InvoiceErrorDecodeErrorZ;
17435
17436
17437
17438 /**
17439  * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
17440  *
17441  * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
17442  * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
17443  * [`Confirm::transactions_confirmed`].
17444  *
17445  * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
17446  * may have been spent there. See [`Filter::register_output`] for details.
17447  *
17448  * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
17449  * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
17450  */
17451 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
17452    /**
17453     * A pointer to the opaque Rust object.
17454     * Nearly everywhere, inner must be non-null, however in places where
17455     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17456     */
17457    LDKnativeWatchedOutput *inner;
17458    /**
17459     * Indicates that this is the only struct which contains the same pointer.
17460     * Rust functions which take ownership of an object provided via an argument require
17461     * this to be true and invalidate the object pointed to by inner.
17462     */
17463    bool is_owned;
17464 } LDKWatchedOutput;
17465
17466 /**
17467  * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
17468  * channels.
17469  *
17470  * This is useful in order to have a [`Watch`] implementation convey to a chain source which
17471  * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
17472  * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
17473  * receiving full blocks from a chain source, any further filtering is unnecessary.
17474  *
17475  * After an output has been registered, subsequent block retrievals from the chain source must not
17476  * exclude any transactions matching the new criteria nor any in-block descendants of such
17477  * transactions.
17478  *
17479  * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
17480  * should not block on I/O. Implementations should instead queue the newly monitored data to be
17481  * processed later. Then, in order to block until the data has been processed, any [`Watch`]
17482  * invocation that has called the `Filter` must return [`InProgress`].
17483  *
17484  * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
17485  * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
17486  * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
17487  */
17488 typedef struct LDKFilter {
17489    /**
17490     * An opaque pointer which is passed to your function implementations as an argument.
17491     * This has no meaning in the LDK, and can be NULL or any other value.
17492     */
17493    void *this_arg;
17494    /**
17495     * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
17496     * a spending condition.
17497     */
17498    void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
17499    /**
17500     * Registers interest in spends of a transaction output.
17501     *
17502     * Note that this method might be called during processing of a new block. You therefore need
17503     * to ensure that also dependent output spents within an already connected block are correctly
17504     * handled, e.g., by re-scanning the block in question whenever new outputs have been
17505     * registered mid-processing.
17506     */
17507    void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
17508    /**
17509     * Frees any resources associated with this object given its this_arg pointer.
17510     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17511     */
17512    void (*free)(void *this_arg);
17513 } LDKFilter;
17514
17515 /**
17516  * An enum which can either contain a crate::lightning::chain::Filter or not
17517  */
17518 typedef enum LDKCOption_FilterZ_Tag {
17519    /**
17520     * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
17521     */
17522    LDKCOption_FilterZ_Some,
17523    /**
17524     * When we're in this state, this COption_FilterZ contains nothing
17525     */
17526    LDKCOption_FilterZ_None,
17527    /**
17528     * Must be last for serialization purposes
17529     */
17530    LDKCOption_FilterZ_Sentinel,
17531 } LDKCOption_FilterZ_Tag;
17532
17533 typedef struct LDKCOption_FilterZ {
17534    LDKCOption_FilterZ_Tag tag;
17535    union {
17536       struct {
17537          struct LDKFilter some;
17538       };
17539    };
17540 } LDKCOption_FilterZ;
17541
17542
17543
17544 /**
17545  * A read-only reference to a current ChannelMonitor.
17546  *
17547  * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
17548  * released.
17549  */
17550 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
17551    /**
17552     * A pointer to the opaque Rust object.
17553     * Nearly everywhere, inner must be non-null, however in places where
17554     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17555     */
17556    LDKnativeLockedChannelMonitor *inner;
17557    /**
17558     * Indicates that this is the only struct which contains the same pointer.
17559     * Rust functions which take ownership of an object provided via an argument require
17560     * this to be true and invalidate the object pointed to by inner.
17561     */
17562    bool is_owned;
17563 } LDKLockedChannelMonitor;
17564
17565 /**
17566  * The contents of CResult_LockedChannelMonitorNoneZ
17567  */
17568 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
17569    /**
17570     * A pointer to the contents in the success state.
17571     * Reading from this pointer when `result_ok` is not set is undefined.
17572     */
17573    struct LDKLockedChannelMonitor *result;
17574    /**
17575     * Note that this value is always NULL, as there are no contents in the Err variant
17576     */
17577    void *err;
17578 } LDKCResult_LockedChannelMonitorNoneZPtr;
17579
17580 /**
17581  * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
17582  * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
17583  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17584  */
17585 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
17586    /**
17587     * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
17588     * `err` or `result` depending on the state of `result_ok`.
17589     */
17590    union LDKCResult_LockedChannelMonitorNoneZPtr contents;
17591    /**
17592     * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
17593     */
17594    bool result_ok;
17595 } LDKCResult_LockedChannelMonitorNoneZ;
17596
17597 /**
17598  * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
17599  * This corresponds to std::vector in C++
17600  */
17601 typedef struct LDKCVec_OutPointZ {
17602    /**
17603     * The elements in the array.
17604     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17605     */
17606    struct LDKOutPoint *data;
17607    /**
17608     * The number of elements pointed to by `data`.
17609     */
17610    uintptr_t datalen;
17611 } LDKCVec_OutPointZ;
17612
17613
17614
17615 /**
17616  * An opaque identifier describing a specific [`Persist`] method call.
17617  */
17618 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
17619    /**
17620     * A pointer to the opaque Rust object.
17621     * Nearly everywhere, inner must be non-null, however in places where
17622     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17623     */
17624    LDKnativeMonitorUpdateId *inner;
17625    /**
17626     * Indicates that this is the only struct which contains the same pointer.
17627     * Rust functions which take ownership of an object provided via an argument require
17628     * this to be true and invalidate the object pointed to by inner.
17629     */
17630    bool is_owned;
17631 } LDKMonitorUpdateId;
17632
17633 /**
17634  * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
17635  * This corresponds to std::vector in C++
17636  */
17637 typedef struct LDKCVec_MonitorUpdateIdZ {
17638    /**
17639     * The elements in the array.
17640     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17641     */
17642    struct LDKMonitorUpdateId *data;
17643    /**
17644     * The number of elements pointed to by `data`.
17645     */
17646    uintptr_t datalen;
17647 } LDKCVec_MonitorUpdateIdZ;
17648
17649 /**
17650  * A tuple of 2 elements. See the individual fields for the types contained.
17651  */
17652 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
17653    /**
17654     * The element at position 0
17655     */
17656    struct LDKOutPoint a;
17657    /**
17658     * The element at position 1
17659     */
17660    struct LDKCVec_MonitorUpdateIdZ b;
17661 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
17662
17663 /**
17664  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
17665  * This corresponds to std::vector in C++
17666  */
17667 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
17668    /**
17669     * The elements in the array.
17670     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17671     */
17672    struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
17673    /**
17674     * The number of elements pointed to by `data`.
17675     */
17676    uintptr_t datalen;
17677 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
17678
17679 /**
17680  * Provides an interface that allows storage and retrieval of persisted values that are associated
17681  * with given keys.
17682  *
17683  * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
17684  * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
17685  * ways, as long as per-namespace key uniqueness is asserted.
17686  *
17687  * Keys and namespaces are required to be valid ASCII strings in the range of
17688  * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
17689  * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
17690  * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
17691  * that concerns should always be separated by primary namespace first, before secondary
17692  * namespaces are used. While the number of primary namespaces will be relatively small and is
17693  * determined at compile time, there may be many secondary namespaces per primary namespace. Note
17694  * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
17695  * namespace, i.e., conflicts between keys and equally named
17696  * primary namespaces/secondary namespaces must be avoided.
17697  *
17698  * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
17699  * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
17700  * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
17701  */
17702 typedef struct LDKKVStore {
17703    /**
17704     * An opaque pointer which is passed to your function implementations as an argument.
17705     * This has no meaning in the LDK, and can be NULL or any other value.
17706     */
17707    void *this_arg;
17708    /**
17709     * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
17710     * `key`.
17711     *
17712     * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
17713     * `primary_namespace` and `secondary_namespace`.
17714     *
17715     * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
17716     */
17717    struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
17718    /**
17719     * Persists the given data under the given `key`.
17720     *
17721     * Will create the given `primary_namespace` and `secondary_namespace` if not already present
17722     * in the store.
17723     */
17724    struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
17725    /**
17726     * Removes any data that had previously been persisted under the given `key`.
17727     *
17728     * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
17729     * remove the given `key` at some point in time after the method returns, e.g., as part of an
17730     * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
17731     * [`KVStore::list`] might include the removed key until the changes are actually persisted.
17732     *
17733     * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
17734     * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
17735     * potentially get lost on crash after the method returns. Therefore, this flag should only be
17736     * set for `remove` operations that can be safely replayed at a later time.
17737     *
17738     * Returns successfully if no data will be stored for the given `primary_namespace`,
17739     * `secondary_namespace`, and `key`, independently of whether it was present before its
17740     * invokation or not.
17741     */
17742    struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
17743    /**
17744     * Returns a list of keys that are stored under the given `secondary_namespace` in
17745     * `primary_namespace`.
17746     *
17747     * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
17748     * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
17749     */
17750    struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
17751    /**
17752     * Frees any resources associated with this object given its this_arg pointer.
17753     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17754     */
17755    void (*free)(void *this_arg);
17756 } LDKKVStore;
17757
17758 /**
17759  * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
17760  */
17761 typedef struct LDKPersister {
17762    /**
17763     * An opaque pointer which is passed to your function implementations as an argument.
17764     * This has no meaning in the LDK, and can be NULL or any other value.
17765     */
17766    void *this_arg;
17767    /**
17768     * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
17769     */
17770    struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
17771    /**
17772     * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
17773     */
17774    struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
17775    /**
17776     * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
17777     */
17778    struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
17779    /**
17780     * Frees any resources associated with this object given its this_arg pointer.
17781     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17782     */
17783    void (*free)(void *this_arg);
17784 } LDKPersister;
17785
17786
17787
17788 /**
17789  * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
17790  * [`ChannelMonitorUpdate`]s.
17791  *
17792  * # Overview
17793  *
17794  * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
17795  * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
17796  * deleting) and complexity. This is because it writes channel monitor differential updates,
17797  * whereas the other (default) implementation rewrites the entire monitor on each update. For
17798  * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
17799  * of megabytes (or more). Updates can be as small as a few hundred bytes.
17800  *
17801  * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
17802  * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
17803  * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
17804  * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
17805  * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
17806  * sentinel bytes.
17807  *
17808  * # Storing monitors
17809  *
17810  * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
17811  *
17812  *   - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
17813  *   - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
17814  *
17815  * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
17816  * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
17817  *
17818  * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
17819  *
17820  *   - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
17821  *   - secondary namespace: [the monitor's encoded outpoint name]
17822  *
17823  * Under that secondary namespace, each update is stored with a number string, like `21`, which
17824  * represents its `update_id` value.
17825  *
17826  * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
17827  *
17828  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
17829  *   - Index: `1`
17830  *
17831  * Full channel monitors would be stored at a single key:
17832  *
17833  * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
17834  *
17835  * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
17836  *
17837  * ```text
17838  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
17839  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
17840  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
17841  * ```
17842  * ... and so on.
17843  *
17844  * # Reading channel state from storage
17845  *
17846  * Channel state can be reconstructed by calling
17847  * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
17848  * list channel monitors themselves and load channels individually using
17849  * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
17850  *
17851  * ## EXTREMELY IMPORTANT
17852  *
17853  * It is extremely important that your [`KVStore::read`] implementation uses the
17854  * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
17855  * that circumstance (not when there is really a permissions error, for example). This is because
17856  * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
17857  * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
17858  * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
17859  *
17860  * # Pruning stale channel updates
17861  *
17862  * Stale updates are pruned when a full monitor is written. The old monitor is first read, and if
17863  * that succeeds, updates in the range between the old and new monitors are deleted. The `lazy`
17864  * flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
17865  * will complete. However, stale updates are not a problem for data integrity, since updates are
17866  * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
17867  *
17868  * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
17869  * would like to get rid of them, consider using the
17870  * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
17871  */
17872 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
17873    /**
17874     * A pointer to the opaque Rust object.
17875     * Nearly everywhere, inner must be non-null, however in places where
17876     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17877     */
17878    LDKnativeMonitorUpdatingPersister *inner;
17879    /**
17880     * Indicates that this is the only struct which contains the same pointer.
17881     * Rust functions which take ownership of an object provided via an argument require
17882     * this to be true and invalidate the object pointed to by inner.
17883     */
17884    bool is_owned;
17885 } LDKMonitorUpdatingPersister;
17886
17887 /**
17888  * `Persist` defines behavior for persisting channel monitors: this could mean
17889  * writing once to disk, and/or uploading to one or more backup services.
17890  *
17891  * Persistence can happen in one of two ways - synchronously completing before the trait method
17892  * calls return or asynchronously in the background.
17893  *
17894  * # For those implementing synchronous persistence
17895  *
17896  *  * If persistence completes fully (including any relevant `fsync()` calls), the implementation
17897  *    should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
17898  *    should continue.
17899  *
17900  *  * If persistence fails for some reason, implementations should consider returning
17901  *    [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
17902  *    the background with [`ChainMonitor::list_pending_monitor_updates`] and
17903  *    [`ChainMonitor::get_monitor`].
17904  *
17905  *    Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
17906  *    be marked as complete via [`ChainMonitor::channel_monitor_updated`].
17907  *
17908  *    If at some point no further progress can be made towards persisting the pending updates, the
17909  *    node should simply shut down.
17910  *
17911  *  * If the persistence has failed and cannot be retried further (e.g. because of an outage),
17912  *    [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
17913  *    an immediate panic and future operations in LDK generally failing.
17914  *
17915  * # For those implementing asynchronous persistence
17916  *
17917  *  All calls should generally spawn a background task and immediately return
17918  *  [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
17919  *  [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
17920  *  [`MonitorUpdateId`].
17921  *
17922  *  Note that unlike the direct [`chain::Watch`] interface,
17923  *  [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
17924  *
17925  *  If at some point no further progress can be made towards persisting a pending update, the node
17926  *  should simply shut down. Until then, the background task should either loop indefinitely, or
17927  *  persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
17928  *  and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
17929  *  monitor updates may be marked completed).
17930  *
17931  * # Using remote watchtowers
17932  *
17933  * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
17934  * update process described above while the watchtower is being updated. The following methods are
17935  * provided for bulding transactions for a watchtower:
17936  * [`ChannelMonitor::initial_counterparty_commitment_tx`],
17937  * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
17938  * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
17939  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
17940  *
17941  * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
17942  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
17943  */
17944 typedef struct LDKPersist {
17945    /**
17946     * An opaque pointer which is passed to your function implementations as an argument.
17947     * This has no meaning in the LDK, and can be NULL or any other value.
17948     */
17949    void *this_arg;
17950    /**
17951     * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
17952     * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
17953     *
17954     * The data can be stored any way you want, but the identifier provided by LDK is the
17955     * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
17956     * and the stored channel data). Note that you **must** persist every new monitor to disk.
17957     *
17958     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
17959     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
17960     *
17961     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
17962     * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
17963     *
17964     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17965     * [`Writeable::write`]: crate::util::ser::Writeable::write
17966     */
17967    enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
17968    /**
17969     * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
17970     * update.
17971     *
17972     * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
17973     * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
17974     * details.
17975     *
17976     * During blockchain synchronization operations, and in some rare cases, this may be called with
17977     * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
17978     * Note that after the full [`ChannelMonitor`] is persisted any previous
17979     * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
17980     * applied to the persisted [`ChannelMonitor`] as they were already applied.
17981     *
17982     * If an implementer chooses to persist the updates only, they need to make
17983     * sure that all the updates are applied to the `ChannelMonitors` *before*
17984     * the set of channel monitors is given to the `ChannelManager`
17985     * deserialization routine. See [`ChannelMonitor::update_monitor`] for
17986     * applying a monitor update to a monitor. If full `ChannelMonitors` are
17987     * persisted, then there is no need to persist individual updates.
17988     *
17989     * Note that there could be a performance tradeoff between persisting complete
17990     * channel monitors on every update vs. persisting only updates and applying
17991     * them in batches. The size of each monitor grows `O(number of state updates)`
17992     * whereas updates are small and `O(1)`.
17993     *
17994     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
17995     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
17996     *
17997     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
17998     * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
17999     * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
18000     *
18001     * [`Writeable::write`]: crate::util::ser::Writeable::write
18002     *
18003     * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
18004     */
18005    enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
18006    /**
18007     * Frees any resources associated with this object given its this_arg pointer.
18008     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18009     */
18010    void (*free)(void *this_arg);
18011 } LDKPersist;
18012
18013
18014
18015 /**
18016  * A string that displays only printable characters, replacing control characters with
18017  * [`core::char::REPLACEMENT_CHARACTER`].
18018  */
18019 typedef struct MUST_USE_STRUCT LDKPrintableString {
18020    /**
18021     * A pointer to the opaque Rust object.
18022     * Nearly everywhere, inner must be non-null, however in places where
18023     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18024     */
18025    LDKnativePrintableString *inner;
18026    /**
18027     * Indicates that this is the only struct which contains the same pointer.
18028     * Rust functions which take ownership of an object provided via an argument require
18029     * this to be true and invalidate the object pointed to by inner.
18030     */
18031    bool is_owned;
18032 } LDKPrintableString;
18033
18034 /**
18035  * A callback which is called when a [`Future`] completes.
18036  *
18037  * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
18038  * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
18039  * instead.
18040  *
18041  * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
18042  * futures when they receive a wake, rather than immediately executing them.
18043  */
18044 typedef struct LDKFutureCallback {
18045    /**
18046     * An opaque pointer which is passed to your function implementations as an argument.
18047     * This has no meaning in the LDK, and can be NULL or any other value.
18048     */
18049    void *this_arg;
18050    /**
18051     * The method which is called.
18052     */
18053    void (*call)(const void *this_arg);
18054    /**
18055     * Frees any resources associated with this object given its this_arg pointer.
18056     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18057     */
18058    void (*free)(void *this_arg);
18059 } LDKFutureCallback;
18060
18061
18062
18063 /**
18064  * A struct which can be used to select across many [`Future`]s at once without relying on a full
18065  * async context.
18066  */
18067 typedef struct MUST_USE_STRUCT LDKSleeper {
18068    /**
18069     * A pointer to the opaque Rust object.
18070     * Nearly everywhere, inner must be non-null, however in places where
18071     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18072     */
18073    LDKnativeSleeper *inner;
18074    /**
18075     * Indicates that this is the only struct which contains the same pointer.
18076     * Rust functions which take ownership of an object provided via an argument require
18077     * this to be true and invalidate the object pointed to by inner.
18078     */
18079    bool is_owned;
18080 } LDKSleeper;
18081
18082
18083
18084 /**
18085  * Configuration we set when applicable.
18086  *
18087  * Default::default() provides sane defaults.
18088  */
18089 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
18090    /**
18091     * A pointer to the opaque Rust object.
18092     * Nearly everywhere, inner must be non-null, however in places where
18093     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18094     */
18095    LDKnativeChannelHandshakeConfig *inner;
18096    /**
18097     * Indicates that this is the only struct which contains the same pointer.
18098     * Rust functions which take ownership of an object provided via an argument require
18099     * this to be true and invalidate the object pointed to by inner.
18100     */
18101    bool is_owned;
18102 } LDKChannelHandshakeConfig;
18103
18104
18105
18106 /**
18107  * Optional channel limits which are applied during channel creation.
18108  *
18109  * These limits are only applied to our counterparty's limits, not our own.
18110  *
18111  * Use 0/`<type>::max_value()` as appropriate to skip checking.
18112  *
18113  * Provides sane defaults for most configurations.
18114  *
18115  * Most additional limits are disabled except those with which specify a default in individual
18116  * field documentation. Note that this may result in barely-usable channels, but since they
18117  * are applied mostly only to incoming channels that's not much of a problem.
18118  */
18119 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
18120    /**
18121     * A pointer to the opaque Rust object.
18122     * Nearly everywhere, inner must be non-null, however in places where
18123     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18124     */
18125    LDKnativeChannelHandshakeLimits *inner;
18126    /**
18127     * Indicates that this is the only struct which contains the same pointer.
18128     * Rust functions which take ownership of an object provided via an argument require
18129     * this to be true and invalidate the object pointed to by inner.
18130     */
18131    bool is_owned;
18132 } LDKChannelHandshakeLimits;
18133
18134
18135
18136 /**
18137  * A parallel struct to [`ChannelConfig`] to define partial updates.
18138  */
18139 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
18140    /**
18141     * A pointer to the opaque Rust object.
18142     * Nearly everywhere, inner must be non-null, however in places where
18143     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18144     */
18145    LDKnativeChannelConfigUpdate *inner;
18146    /**
18147     * Indicates that this is the only struct which contains the same pointer.
18148     * Rust functions which take ownership of an object provided via an argument require
18149     * this to be true and invalidate the object pointed to by inner.
18150     */
18151    bool is_owned;
18152 } LDKChannelConfigUpdate;
18153
18154
18155
18156 /**
18157  * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
18158  *
18159  * Default::default() provides sane defaults for most configurations
18160  * (but currently with 0 relay fees!)
18161  */
18162 typedef struct MUST_USE_STRUCT LDKUserConfig {
18163    /**
18164     * A pointer to the opaque Rust object.
18165     * Nearly everywhere, inner must be non-null, however in places where
18166     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18167     */
18168    LDKnativeUserConfig *inner;
18169    /**
18170     * Indicates that this is the only struct which contains the same pointer.
18171     * Rust functions which take ownership of an object provided via an argument require
18172     * this to be true and invalidate the object pointed to by inner.
18173     */
18174    bool is_owned;
18175 } LDKUserConfig;
18176
18177
18178
18179 /**
18180  * The best known block as identified by its hash and height.
18181  */
18182 typedef struct MUST_USE_STRUCT LDKBestBlock {
18183    /**
18184     * A pointer to the opaque Rust object.
18185     * Nearly everywhere, inner must be non-null, however in places where
18186     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18187     */
18188    LDKnativeBestBlock *inner;
18189    /**
18190     * Indicates that this is the only struct which contains the same pointer.
18191     * Rust functions which take ownership of an object provided via an argument require
18192     * this to be true and invalidate the object pointed to by inner.
18193     */
18194    bool is_owned;
18195 } LDKBestBlock;
18196
18197 /**
18198  * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
18199  * chain.
18200  *
18201  * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
18202  * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
18203  * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
18204  * when needed.
18205  *
18206  * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
18207  * entire header chain and only blocks with matching transaction data using BIP 157 filters or
18208  * other similar filtering.
18209  */
18210 typedef struct LDKListen {
18211    /**
18212     * An opaque pointer which is passed to your function implementations as an argument.
18213     * This has no meaning in the LDK, and can be NULL or any other value.
18214     */
18215    void *this_arg;
18216    /**
18217     * Notifies the listener that a block was added at the given height, with the transaction data
18218     * possibly filtered.
18219     */
18220    void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
18221    /**
18222     * Notifies the listener that a block was added at the given height.
18223     */
18224    void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
18225    /**
18226     * Notifies the listener that a block was removed at the given height.
18227     */
18228    void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
18229    /**
18230     * Frees any resources associated with this object given its this_arg pointer.
18231     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18232     */
18233    void (*free)(void *this_arg);
18234 } LDKListen;
18235
18236 /**
18237  * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
18238  * chain or unconfirmed during a chain reorganization.
18239  *
18240  * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
18241  * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
18242  * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
18243  * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
18244  * with reference to the confirmation status of the monitored objects.
18245  *
18246  * # Use
18247  * The intended use is as follows:
18248  * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
18249  *   outputs are, respectively, confirmed or spent on chain.
18250  * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
18251  *   [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
18252  * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
18253  *
18254  * # Order
18255  *
18256  * Clients must call these methods in chain order. Specifically:
18257  * - Transactions which are confirmed in a particular block must be given before transactions
18258  *   confirmed in a later block.
18259  * - Dependent transactions within the same block must be given in topological order, possibly in
18260  *   separate calls.
18261  * - All unconfirmed transactions must be given after the original confirmations and before *any*
18262  *   reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
18263  *   never be interleaved, but always conduced *en bloc*.
18264  * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
18265  *   in regard to the new block.
18266  *
18267  * See individual method documentation for further details.
18268  *
18269  * [`transactions_confirmed`]: Self::transactions_confirmed
18270  * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
18271  * [`best_block_updated`]: Self::best_block_updated
18272  * [`get_relevant_txids`]: Self::get_relevant_txids
18273  */
18274 typedef struct LDKConfirm {
18275    /**
18276     * An opaque pointer which is passed to your function implementations as an argument.
18277     * This has no meaning in the LDK, and can be NULL or any other value.
18278     */
18279    void *this_arg;
18280    /**
18281     * Notifies LDK of transactions confirmed in a block with a given header and height.
18282     *
18283     * Must be called for any transactions registered by [`Filter::register_tx`] or any
18284     * transactions spending an output registered by [`Filter::register_output`]. Such transactions
18285     * appearing in the same block do not need to be included in the same call; instead, multiple
18286     * calls with additional transactions may be made so long as they are made in [chain order].
18287     *
18288     * May be called before or after [`best_block_updated`] for the corresponding block. However,
18289     * in the event of a chain reorganization, it must not be called with a `header` that is no
18290     * longer in the chain as of the last call to [`best_block_updated`].
18291     *
18292     * [chain order]: Confirm#order
18293     * [`best_block_updated`]: Self::best_block_updated
18294     */
18295    void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
18296    /**
18297     * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
18298     *
18299     * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
18300     * reorganized out of the best chain or if it is no longer confirmed in the block with the
18301     * given block hash. Once called, the given transaction will not be returned
18302     * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
18303     *
18304     * [`get_relevant_txids`]: Self::get_relevant_txids
18305     * [`transactions_confirmed`]: Self::transactions_confirmed
18306     */
18307    void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
18308    /**
18309     * Notifies LDK of an update to the best header connected at the given height.
18310     *
18311     * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
18312     * blocks.
18313     */
18314    void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
18315    /**
18316     * Returns transactions that must be monitored for reorganization out of the chain along
18317     * with the hash of the block as part of which it had been previously confirmed.
18318     *
18319     * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
18320     * 0.0.112 and prior, in which case you need to manually track previous confirmations.
18321     *
18322     * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
18323     * confirmations to be safe from a chain reorganization. Will not include any transactions
18324     * passed to [`transaction_unconfirmed`], unless later reconfirmed.
18325     *
18326     * Must be called to determine the subset of transactions that must be monitored for
18327     * reorganization. Will be idempotent between calls but may change as a result of calls to the
18328     * other interface methods. Thus, this is useful to determine which transactions must be
18329     * given to [`transaction_unconfirmed`].
18330     *
18331     * If any of the returned transactions are confirmed in a block other than the one with the
18332     * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and
18333     * [`transactions_confirmed`], respectively.
18334     *
18335     * [`transactions_confirmed`]: Self::transactions_confirmed
18336     * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
18337     */
18338    struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
18339    /**
18340     * Frees any resources associated with this object given its this_arg pointer.
18341     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18342     */
18343    void (*free)(void *this_arg);
18344 } LDKConfirm;
18345
18346
18347
18348 /**
18349  * An implementation of [`chain::Watch`] for monitoring channels.
18350  *
18351  * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
18352  * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
18353  * or used independently to monitor channels remotely. See the [module-level documentation] for
18354  * details.
18355  *
18356  * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
18357  * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
18358  * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
18359  * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
18360  * environment with spotty connections, like on mobile.
18361  *
18362  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18363  * [module-level documentation]: crate::chain::chainmonitor
18364  * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
18365  */
18366 typedef struct MUST_USE_STRUCT LDKChainMonitor {
18367    /**
18368     * A pointer to the opaque Rust object.
18369     * Nearly everywhere, inner must be non-null, however in places where
18370     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18371     */
18372    LDKnativeChainMonitor *inner;
18373    /**
18374     * Indicates that this is the only struct which contains the same pointer.
18375     * Rust functions which take ownership of an object provided via an argument require
18376     * this to be true and invalidate the object pointed to by inner.
18377     */
18378    bool is_owned;
18379 } LDKChainMonitor;
18380
18381 /**
18382  * A trait implemented for objects handling events from [`EventsProvider`].
18383  *
18384  * An async variation also exists for implementations of [`EventsProvider`] that support async
18385  * event handling. The async event handler should satisfy the generic bounds: `F:
18386  * core::future::Future, H: Fn(Event) -> F`.
18387  */
18388 typedef struct LDKEventHandler {
18389    /**
18390     * An opaque pointer which is passed to your function implementations as an argument.
18391     * This has no meaning in the LDK, and can be NULL or any other value.
18392     */
18393    void *this_arg;
18394    /**
18395     * Handles the given [`Event`].
18396     *
18397     * See [`EventsProvider`] for details that must be considered when implementing this method.
18398     */
18399    void (*handle_event)(const void *this_arg, struct LDKEvent event);
18400    /**
18401     * Frees any resources associated with this object given its this_arg pointer.
18402     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18403     */
18404    void (*free)(void *this_arg);
18405 } LDKEventHandler;
18406
18407 /**
18408  * A trait indicating an object may generate events.
18409  *
18410  * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
18411  *
18412  * Implementations of this trait may also feature an async version of event handling, as shown with
18413  * [`ChannelManager::process_pending_events_async`] and
18414  * [`ChainMonitor::process_pending_events_async`].
18415  *
18416  * # Requirements
18417  *
18418  * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
18419  * event since the last invocation.
18420  *
18421  * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
18422  * and replay any unhandled events on startup. An [`Event`] is considered handled when
18423  * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
18424  * relevant changes to disk *before* returning.
18425  *
18426  * Further, because an application may crash between an [`Event`] being handled and the
18427  * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
18428  * effect, [`Event`]s may be replayed.
18429  *
18430  * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
18431  * consult the provider's documentation on the implication of processing events and how a handler
18432  * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
18433  * [`ChainMonitor::process_pending_events`]).
18434  *
18435  * (C-not implementable) As there is likely no reason for a user to implement this trait on their
18436  * own type(s).
18437  *
18438  * [`process_pending_events`]: Self::process_pending_events
18439  * [`handle_event`]: EventHandler::handle_event
18440  * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
18441  * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
18442  * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
18443  * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
18444  */
18445 typedef struct LDKEventsProvider {
18446    /**
18447     * An opaque pointer which is passed to your function implementations as an argument.
18448     * This has no meaning in the LDK, and can be NULL or any other value.
18449     */
18450    void *this_arg;
18451    /**
18452     * Processes any events generated since the last call using the given event handler.
18453     *
18454     * See the trait-level documentation for requirements.
18455     */
18456    void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
18457    /**
18458     * Frees any resources associated with this object given its this_arg pointer.
18459     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18460     */
18461    void (*free)(void *this_arg);
18462 } LDKEventsProvider;
18463
18464 /**
18465  * This enum is used to specify which error data to send to peers when failing back an HTLC
18466  * using [`ChannelManager::fail_htlc_backwards_with_reason`].
18467  *
18468  * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
18469  */
18470 typedef enum LDKFailureCode_Tag {
18471    /**
18472     * We had a temporary error processing the payment. Useful if no other error codes fit
18473     * and you want to indicate that the payer may want to retry.
18474     */
18475    LDKFailureCode_TemporaryNodeFailure,
18476    /**
18477     * We have a required feature which was not in this onion. For example, you may require
18478     * some additional metadata that was not provided with this payment.
18479     */
18480    LDKFailureCode_RequiredNodeFeatureMissing,
18481    /**
18482     * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
18483     * the HTLC is too close to the current block height for safe handling.
18484     * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
18485     * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
18486     */
18487    LDKFailureCode_IncorrectOrUnknownPaymentDetails,
18488    /**
18489     * We failed to process the payload after the onion was decrypted. You may wish to
18490     * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
18491     *
18492     * If available, the tuple data may include the type number and byte offset in the
18493     * decrypted byte stream where the failure occurred.
18494     */
18495    LDKFailureCode_InvalidOnionPayload,
18496    /**
18497     * Must be last for serialization purposes
18498     */
18499    LDKFailureCode_Sentinel,
18500 } LDKFailureCode_Tag;
18501
18502 typedef struct MUST_USE_STRUCT LDKFailureCode {
18503    LDKFailureCode_Tag tag;
18504    union {
18505       struct {
18506          struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
18507       };
18508    };
18509 } LDKFailureCode;
18510
18511
18512
18513 /**
18514  * Chain-related parameters used to construct a new `ChannelManager`.
18515  *
18516  * Typically, the block-specific parameters are derived from the best block hash for the network,
18517  * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
18518  * are not needed when deserializing a previously constructed `ChannelManager`.
18519  */
18520 typedef struct MUST_USE_STRUCT LDKChainParameters {
18521    /**
18522     * A pointer to the opaque Rust object.
18523     * Nearly everywhere, inner must be non-null, however in places where
18524     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18525     */
18526    LDKnativeChainParameters *inner;
18527    /**
18528     * Indicates that this is the only struct which contains the same pointer.
18529     * Rust functions which take ownership of an object provided via an argument require
18530     * this to be true and invalidate the object pointed to by inner.
18531     */
18532    bool is_owned;
18533 } LDKChainParameters;
18534
18535 /**
18536  * A trait indicating an object may generate message send events
18537  */
18538 typedef struct LDKMessageSendEventsProvider {
18539    /**
18540     * An opaque pointer which is passed to your function implementations as an argument.
18541     * This has no meaning in the LDK, and can be NULL or any other value.
18542     */
18543    void *this_arg;
18544    /**
18545     * Gets the list of pending events which were generated by previous actions, clearing the list
18546     * in the process.
18547     */
18548    struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
18549    /**
18550     * Frees any resources associated with this object given its this_arg pointer.
18551     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18552     */
18553    void (*free)(void *this_arg);
18554 } LDKMessageSendEventsProvider;
18555
18556 /**
18557  * A trait to describe an object which can receive channel messages.
18558  *
18559  * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
18560  * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
18561  */
18562 typedef struct LDKChannelMessageHandler {
18563    /**
18564     * An opaque pointer which is passed to your function implementations as an argument.
18565     * This has no meaning in the LDK, and can be NULL or any other value.
18566     */
18567    void *this_arg;
18568    /**
18569     * Handle an incoming `open_channel` message from the given peer.
18570     */
18571    void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
18572    /**
18573     * Handle an incoming `open_channel2` message from the given peer.
18574     */
18575    void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
18576    /**
18577     * Handle an incoming `accept_channel` message from the given peer.
18578     */
18579    void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
18580    /**
18581     * Handle an incoming `accept_channel2` message from the given peer.
18582     */
18583    void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
18584    /**
18585     * Handle an incoming `funding_created` message from the given peer.
18586     */
18587    void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
18588    /**
18589     * Handle an incoming `funding_signed` message from the given peer.
18590     */
18591    void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
18592    /**
18593     * Handle an incoming `channel_ready` message from the given peer.
18594     */
18595    void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
18596    /**
18597     * Handle an incoming `shutdown` message from the given peer.
18598     */
18599    void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
18600    /**
18601     * Handle an incoming `closing_signed` message from the given peer.
18602     */
18603    void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
18604    /**
18605     * Handle an incoming `tx_add_input message` from the given peer.
18606     */
18607    void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
18608    /**
18609     * Handle an incoming `tx_add_output` message from the given peer.
18610     */
18611    void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
18612    /**
18613     * Handle an incoming `tx_remove_input` message from the given peer.
18614     */
18615    void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
18616    /**
18617     * Handle an incoming `tx_remove_output` message from the given peer.
18618     */
18619    void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
18620    /**
18621     * Handle an incoming `tx_complete message` from the given peer.
18622     */
18623    void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
18624    /**
18625     * Handle an incoming `tx_signatures` message from the given peer.
18626     */
18627    void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
18628    /**
18629     * Handle an incoming `tx_init_rbf` message from the given peer.
18630     */
18631    void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
18632    /**
18633     * Handle an incoming `tx_ack_rbf` message from the given peer.
18634     */
18635    void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
18636    /**
18637     * Handle an incoming `tx_abort message` from the given peer.
18638     */
18639    void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
18640    /**
18641     * Handle an incoming `update_add_htlc` message from the given peer.
18642     */
18643    void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
18644    /**
18645     * Handle an incoming `update_fulfill_htlc` message from the given peer.
18646     */
18647    void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
18648    /**
18649     * Handle an incoming `update_fail_htlc` message from the given peer.
18650     */
18651    void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
18652    /**
18653     * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
18654     */
18655    void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
18656    /**
18657     * Handle an incoming `commitment_signed` message from the given peer.
18658     */
18659    void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
18660    /**
18661     * Handle an incoming `revoke_and_ack` message from the given peer.
18662     */
18663    void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
18664    /**
18665     * Handle an incoming `update_fee` message from the given peer.
18666     */
18667    void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
18668    /**
18669     * Handle an incoming `announcement_signatures` message from the given peer.
18670     */
18671    void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
18672    /**
18673     * Indicates a connection to the peer failed/an existing connection was lost.
18674     */
18675    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
18676    /**
18677     * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
18678     *
18679     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18680     * with us. Implementors should be somewhat conservative about doing so, however, as other
18681     * message handlers may still wish to communicate with this peer.
18682     */
18683    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
18684    /**
18685     * Handle an incoming `channel_reestablish` message from the given peer.
18686     */
18687    void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
18688    /**
18689     * Handle an incoming `channel_update` message from the given peer.
18690     */
18691    void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
18692    /**
18693     * Handle an incoming `error` message from the given peer.
18694     */
18695    void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
18696    /**
18697     * Gets the node feature flags which this handler itself supports. All available handlers are
18698     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18699     * which are broadcasted in our [`NodeAnnouncement`] message.
18700     */
18701    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18702    /**
18703     * Gets the init feature flags which should be sent to the given peer. All available handlers
18704     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18705     * which are sent in our [`Init`] message.
18706     *
18707     * Note that this method is called before [`Self::peer_connected`].
18708     */
18709    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18710    /**
18711     * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
18712     *
18713     * If it's `None`, then no particular network chain hash compatibility will be enforced when
18714     * connecting to peers.
18715     */
18716    struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
18717    /**
18718     * Implementation of MessageSendEventsProvider for this object.
18719     */
18720    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
18721    /**
18722     * Frees any resources associated with this object given its this_arg pointer.
18723     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18724     */
18725    void (*free)(void *this_arg);
18726 } LDKChannelMessageHandler;
18727
18728 /**
18729  * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
18730  *
18731  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
18732  */
18733 typedef struct LDKOffersMessageHandler {
18734    /**
18735     * An opaque pointer which is passed to your function implementations as an argument.
18736     * This has no meaning in the LDK, and can be NULL or any other value.
18737     */
18738    void *this_arg;
18739    /**
18740     * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
18741     * or replying with an error.
18742     *
18743     * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
18744     *
18745     * [`OnionMessenger`]: crate::onion_message::OnionMessenger
18746     */
18747    struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
18748    /**
18749     * Releases any [`OffersMessage`]s that need to be sent.
18750     *
18751     * Typically, this is used for messages initiating a payment flow rather than in response to
18752     * another message. The latter should use the return value of [`Self::handle_message`].
18753     */
18754    struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
18755    /**
18756     * Frees any resources associated with this object given its this_arg pointer.
18757     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18758     */
18759    void (*free)(void *this_arg);
18760 } LDKOffersMessageHandler;
18761
18762
18763
18764 /**
18765  * Arguments for the creation of a ChannelManager that are not deserialized.
18766  *
18767  * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
18768  * is:
18769  * 1) Deserialize all stored [`ChannelMonitor`]s.
18770  * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
18771  *    `<(BlockHash, ChannelManager)>::read(reader, args)`
18772  *    This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
18773  *    [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
18774  * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
18775  *    same way you would handle a [`chain::Filter`] call using
18776  *    [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
18777  * 4) Reconnect blocks on your [`ChannelMonitor`]s.
18778  * 5) Disconnect/connect blocks on the [`ChannelManager`].
18779  * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
18780  *    Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
18781  *    will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
18782  *    the next step.
18783  * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
18784  *    [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
18785  *
18786  * Note that the ordering of #4-7 is not of importance, however all four must occur before you
18787  * call any other methods on the newly-deserialized [`ChannelManager`].
18788  *
18789  * Note that because some channels may be closed during deserialization, it is critical that you
18790  * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
18791  * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
18792  * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
18793  * not force-close the same channels but consider them live), you may end up revoking a state for
18794  * which you've already broadcasted the transaction.
18795  *
18796  * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
18797  */
18798 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
18799    /**
18800     * A pointer to the opaque Rust object.
18801     * Nearly everywhere, inner must be non-null, however in places where
18802     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18803     */
18804    LDKnativeChannelManagerReadArgs *inner;
18805    /**
18806     * Indicates that this is the only struct which contains the same pointer.
18807     * Rust functions which take ownership of an object provided via an argument require
18808     * this to be true and invalidate the object pointed to by inner.
18809     */
18810    bool is_owned;
18811 } LDKChannelManagerReadArgs;
18812
18813
18814
18815 /**
18816  * A set of keys that were HKDF-expanded from an initial call to
18817  * [`NodeSigner::get_inbound_payment_key_material`].
18818  *
18819  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
18820  */
18821 typedef struct MUST_USE_STRUCT LDKExpandedKey {
18822    /**
18823     * A pointer to the opaque Rust object.
18824     * Nearly everywhere, inner must be non-null, however in places where
18825     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18826     */
18827    LDKnativeExpandedKey *inner;
18828    /**
18829     * Indicates that this is the only struct which contains the same pointer.
18830     * Rust functions which take ownership of an object provided via an argument require
18831     * this to be true and invalidate the object pointed to by inner.
18832     */
18833    bool is_owned;
18834 } LDKExpandedKey;
18835
18836
18837
18838 /**
18839  * Packet of hop data for next peer
18840  */
18841 typedef struct MUST_USE_STRUCT LDKPacket {
18842    /**
18843     * A pointer to the opaque Rust object.
18844     * Nearly everywhere, inner must be non-null, however in places where
18845     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18846     */
18847    LDKnativePacket *inner;
18848    /**
18849     * Indicates that this is the only struct which contains the same pointer.
18850     * Rust functions which take ownership of an object provided via an argument require
18851     * this to be true and invalidate the object pointed to by inner.
18852     */
18853    bool is_owned;
18854 } LDKPacket;
18855
18856 /**
18857  * A 3-byte byte array.
18858  */
18859 typedef struct LDKThreeBytes {
18860    /**
18861     * The three bytes
18862     */
18863    uint8_t data[3];
18864 } LDKThreeBytes;
18865
18866 /**
18867  * A trait to describe an object which can receive routing messages.
18868  *
18869  * # Implementor DoS Warnings
18870  *
18871  * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
18872  * handling inbound queries. Implementors using an on-disk network graph should be aware of
18873  * repeated disk I/O for queries accessing different parts of the network graph.
18874  */
18875 typedef struct LDKRoutingMessageHandler {
18876    /**
18877     * An opaque pointer which is passed to your function implementations as an argument.
18878     * This has no meaning in the LDK, and can be NULL or any other value.
18879     */
18880    void *this_arg;
18881    /**
18882     * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
18883     * `false` or returning an `Err` otherwise.
18884     */
18885    struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
18886    /**
18887     * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
18888     * or returning an `Err` otherwise.
18889     */
18890    struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
18891    /**
18892     * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
18893     * `false` or returning an `Err` otherwise.
18894     */
18895    struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
18896    /**
18897     * Gets channel announcements and updates required to dump our routing table to a remote node,
18898     * starting at the `short_channel_id` indicated by `starting_point` and including announcements
18899     * for a single channel.
18900     */
18901    struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
18902    /**
18903     * Gets a node announcement required to dump our routing table to a remote node, starting at
18904     * the node *after* the provided pubkey and including up to one announcement immediately
18905     * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
18906     * If `None` is provided for `starting_point`, we start at the first node.
18907     *
18908     * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
18909     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18910     */
18911    struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
18912    /**
18913     * Called when a connection is established with a peer. This can be used to
18914     * perform routing table synchronization using a strategy defined by the
18915     * implementor.
18916     *
18917     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18918     * with us. Implementors should be somewhat conservative about doing so, however, as other
18919     * message handlers may still wish to communicate with this peer.
18920     */
18921    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
18922    /**
18923     * Handles the reply of a query we initiated to learn about channels
18924     * for a given range of blocks. We can expect to receive one or more
18925     * replies to a single query.
18926     */
18927    struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
18928    /**
18929     * Handles the reply of a query we initiated asking for routing gossip
18930     * messages for a list of channels. We should receive this message when
18931     * a node has completed its best effort to send us the pertaining routing
18932     * gossip messages.
18933     */
18934    struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
18935    /**
18936     * Handles when a peer asks us to send a list of `short_channel_id`s
18937     * for the requested range of blocks.
18938     */
18939    struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
18940    /**
18941     * Handles when a peer asks us to send routing gossip messages for a
18942     * list of `short_channel_id`s.
18943     */
18944    struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
18945    /**
18946     * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
18947     * pending some async action. While there is no guarantee of the rate of future messages, the
18948     * caller should seek to reduce the rate of new gossip messages handled, especially
18949     * [`ChannelAnnouncement`]s.
18950     */
18951    bool (*processing_queue_high)(const void *this_arg);
18952    /**
18953     * Gets the node feature flags which this handler itself supports. All available handlers are
18954     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18955     * which are broadcasted in our [`NodeAnnouncement`] message.
18956     */
18957    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18958    /**
18959     * Gets the init feature flags which should be sent to the given peer. All available handlers
18960     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18961     * which are sent in our [`Init`] message.
18962     *
18963     * Note that this method is called before [`Self::peer_connected`].
18964     */
18965    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18966    /**
18967     * Implementation of MessageSendEventsProvider for this object.
18968     */
18969    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
18970    /**
18971     * Frees any resources associated with this object given its this_arg pointer.
18972     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18973     */
18974    void (*free)(void *this_arg);
18975 } LDKRoutingMessageHandler;
18976
18977 /**
18978  * A handler for received [`OnionMessage`]s and for providing generated ones to send.
18979  */
18980 typedef struct LDKOnionMessageHandler {
18981    /**
18982     * An opaque pointer which is passed to your function implementations as an argument.
18983     * This has no meaning in the LDK, and can be NULL or any other value.
18984     */
18985    void *this_arg;
18986    /**
18987     * Handle an incoming `onion_message` message from the given peer.
18988     */
18989    void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
18990    /**
18991     * Returns the next pending onion message for the peer with the given node id.
18992     *
18993     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18994     */
18995    struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
18996    /**
18997     * Called when a connection is established with a peer. Can be used to track which peers
18998     * advertise onion message support and are online.
18999     *
19000     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
19001     * with us. Implementors should be somewhat conservative about doing so, however, as other
19002     * message handlers may still wish to communicate with this peer.
19003     */
19004    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
19005    /**
19006     * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
19007     * drop and refuse to forward onion messages to this peer.
19008     */
19009    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
19010    /**
19011     * Gets the node feature flags which this handler itself supports. All available handlers are
19012     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
19013     * which are broadcasted in our [`NodeAnnouncement`] message.
19014     */
19015    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
19016    /**
19017     * Gets the init feature flags which should be sent to the given peer. All available handlers
19018     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
19019     * which are sent in our [`Init`] message.
19020     *
19021     * Note that this method is called before [`Self::peer_connected`].
19022     */
19023    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
19024    /**
19025     * Frees any resources associated with this object given its this_arg pointer.
19026     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19027     */
19028    void (*free)(void *this_arg);
19029 } LDKOnionMessageHandler;
19030
19031 /**
19032  * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
19033  * decoders.
19034  */
19035 typedef struct LDKCustomMessageReader {
19036    /**
19037     * An opaque pointer which is passed to your function implementations as an argument.
19038     * This has no meaning in the LDK, and can be NULL or any other value.
19039     */
19040    void *this_arg;
19041    /**
19042     * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
19043     * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
19044     * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
19045     * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
19046     */
19047    struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
19048    /**
19049     * Frees any resources associated with this object given its this_arg pointer.
19050     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19051     */
19052    void (*free)(void *this_arg);
19053 } LDKCustomMessageReader;
19054
19055 /**
19056  * A handler provided to [`PeerManager`] for reading and handling custom messages.
19057  *
19058  * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
19059  * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
19060  * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
19061  *
19062  * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
19063  * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
19064  */
19065 typedef struct LDKCustomMessageHandler {
19066    /**
19067     * An opaque pointer which is passed to your function implementations as an argument.
19068     * This has no meaning in the LDK, and can be NULL or any other value.
19069     */
19070    void *this_arg;
19071    /**
19072     * Handles the given message sent from `sender_node_id`, possibly producing messages for
19073     * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
19074     * to send.
19075     */
19076    struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
19077    /**
19078     * Returns the list of pending messages that were generated by the handler, clearing the list
19079     * in the process. Each message is paired with the node id of the intended recipient. If no
19080     * connection to the node exists, then the message is simply not sent.
19081     */
19082    struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
19083    /**
19084     * Gets the node feature flags which this handler itself supports. All available handlers are
19085     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
19086     * which are broadcasted in our [`NodeAnnouncement`] message.
19087     *
19088     * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
19089     */
19090    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
19091    /**
19092     * Gets the init feature flags which should be sent to the given peer. All available handlers
19093     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
19094     * which are sent in our [`Init`] message.
19095     *
19096     * [`Init`]: crate::ln::msgs::Init
19097     */
19098    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
19099    /**
19100     * Implementation of CustomMessageReader for this object.
19101     */
19102    struct LDKCustomMessageReader CustomMessageReader;
19103    /**
19104     * Frees any resources associated with this object given its this_arg pointer.
19105     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19106     */
19107    void (*free)(void *this_arg);
19108 } LDKCustomMessageHandler;
19109
19110
19111
19112 /**
19113  * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
19114  * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
19115  */
19116 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
19117    /**
19118     * A pointer to the opaque Rust object.
19119     * Nearly everywhere, inner must be non-null, however in places where
19120     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19121     */
19122    LDKnativeIgnoringMessageHandler *inner;
19123    /**
19124     * Indicates that this is the only struct which contains the same pointer.
19125     * Rust functions which take ownership of an object provided via an argument require
19126     * this to be true and invalidate the object pointed to by inner.
19127     */
19128    bool is_owned;
19129 } LDKIgnoringMessageHandler;
19130
19131 /**
19132  * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
19133  * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
19134  * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
19135  * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
19136  * message types.
19137  *
19138  * See [`OnionMessenger`] for example usage.
19139  *
19140  * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
19141  * [`CustomMessage`]: Self::CustomMessage
19142  */
19143 typedef struct LDKCustomOnionMessageHandler {
19144    /**
19145     * An opaque pointer which is passed to your function implementations as an argument.
19146     * This has no meaning in the LDK, and can be NULL or any other value.
19147     */
19148    void *this_arg;
19149    /**
19150     * Called with the custom message that was received, returning a response to send, if any.
19151     *
19152     * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
19153     */
19154    struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
19155    /**
19156     * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
19157     * message type is unknown.
19158     */
19159    struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
19160    /**
19161     * Releases any [`Self::CustomMessage`]s that need to be sent.
19162     *
19163     * Typically, this is used for messages initiating a message flow rather than in response to
19164     * another message. The latter should use the return value of [`Self::handle_custom_message`].
19165     */
19166    struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
19167    /**
19168     * Frees any resources associated with this object given its this_arg pointer.
19169     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19170     */
19171    void (*free)(void *this_arg);
19172 } LDKCustomOnionMessageHandler;
19173
19174
19175
19176 /**
19177  * A dummy struct which implements `ChannelMessageHandler` without having any channels.
19178  * You can provide one of these as the route_handler in a MessageHandler.
19179  */
19180 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
19181    /**
19182     * A pointer to the opaque Rust object.
19183     * Nearly everywhere, inner must be non-null, however in places where
19184     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19185     */
19186    LDKnativeErroringMessageHandler *inner;
19187    /**
19188     * Indicates that this is the only struct which contains the same pointer.
19189     * Rust functions which take ownership of an object provided via an argument require
19190     * this to be true and invalidate the object pointed to by inner.
19191     */
19192    bool is_owned;
19193 } LDKErroringMessageHandler;
19194
19195
19196
19197 /**
19198  * Provides references to trait impls which handle different types of messages.
19199  */
19200 typedef struct MUST_USE_STRUCT LDKMessageHandler {
19201    /**
19202     * A pointer to the opaque Rust object.
19203     * Nearly everywhere, inner must be non-null, however in places where
19204     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19205     */
19206    LDKnativeMessageHandler *inner;
19207    /**
19208     * Indicates that this is the only struct which contains the same pointer.
19209     * Rust functions which take ownership of an object provided via an argument require
19210     * this to be true and invalidate the object pointed to by inner.
19211     */
19212    bool is_owned;
19213 } LDKMessageHandler;
19214
19215 /**
19216  * Provides an object which can be used to send data to and which uniquely identifies a connection
19217  * to a remote host. You will need to be able to generate multiple of these which meet Eq and
19218  * implement Hash to meet the PeerManager API.
19219  *
19220  * For efficiency, [`Clone`] should be relatively cheap for this type.
19221  *
19222  * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
19223  * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
19224  * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
19225  * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
19226  * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
19227  * to simply use another value which is guaranteed to be globally unique instead.
19228  */
19229 typedef struct LDKSocketDescriptor {
19230    /**
19231     * An opaque pointer which is passed to your function implementations as an argument.
19232     * This has no meaning in the LDK, and can be NULL or any other value.
19233     */
19234    void *this_arg;
19235    /**
19236     * Attempts to send some data from the given slice to the peer.
19237     *
19238     * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
19239     * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
19240     * called and further write attempts may occur until that time.
19241     *
19242     * If the returned size is smaller than `data.len()`, a
19243     * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
19244     * written. Additionally, until a `send_data` event completes fully, no further
19245     * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
19246     * prevent denial-of-service issues, you should not read or buffer any data from the socket
19247     * until then.
19248     *
19249     * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
19250     * (indicating that read events should be paused to prevent DoS in the send buffer),
19251     * `resume_read` may be set indicating that read events on this descriptor should resume. A
19252     * `resume_read` of false carries no meaning, and should not cause any action.
19253     */
19254    uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
19255    /**
19256     * Disconnect the socket pointed to by this SocketDescriptor.
19257     *
19258     * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
19259     * call (doing so is a noop).
19260     */
19261    void (*disconnect_socket)(void *this_arg);
19262    /**
19263     * Checks if two objects are equal given this object's this_arg pointer and another object.
19264     */
19265    bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
19266    /**
19267     * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
19268     * This is used, for example, for inclusion of this object in a hash map.
19269     */
19270    uint64_t (*hash)(const void *this_arg);
19271    /**
19272     * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
19273     * The new SocketDescriptor is provided, and should be mutated as needed to perform a
19274     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
19275     */
19276    void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
19277    /**
19278     * Frees any resources associated with this object given its this_arg pointer.
19279     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19280     */
19281    void (*free)(void *this_arg);
19282 } LDKSocketDescriptor;
19283
19284
19285
19286 /**
19287  * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
19288  * socket events into messages which it passes on to its [`MessageHandler`].
19289  *
19290  * Locks are taken internally, so you must never assume that reentrancy from a
19291  * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
19292  *
19293  * Calls to [`read_event`] will decode relevant messages and pass them to the
19294  * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
19295  * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
19296  * [`PeerManager`] functions related to the same connection must occur only in serial, making new
19297  * calls only after previous ones have returned.
19298  *
19299  * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
19300  * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
19301  * essentially you should default to using a [`SimpleRefPeerManager`], and use a
19302  * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
19303  * you're using lightning-net-tokio.
19304  *
19305  * [`read_event`]: PeerManager::read_event
19306  */
19307 typedef struct MUST_USE_STRUCT LDKPeerManager {
19308    /**
19309     * A pointer to the opaque Rust object.
19310     * Nearly everywhere, inner must be non-null, however in places where
19311     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19312     */
19313    LDKnativePeerManager *inner;
19314    /**
19315     * Indicates that this is the only struct which contains the same pointer.
19316     * Rust functions which take ownership of an object provided via an argument require
19317     * this to be true and invalidate the object pointed to by inner.
19318     */
19319    bool is_owned;
19320 } LDKPeerManager;
19321
19322
19323
19324 /**
19325  * Static channel fields used to build transactions given per-commitment fields, organized by
19326  * broadcaster/countersignatory.
19327  *
19328  * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
19329  * as_holder_broadcastable and as_counterparty_broadcastable functions.
19330  */
19331 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
19332    /**
19333     * A pointer to the opaque Rust object.
19334     * Nearly everywhere, inner must be non-null, however in places where
19335     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19336     */
19337    LDKnativeDirectedChannelTransactionParameters *inner;
19338    /**
19339     * Indicates that this is the only struct which contains the same pointer.
19340     * Rust functions which take ownership of an object provided via an argument require
19341     * this to be true and invalidate the object pointed to by inner.
19342     */
19343    bool is_owned;
19344 } LDKDirectedChannelTransactionParameters;
19345
19346
19347
19348 /**
19349  * Features used within an `offer`.
19350  */
19351 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
19352    /**
19353     * A pointer to the opaque Rust object.
19354     * Nearly everywhere, inner must be non-null, however in places where
19355     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19356     */
19357    LDKnativeOfferFeatures *inner;
19358    /**
19359     * Indicates that this is the only struct which contains the same pointer.
19360     * Rust functions which take ownership of an object provided via an argument require
19361     * this to be true and invalidate the object pointed to by inner.
19362     */
19363    bool is_owned;
19364 } LDKOfferFeatures;
19365
19366
19367
19368 /**
19369  * Features used within an `invoice_request`.
19370  */
19371 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
19372    /**
19373     * A pointer to the opaque Rust object.
19374     * Nearly everywhere, inner must be non-null, however in places where
19375     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19376     */
19377    LDKnativeInvoiceRequestFeatures *inner;
19378    /**
19379     * Indicates that this is the only struct which contains the same pointer.
19380     * Rust functions which take ownership of an object provided via an argument require
19381     * this to be true and invalidate the object pointed to by inner.
19382     */
19383    bool is_owned;
19384 } LDKInvoiceRequestFeatures;
19385
19386 /**
19387  * Integer in the range `0..=16`
19388  */
19389 typedef struct LDKWitnessVersion {
19390    uint8_t _0;
19391 } LDKWitnessVersion;
19392
19393
19394
19395 /**
19396  * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
19397  * another currency.
19398  */
19399 typedef struct MUST_USE_STRUCT LDKAmount {
19400    /**
19401     * A pointer to the opaque Rust object.
19402     * Nearly everywhere, inner must be non-null, however in places where
19403     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19404     */
19405    LDKnativeAmount *inner;
19406    /**
19407     * Indicates that this is the only struct which contains the same pointer.
19408     * Rust functions which take ownership of an object provided via an argument require
19409     * this to be true and invalidate the object pointed to by inner.
19410     */
19411    bool is_owned;
19412 } LDKAmount;
19413
19414
19415
19416 /**
19417  * Quantity of items supported by an [`Offer`].
19418  */
19419 typedef struct MUST_USE_STRUCT LDKQuantity {
19420    /**
19421     * A pointer to the opaque Rust object.
19422     * Nearly everywhere, inner must be non-null, however in places where
19423     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19424     */
19425    LDKnativeQuantity *inner;
19426    /**
19427     * Indicates that this is the only struct which contains the same pointer.
19428     * Rust functions which take ownership of an object provided via an argument require
19429     * this to be true and invalidate the object pointed to by inner.
19430     */
19431    bool is_owned;
19432 } LDKQuantity;
19433
19434
19435
19436 /**
19437  * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
19438  * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
19439  *
19440  * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
19441  * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
19442  */
19443 typedef struct MUST_USE_STRUCT LDKTaggedHash {
19444    /**
19445     * A pointer to the opaque Rust object.
19446     * Nearly everywhere, inner must be non-null, however in places where
19447     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19448     */
19449    LDKnativeTaggedHash *inner;
19450    /**
19451     * Indicates that this is the only struct which contains the same pointer.
19452     * Rust functions which take ownership of an object provided via an argument require
19453     * this to be true and invalidate the object pointed to by inner.
19454     */
19455    bool is_owned;
19456 } LDKTaggedHash;
19457
19458
19459
19460 /**
19461  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
19462  *
19463  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
19464  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
19465  */
19466 typedef struct MUST_USE_STRUCT LDKErroneousField {
19467    /**
19468     * A pointer to the opaque Rust object.
19469     * Nearly everywhere, inner must be non-null, however in places where
19470     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19471     */
19472    LDKnativeErroneousField *inner;
19473    /**
19474     * Indicates that this is the only struct which contains the same pointer.
19475     * Rust functions which take ownership of an object provided via an argument require
19476     * this to be true and invalidate the object pointed to by inner.
19477     */
19478    bool is_owned;
19479 } LDKErroneousField;
19480
19481
19482
19483 /**
19484  * Receives and validates network updates from peers,
19485  * stores authentic and relevant data as a network graph.
19486  * This network graph is then used for routing payments.
19487  * Provides interface to help with initial routing sync by
19488  * serving historical announcements.
19489  */
19490 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
19491    /**
19492     * A pointer to the opaque Rust object.
19493     * Nearly everywhere, inner must be non-null, however in places where
19494     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19495     */
19496    LDKnativeP2PGossipSync *inner;
19497    /**
19498     * Indicates that this is the only struct which contains the same pointer.
19499     * Rust functions which take ownership of an object provided via an argument require
19500     * this to be true and invalidate the object pointed to by inner.
19501     */
19502    bool is_owned;
19503 } LDKP2PGossipSync;
19504
19505
19506
19507 /**
19508  * A read-only view of [`NetworkGraph`].
19509  */
19510 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
19511    /**
19512     * A pointer to the opaque Rust object.
19513     * Nearly everywhere, inner must be non-null, however in places where
19514     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19515     */
19516    LDKnativeReadOnlyNetworkGraph *inner;
19517    /**
19518     * Indicates that this is the only struct which contains the same pointer.
19519     * Rust functions which take ownership of an object provided via an argument require
19520     * this to be true and invalidate the object pointed to by inner.
19521     */
19522    bool is_owned;
19523 } LDKReadOnlyNetworkGraph;
19524
19525
19526
19527 /**
19528  * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
19529  * source node to a target node.
19530  */
19531 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
19532    /**
19533     * A pointer to the opaque Rust object.
19534     * Nearly everywhere, inner must be non-null, however in places where
19535     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19536     */
19537    LDKnativeDirectedChannelInfo *inner;
19538    /**
19539     * Indicates that this is the only struct which contains the same pointer.
19540     * Rust functions which take ownership of an object provided via an argument require
19541     * this to be true and invalidate the object pointed to by inner.
19542     */
19543    bool is_owned;
19544 } LDKDirectedChannelInfo;
19545
19546 /**
19547  * The effective capacity of a channel for routing purposes.
19548  *
19549  * While this may be smaller than the actual channel capacity, amounts greater than
19550  * [`Self::as_msat`] should not be routed through the channel.
19551  */
19552 typedef enum LDKEffectiveCapacity_Tag {
19553    /**
19554     * The available liquidity in the channel known from being a channel counterparty, and thus a
19555     * direct hop.
19556     */
19557    LDKEffectiveCapacity_ExactLiquidity,
19558    /**
19559     * The maximum HTLC amount in one direction as advertised on the gossip network.
19560     */
19561    LDKEffectiveCapacity_AdvertisedMaxHTLC,
19562    /**
19563     * The total capacity of the channel as determined by the funding transaction.
19564     */
19565    LDKEffectiveCapacity_Total,
19566    /**
19567     * A capacity sufficient to route any payment, typically used for private channels provided by
19568     * an invoice.
19569     */
19570    LDKEffectiveCapacity_Infinite,
19571    /**
19572     * The maximum HTLC amount as provided by an invoice route hint.
19573     */
19574    LDKEffectiveCapacity_HintMaxHTLC,
19575    /**
19576     * A capacity that is unknown possibly because either the chain state is unavailable to know
19577     * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
19578     */
19579    LDKEffectiveCapacity_Unknown,
19580    /**
19581     * Must be last for serialization purposes
19582     */
19583    LDKEffectiveCapacity_Sentinel,
19584 } LDKEffectiveCapacity_Tag;
19585
19586 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
19587    /**
19588     * Either the inbound or outbound liquidity depending on the direction, denominated in
19589     * millisatoshi.
19590     */
19591    uint64_t liquidity_msat;
19592 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
19593
19594 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
19595    /**
19596     * The maximum HTLC amount denominated in millisatoshi.
19597     */
19598    uint64_t amount_msat;
19599 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
19600
19601 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
19602    /**
19603     * The funding amount denominated in millisatoshi.
19604     */
19605    uint64_t capacity_msat;
19606    /**
19607     * The maximum HTLC amount denominated in millisatoshi.
19608     */
19609    uint64_t htlc_maximum_msat;
19610 } LDKEffectiveCapacity_LDKTotal_Body;
19611
19612 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
19613    /**
19614     * The maximum HTLC amount denominated in millisatoshi.
19615     */
19616    uint64_t amount_msat;
19617 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
19618
19619 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
19620    LDKEffectiveCapacity_Tag tag;
19621    union {
19622       LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
19623       LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
19624       LDKEffectiveCapacity_LDKTotal_Body total;
19625       LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
19626    };
19627 } LDKEffectiveCapacity;
19628
19629
19630
19631 /**
19632  * A [`Router`] implemented using [`find_route`].
19633  */
19634 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
19635    /**
19636     * A pointer to the opaque Rust object.
19637     * Nearly everywhere, inner must be non-null, however in places where
19638     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19639     */
19640    LDKnativeDefaultRouter *inner;
19641    /**
19642     * Indicates that this is the only struct which contains the same pointer.
19643     * Rust functions which take ownership of an object provided via an argument require
19644     * this to be true and invalidate the object pointed to by inner.
19645     */
19646    bool is_owned;
19647 } LDKDefaultRouter;
19648
19649
19650
19651 /**
19652  * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
19653  *
19654  * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
19655  * [`find_route`].
19656  *
19657  * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
19658  */
19659 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
19660    /**
19661     * A pointer to the opaque Rust object.
19662     * Nearly everywhere, inner must be non-null, however in places where
19663     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19664     */
19665    LDKnativeScorerAccountingForInFlightHtlcs *inner;
19666    /**
19667     * Indicates that this is the only struct which contains the same pointer.
19668     * Rust functions which take ownership of an object provided via an argument require
19669     * this to be true and invalidate the object pointed to by inner.
19670     */
19671    bool is_owned;
19672 } LDKScorerAccountingForInFlightHtlcs;
19673
19674 /**
19675  * The recipient of a payment, differing based on whether they've hidden their identity with route
19676  * blinding.
19677  */
19678 typedef enum LDKPayee_Tag {
19679    /**
19680     * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
19681     * will be included in the final [`Route`].
19682     */
19683    LDKPayee_Blinded,
19684    /**
19685     * The recipient included these route hints in their BOLT11 invoice.
19686     */
19687    LDKPayee_Clear,
19688    /**
19689     * Must be last for serialization purposes
19690     */
19691    LDKPayee_Sentinel,
19692 } LDKPayee_Tag;
19693
19694 typedef struct LDKPayee_LDKBlinded_Body {
19695    /**
19696     * Aggregated routing info and blinded paths, for routing to the payee without knowing their
19697     * node id.
19698     */
19699    struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
19700    /**
19701     * Features supported by the payee.
19702     *
19703     * May be set from the payee's invoice. May be `None` if the invoice does not contain any
19704     * features.
19705     *
19706     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19707     */
19708    struct LDKBolt12InvoiceFeatures features;
19709 } LDKPayee_LDKBlinded_Body;
19710
19711 typedef struct LDKPayee_LDKClear_Body {
19712    /**
19713     * The node id of the payee.
19714     */
19715    struct LDKPublicKey node_id;
19716    /**
19717     * Hints for routing to the payee, containing channels connecting the payee to public nodes.
19718     */
19719    struct LDKCVec_RouteHintZ route_hints;
19720    /**
19721     * Features supported by the payee.
19722     *
19723     * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
19724     * does not contain any features.
19725     *
19726     * [`for_keysend`]: PaymentParameters::for_keysend
19727     *
19728     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19729     */
19730    struct LDKBolt11InvoiceFeatures features;
19731    /**
19732     * The minimum CLTV delta at the end of the route. This value must not be zero.
19733     */
19734    uint32_t final_cltv_expiry_delta;
19735 } LDKPayee_LDKClear_Body;
19736
19737 typedef struct MUST_USE_STRUCT LDKPayee {
19738    LDKPayee_Tag tag;
19739    union {
19740       LDKPayee_LDKBlinded_Body blinded;
19741       LDKPayee_LDKClear_Body clear;
19742    };
19743 } LDKPayee;
19744
19745 /**
19746  * A trait which can both lookup and update routing channel penalty scores.
19747  *
19748  * This is used in places where both bounds are required and implemented for all types which
19749  * implement [`ScoreLookUp`] and [`ScoreUpdate`].
19750  *
19751  * Bindings users may need to manually implement this for their custom scoring implementations.
19752  */
19753 typedef struct LDKScore {
19754    /**
19755     * An opaque pointer which is passed to your function implementations as an argument.
19756     * This has no meaning in the LDK, and can be NULL or any other value.
19757     */
19758    void *this_arg;
19759    /**
19760     * Implementation of ScoreLookUp for this object.
19761     */
19762    struct LDKScoreLookUp ScoreLookUp;
19763    /**
19764     * Implementation of ScoreUpdate for this object.
19765     */
19766    struct LDKScoreUpdate ScoreUpdate;
19767    /**
19768     * Serialize the object into a byte array
19769     */
19770    struct LDKCVec_u8Z (*write)(const void *this_arg);
19771    /**
19772     * Frees any resources associated with this object given its this_arg pointer.
19773     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19774     */
19775    void (*free)(void *this_arg);
19776 } LDKScore;
19777
19778
19779
19780 /**
19781  * A concrete implementation of [`LockableScore`] which supports multi-threading.
19782  */
19783 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
19784    /**
19785     * A pointer to the opaque Rust object.
19786     * Nearly everywhere, inner must be non-null, however in places where
19787     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19788     */
19789    LDKnativeMultiThreadedLockableScore *inner;
19790    /**
19791     * Indicates that this is the only struct which contains the same pointer.
19792     * Rust functions which take ownership of an object provided via an argument require
19793     * this to be true and invalidate the object pointed to by inner.
19794     */
19795    bool is_owned;
19796 } LDKMultiThreadedLockableScore;
19797
19798
19799
19800 /**
19801  * A locked `MultiThreadedLockableScore`.
19802  */
19803 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
19804    /**
19805     * A pointer to the opaque Rust object.
19806     * Nearly everywhere, inner must be non-null, however in places where
19807     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19808     */
19809    LDKnativeMultiThreadedScoreLockRead *inner;
19810    /**
19811     * Indicates that this is the only struct which contains the same pointer.
19812     * Rust functions which take ownership of an object provided via an argument require
19813     * this to be true and invalidate the object pointed to by inner.
19814     */
19815    bool is_owned;
19816 } LDKMultiThreadedScoreLockRead;
19817
19818
19819
19820 /**
19821  * A locked `MultiThreadedLockableScore`.
19822  */
19823 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
19824    /**
19825     * A pointer to the opaque Rust object.
19826     * Nearly everywhere, inner must be non-null, however in places where
19827     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19828     */
19829    LDKnativeMultiThreadedScoreLockWrite *inner;
19830    /**
19831     * Indicates that this is the only struct which contains the same pointer.
19832     * Rust functions which take ownership of an object provided via an argument require
19833     * this to be true and invalidate the object pointed to by inner.
19834     */
19835    bool is_owned;
19836 } LDKMultiThreadedScoreLockWrite;
19837
19838
19839
19840 /**
19841  * Parameters for configuring [`ProbabilisticScorer`].
19842  *
19843  * Used to configure decay parameters that are static throughout the lifetime of the scorer.
19844  * these decay parameters affect the score of the channel penalty and are not changed on a
19845  * per-route penalty cost call.
19846  */
19847 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
19848    /**
19849     * A pointer to the opaque Rust object.
19850     * Nearly everywhere, inner must be non-null, however in places where
19851     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19852     */
19853    LDKnativeProbabilisticScoringDecayParameters *inner;
19854    /**
19855     * Indicates that this is the only struct which contains the same pointer.
19856     * Rust functions which take ownership of an object provided via an argument require
19857     * this to be true and invalidate the object pointed to by inner.
19858     */
19859    bool is_owned;
19860 } LDKProbabilisticScoringDecayParameters;
19861
19862
19863
19864 /**
19865  * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
19866  * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
19867  *
19868  * Your `node_id` is seed/0'.
19869  * Unilateral closes may use seed/1'.
19870  * Cooperative closes may use seed/2'.
19871  * The two close keys may be needed to claim on-chain funds!
19872  *
19873  * This struct cannot be used for nodes that wish to support receiving phantom payments;
19874  * [`PhantomKeysManager`] must be used instead.
19875  *
19876  * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
19877  * previously issued invoices and attempts to pay previous invoices will fail.
19878  */
19879 typedef struct MUST_USE_STRUCT LDKKeysManager {
19880    /**
19881     * A pointer to the opaque Rust object.
19882     * Nearly everywhere, inner must be non-null, however in places where
19883     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19884     */
19885    LDKnativeKeysManager *inner;
19886    /**
19887     * Indicates that this is the only struct which contains the same pointer.
19888     * Rust functions which take ownership of an object provided via an argument require
19889     * this to be true and invalidate the object pointed to by inner.
19890     */
19891    bool is_owned;
19892 } LDKKeysManager;
19893
19894
19895
19896 /**
19897  * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
19898  * payments.
19899  *
19900  * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
19901  * paid to one of multiple nodes. This works because we encode the invoice route hints such that
19902  * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
19903  * itself without ever needing to forward to this fake node.
19904  *
19905  * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
19906  * provide some fault tolerance, because payers will automatically retry paying other provided
19907  * nodes in the case that one node goes down.
19908  *
19909  * Note that multi-path payments are not supported in phantom invoices for security reasons.
19910  * Switching between this struct and [`KeysManager`] will invalidate any previously issued
19911  * invoices and attempts to pay previous invoices will fail.
19912  */
19913 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
19914    /**
19915     * A pointer to the opaque Rust object.
19916     * Nearly everywhere, inner must be non-null, however in places where
19917     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19918     */
19919    LDKnativePhantomKeysManager *inner;
19920    /**
19921     * Indicates that this is the only struct which contains the same pointer.
19922     * Rust functions which take ownership of an object provided via an argument require
19923     * this to be true and invalidate the object pointed to by inner.
19924     */
19925    bool is_owned;
19926 } LDKPhantomKeysManager;
19927
19928 /**
19929  * A trait defining behavior for routing an [`OnionMessage`].
19930  */
19931 typedef struct LDKMessageRouter {
19932    /**
19933     * An opaque pointer which is passed to your function implementations as an argument.
19934     * This has no meaning in the LDK, and can be NULL or any other value.
19935     */
19936    void *this_arg;
19937    /**
19938     * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
19939     */
19940    struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
19941    /**
19942     * Frees any resources associated with this object given its this_arg pointer.
19943     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19944     */
19945    void (*free)(void *this_arg);
19946 } LDKMessageRouter;
19947
19948
19949
19950 /**
19951  * A sender, receiver and forwarder of [`OnionMessage`]s.
19952  *
19953  * # Handling Messages
19954  *
19955  * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
19956  * messages to peers or delegating to the appropriate handler for the message type. Currently, the
19957  * available handlers are:
19958  * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
19959  * * [`CustomOnionMessageHandler`], for handling user-defined message types
19960  *
19961  * # Sending Messages
19962  *
19963  * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
19964  * a message, the matched handler may return a response message which `OnionMessenger` will send
19965  * on its behalf.
19966  *
19967  * # Example
19968  *
19969  * ```
19970  * # extern crate bitcoin;
19971  * # use bitcoin::hashes::_export::_core::time::Duration;
19972  * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
19973  * # use lightning::blinded_path::BlindedPath;
19974  * # use lightning::sign::KeysManager;
19975  * # use lightning::ln::peer_handler::IgnoringMessageHandler;
19976  * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessenger, OnionMessagePath};
19977  * # use lightning::onion_message::packet::OnionMessageContents;
19978  * # use lightning::util::logger::{Logger, Record};
19979  * # use lightning::util::ser::{Writeable, Writer};
19980  * # use lightning::io;
19981  * # use std::sync::Arc;
19982  * # struct FakeLogger;
19983  * # impl Logger for FakeLogger {
19984  * #     fn log(&self, record: &Record) { unimplemented!() }
19985  * # }
19986  * # struct FakeMessageRouter {}
19987  * # impl MessageRouter for FakeMessageRouter {
19988  * #     fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
19989  * #         unimplemented!()
19990  * #     }
19991  * # }
19992  * # let seed = [42u8; 32];
19993  * # let time = Duration::from_secs(123456);
19994  * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
19995  * # let logger = Arc::new(FakeLogger {});
19996  * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
19997  * # let secp_ctx = Secp256k1::new();
19998  * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
19999  * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
20000  * # let destination_node_id = hop_node_id1;
20001  * # let message_router = Arc::new(FakeMessageRouter {});
20002  * # let custom_message_handler = IgnoringMessageHandler {};
20003  * # let offers_message_handler = IgnoringMessageHandler {};
20004  * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
20005  * // ChannelManager.
20006  * let onion_messenger = OnionMessenger::new(
20007  *     &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
20008  *     &custom_message_handler
20009  * );
20010  *
20011  * # #[derive(Clone)]
20012  * # struct YourCustomMessage {}
20013  * impl Writeable for YourCustomMessage {
20014  * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
20015  * \t\t# Ok(())
20016  * \t\t// Write your custom onion message to `w`
20017  * \t}
20018  * }
20019  * impl OnionMessageContents for YourCustomMessage {
20020  * \tfn tlv_type(&self) -> u64 {
20021  * \t\t# let your_custom_message_type = 42;
20022  * \t\tyour_custom_message_type
20023  * \t}
20024  * }
20025  * // Send a custom onion message to a node id.
20026  * let path = OnionMessagePath {
20027  * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
20028  * \tdestination: Destination::Node(destination_node_id),
20029  * };
20030  * let reply_path = None;
20031  * # let message = YourCustomMessage {};
20032  * onion_messenger.send_onion_message(path, message, reply_path);
20033  *
20034  * // Create a blinded path to yourself, for someone to send an onion message to.
20035  * # let your_node_id = hop_node_id1;
20036  * let hops = [hop_node_id3, hop_node_id4, your_node_id];
20037  * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
20038  *
20039  * // Send a custom onion message to a blinded path.
20040  * let path = OnionMessagePath {
20041  * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
20042  * \tdestination: Destination::BlindedPath(blinded_path),
20043  * };
20044  * let reply_path = None;
20045  * # let message = YourCustomMessage {};
20046  * onion_messenger.send_onion_message(path, message, reply_path);
20047  * ```
20048  *
20049  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
20050  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
20051  */
20052 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
20053    /**
20054     * A pointer to the opaque Rust object.
20055     * Nearly everywhere, inner must be non-null, however in places where
20056     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20057     */
20058    LDKnativeOnionMessenger *inner;
20059    /**
20060     * Indicates that this is the only struct which contains the same pointer.
20061     * Rust functions which take ownership of an object provided via an argument require
20062     * this to be true and invalidate the object pointed to by inner.
20063     */
20064    bool is_owned;
20065 } LDKOnionMessenger;
20066
20067
20068
20069 /**
20070  * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
20071  */
20072 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
20073    /**
20074     * A pointer to the opaque Rust object.
20075     * Nearly everywhere, inner must be non-null, however in places where
20076     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20077     */
20078    LDKnativeDefaultMessageRouter *inner;
20079    /**
20080     * Indicates that this is the only struct which contains the same pointer.
20081     * Rust functions which take ownership of an object provided via an argument require
20082     * this to be true and invalidate the object pointed to by inner.
20083     */
20084    bool is_owned;
20085 } LDKDefaultMessageRouter;
20086
20087
20088
20089 /**
20090  * An intermediate node, its outbound channel, and relay parameters.
20091  */
20092 typedef struct MUST_USE_STRUCT LDKForwardNode {
20093    /**
20094     * A pointer to the opaque Rust object.
20095     * Nearly everywhere, inner must be non-null, however in places where
20096     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20097     */
20098    LDKnativeForwardNode *inner;
20099    /**
20100     * Indicates that this is the only struct which contains the same pointer.
20101     * Rust functions which take ownership of an object provided via an argument require
20102     * this to be true and invalidate the object pointed to by inner.
20103     */
20104    bool is_owned;
20105 } LDKForwardNode;
20106
20107
20108
20109 /**
20110  * Data to construct a [`BlindedHop`] for forwarding a payment.
20111  */
20112 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
20113    /**
20114     * A pointer to the opaque Rust object.
20115     * Nearly everywhere, inner must be non-null, however in places where
20116     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20117     */
20118    LDKnativeForwardTlvs *inner;
20119    /**
20120     * Indicates that this is the only struct which contains the same pointer.
20121     * Rust functions which take ownership of an object provided via an argument require
20122     * this to be true and invalidate the object pointed to by inner.
20123     */
20124    bool is_owned;
20125 } LDKForwardTlvs;
20126
20127 /**
20128  * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
20129  * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
20130  * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
20131  * which can provide a default implementation of this trait when used with [`Wallet`].
20132  */
20133 typedef struct LDKCoinSelectionSource {
20134    /**
20135     * An opaque pointer which is passed to your function implementations as an argument.
20136     * This has no meaning in the LDK, and can be NULL or any other value.
20137     */
20138    void *this_arg;
20139    /**
20140     * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
20141     * available to spend. Implementations are free to pick their coin selection algorithm of
20142     * choice, as long as the following requirements are met:
20143     *
20144     * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
20145     *    throughout coin selection, but must not be returned as part of the result.
20146     * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
20147     *    throughout coin selection. In some cases, like when funding an anchor transaction, this
20148     *    set is empty. Implementations should ensure they handle this correctly on their end,
20149     *    e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
20150     *    provided, in which case a zero-value empty OP_RETURN output can be used instead.
20151     * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
20152     *    inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
20153     *
20154     * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
20155     * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
20156     * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
20157     * delaying block inclusion.
20158     *
20159     * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
20160     * can be re-used within new fee-bumped iterations of the original claiming transaction,
20161     * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
20162     * transaction associated with it, and all of the available UTXOs have already been assigned to
20163     * other claims, implementations must be willing to double spend their UTXOs. The choice of
20164     * which UTXOs to double spend is left to the implementation, but it must strive to keep the
20165     * set of other claims being double spent to a minimum.
20166     */
20167    struct LDKCResult_CoinSelectionNoneZ (*select_confirmed_utxos)(const void *this_arg, struct LDKThirtyTwoBytes claim_id, struct LDKCVec_InputZ must_spend, struct LDKCVec_TxOutZ must_pay_to, uint32_t target_feerate_sat_per_1000_weight);
20168    /**
20169     * Signs and provides the full witness for all inputs within the transaction known to the
20170     * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
20171     */
20172    struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
20173    /**
20174     * Frees any resources associated with this object given its this_arg pointer.
20175     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20176     */
20177    void (*free)(void *this_arg);
20178 } LDKCoinSelectionSource;
20179
20180 /**
20181  * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
20182  * provide a default implementation to [`CoinSelectionSource`].
20183  */
20184 typedef struct LDKWalletSource {
20185    /**
20186     * An opaque pointer which is passed to your function implementations as an argument.
20187     * This has no meaning in the LDK, and can be NULL or any other value.
20188     */
20189    void *this_arg;
20190    /**
20191     * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
20192     */
20193    struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
20194    /**
20195     * Returns a script to use for change above dust resulting from a successful coin selection
20196     * attempt.
20197     */
20198    struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
20199    /**
20200     * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
20201     * the transaction known to the wallet (i.e., any provided via
20202     * [`WalletSource::list_confirmed_utxos`]).
20203     */
20204    struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
20205    /**
20206     * Frees any resources associated with this object given its this_arg pointer.
20207     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20208     */
20209    void (*free)(void *this_arg);
20210 } LDKWalletSource;
20211
20212
20213
20214 /**
20215  * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
20216  * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
20217  * spends may happen.
20218  */
20219 typedef struct MUST_USE_STRUCT LDKWallet {
20220    /**
20221     * A pointer to the opaque Rust object.
20222     * Nearly everywhere, inner must be non-null, however in places where
20223     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20224     */
20225    LDKnativeWallet *inner;
20226    /**
20227     * Indicates that this is the only struct which contains the same pointer.
20228     * Rust functions which take ownership of an object provided via an argument require
20229     * this to be true and invalidate the object pointed to by inner.
20230     */
20231    bool is_owned;
20232 } LDKWallet;
20233
20234
20235
20236 /**
20237  * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
20238  * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
20239  * Replace-By-Fee (RBF).
20240  *
20241  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
20242  */
20243 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
20244    /**
20245     * A pointer to the opaque Rust object.
20246     * Nearly everywhere, inner must be non-null, however in places where
20247     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20248     */
20249    LDKnativeBumpTransactionEventHandler *inner;
20250    /**
20251     * Indicates that this is the only struct which contains the same pointer.
20252     * Rust functions which take ownership of an object provided via an argument require
20253     * this to be true and invalidate the object pointed to by inner.
20254     */
20255    bool is_owned;
20256 } LDKBumpTransactionEventHandler;
20257
20258
20259
20260 /**
20261  * A [`KVStore`] implementation that writes to and reads from the file system.
20262  */
20263 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
20264    /**
20265     * A pointer to the opaque Rust object.
20266     * Nearly everywhere, inner must be non-null, however in places where
20267     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20268     */
20269    LDKnativeFilesystemStore *inner;
20270    /**
20271     * Indicates that this is the only struct which contains the same pointer.
20272     * Rust functions which take ownership of an object provided via an argument require
20273     * this to be true and invalidate the object pointed to by inner.
20274     */
20275    bool is_owned;
20276 } LDKFilesystemStore;
20277
20278
20279
20280 /**
20281  * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
20282  * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
20283  * responsibilities are:
20284  * * Processing [`Event`]s with a user-provided [`EventHandler`].
20285  * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
20286  *   writing it to disk/backups by invoking the callback given to it at startup.
20287  *   [`ChannelManager`] persistence should be done in the background.
20288  * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
20289  *   and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
20290  * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
20291  *   [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
20292  *
20293  * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
20294  * upon as doing so may result in high latency.
20295  *
20296  * # Note
20297  *
20298  * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
20299  * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
20300  * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
20301  * unilateral chain closure fees are at risk.
20302  *
20303  * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
20304  * [`Event`]: lightning::events::Event
20305  * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
20306  * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
20307  *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
20308  */
20309 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
20310    /**
20311     * A pointer to the opaque Rust object.
20312     * Nearly everywhere, inner must be non-null, however in places where
20313     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20314     */
20315    LDKnativeBackgroundProcessor *inner;
20316    /**
20317     * Indicates that this is the only struct which contains the same pointer.
20318     * Rust functions which take ownership of an object provided via an argument require
20319     * this to be true and invalidate the object pointed to by inner.
20320     */
20321    bool is_owned;
20322 } LDKBackgroundProcessor;
20323
20324
20325
20326 /**
20327  * The main Rapid Gossip Sync object.
20328  *
20329  * See [crate-level documentation] for usage.
20330  *
20331  * [crate-level documentation]: crate
20332  */
20333 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
20334    /**
20335     * A pointer to the opaque Rust object.
20336     * Nearly everywhere, inner must be non-null, however in places where
20337     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20338     */
20339    LDKnativeRapidGossipSync *inner;
20340    /**
20341     * Indicates that this is the only struct which contains the same pointer.
20342     * Rust functions which take ownership of an object provided via an argument require
20343     * this to be true and invalidate the object pointed to by inner.
20344     */
20345    bool is_owned;
20346 } LDKRapidGossipSync;
20347
20348 /**
20349  * Either [`P2PGossipSync`] or [`RapidGossipSync`].
20350  */
20351 typedef enum LDKGossipSync_Tag {
20352    /**
20353     * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
20354     */
20355    LDKGossipSync_P2P,
20356    /**
20357     * Rapid gossip sync from a trusted server.
20358     */
20359    LDKGossipSync_Rapid,
20360    /**
20361     * No gossip sync.
20362     */
20363    LDKGossipSync_None,
20364    /**
20365     * Must be last for serialization purposes
20366     */
20367    LDKGossipSync_Sentinel,
20368 } LDKGossipSync_Tag;
20369
20370 typedef struct MUST_USE_STRUCT LDKGossipSync {
20371    LDKGossipSync_Tag tag;
20372    union {
20373       struct {
20374          /**
20375           * Note that this field is expected to be a reference.
20376           */
20377          struct LDKP2PGossipSync p2p;
20378       };
20379       struct {
20380          /**
20381           * Note that this field is expected to be a reference.
20382           */
20383          struct LDKRapidGossipSync rapid;
20384       };
20385    };
20386 } LDKGossipSync;
20387
20388
20389
20390 /**
20391  * Data of the [`RawBolt11Invoice`] that is encoded in the data part
20392  */
20393 typedef struct MUST_USE_STRUCT LDKRawDataPart {
20394    /**
20395     * A pointer to the opaque Rust object.
20396     * Nearly everywhere, inner must be non-null, however in places where
20397     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20398     */
20399    LDKnativeRawDataPart *inner;
20400    /**
20401     * Indicates that this is the only struct which contains the same pointer.
20402     * Rust functions which take ownership of an object provided via an argument require
20403     * this to be true and invalidate the object pointed to by inner.
20404     */
20405    bool is_owned;
20406 } LDKRawDataPart;
20407
20408
20409
20410 /**
20411  * SHA-256 hash
20412  */
20413 typedef struct MUST_USE_STRUCT LDKSha256 {
20414    /**
20415     * A pointer to the opaque Rust object.
20416     * Nearly everywhere, inner must be non-null, however in places where
20417     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20418     */
20419    LDKnativeSha256 *inner;
20420    /**
20421     * Indicates that this is the only struct which contains the same pointer.
20422     * Rust functions which take ownership of an object provided via an argument require
20423     * this to be true and invalidate the object pointed to by inner.
20424     */
20425    bool is_owned;
20426 } LDKSha256;
20427
20428
20429
20430 /**
20431  * Positive duration that defines when (relatively to the timestamp) in the future the invoice
20432  * expires
20433  */
20434 typedef struct MUST_USE_STRUCT LDKExpiryTime {
20435    /**
20436     * A pointer to the opaque Rust object.
20437     * Nearly everywhere, inner must be non-null, however in places where
20438     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20439     */
20440    LDKnativeExpiryTime *inner;
20441    /**
20442     * Indicates that this is the only struct which contains the same pointer.
20443     * Rust functions which take ownership of an object provided via an argument require
20444     * this to be true and invalidate the object pointed to by inner.
20445     */
20446    bool is_owned;
20447 } LDKExpiryTime;
20448
20449
20450
20451 /**
20452  * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
20453  */
20454 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
20455    /**
20456     * A pointer to the opaque Rust object.
20457     * Nearly everywhere, inner must be non-null, however in places where
20458     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20459     */
20460    LDKnativeMinFinalCltvExpiryDelta *inner;
20461    /**
20462     * Indicates that this is the only struct which contains the same pointer.
20463     * Rust functions which take ownership of an object provided via an argument require
20464     * this to be true and invalidate the object pointed to by inner.
20465     */
20466    bool is_owned;
20467 } LDKMinFinalCltvExpiryDelta;
20468
20469 /**
20470  * A 20-byte byte array.
20471  */
20472 typedef struct LDKTwentyBytes {
20473    /**
20474     * The twenty bytes
20475     */
20476    uint8_t data[20];
20477 } LDKTwentyBytes;
20478
20479 /**
20480  * Fallback address in case no LN payment is possible
20481  */
20482 typedef enum LDKFallback_Tag {
20483    LDKFallback_SegWitProgram,
20484    LDKFallback_PubKeyHash,
20485    LDKFallback_ScriptHash,
20486    /**
20487     * Must be last for serialization purposes
20488     */
20489    LDKFallback_Sentinel,
20490 } LDKFallback_Tag;
20491
20492 typedef struct LDKFallback_LDKSegWitProgram_Body {
20493    struct LDKWitnessVersion version;
20494    struct LDKCVec_u8Z program;
20495 } LDKFallback_LDKSegWitProgram_Body;
20496
20497 typedef struct MUST_USE_STRUCT LDKFallback {
20498    LDKFallback_Tag tag;
20499    union {
20500       LDKFallback_LDKSegWitProgram_Body seg_wit_program;
20501       struct {
20502          struct LDKTwentyBytes pub_key_hash;
20503       };
20504       struct {
20505          struct LDKTwentyBytes script_hash;
20506       };
20507    };
20508 } LDKFallback;
20509
20510 extern const uintptr_t MAX_BUF_SIZE;
20511
20512 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
20513
20514 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
20515
20516 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
20517
20518 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
20519
20520 extern const uint32_t ANTI_REORG_DELAY;
20521
20522 extern const uint16_t BREAKDOWN_TIMEOUT;
20523
20524 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
20525
20526 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
20527
20528 extern const uint16_t MAX_HTLCS;
20529
20530 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
20531
20532 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
20533
20534 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
20535
20536 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
20537
20538 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
20539
20540 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
20541
20542 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
20543
20544 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
20545
20546 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
20547
20548 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
20549
20550 extern const uint64_t MAX_TIMESTAMP;
20551
20552 extern const uint64_t DEFAULT_EXPIRY_TIME;
20553
20554 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
20555
20556 extern const uint8_t TAG_PAYMENT_HASH;
20557
20558 extern const uint8_t TAG_DESCRIPTION;
20559
20560 extern const uint8_t TAG_PAYEE_PUB_KEY;
20561
20562 extern const uint8_t TAG_DESCRIPTION_HASH;
20563
20564 extern const uint8_t TAG_EXPIRY_TIME;
20565
20566 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
20567
20568 extern const uint8_t TAG_FALLBACK;
20569
20570 extern const uint8_t TAG_PRIVATE_ROUTE;
20571
20572 extern const uint8_t TAG_PAYMENT_SECRET;
20573
20574 extern const uint8_t TAG_PAYMENT_METADATA;
20575
20576 extern const uint8_t TAG_FEATURES;
20577
20578 struct LDKStr _ldk_get_compiled_version(void);
20579
20580 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
20581
20582 /**
20583  * Gets the 128-bit integer, as 16 little-endian bytes
20584  */
20585 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
20586
20587 /**
20588  * Constructs a new U128 from 16 little-endian bytes
20589  */
20590 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
20591
20592 /**
20593  * Convenience function for constructing a new BigEndianScalar
20594  */
20595 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
20596
20597 /**
20598  * Creates a new Bech32Error which has the same data as `orig`
20599  */
20600 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
20601
20602 /**
20603  * Releases any memory held by the given `Bech32Error` (which is currently none)
20604  */
20605 void Bech32Error_free(struct LDKBech32Error o);
20606
20607 /**
20608  * Frees the data buffer, if data_is_owned is set and datalen > 0.
20609  */
20610 void Transaction_free(struct LDKTransaction _res);
20611
20612 /**
20613  * Creates a new Witness which has the same data as `orig` but with a new buffer.
20614  */
20615 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
20616
20617 /**
20618  * Frees the data pointed to by data
20619  */
20620 void Witness_free(struct LDKWitness _res);
20621
20622 /**
20623  * Frees the witness and script_sig in a TxIn
20624  */
20625 void TxIn_free(struct LDKTxIn _res);
20626
20627 /**
20628  * Convenience function for constructing a new TxIn
20629  */
20630 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
20631
20632 /**
20633  * Convenience function for constructing a new TxOut
20634  */
20635 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
20636
20637 /**
20638  * Frees the data pointed to by script_pubkey.
20639  */
20640 void TxOut_free(struct LDKTxOut _res);
20641
20642 /**
20643  * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
20644  */
20645 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
20646
20647 /**
20648  * Frees the data buffer, if chars_is_owned is set and len > 0.
20649  */
20650 void Str_free(struct LDKStr _res);
20651
20652 #if defined(LDK_DEBUG_BUILD)
20653 /**
20654  * This function exists for memory safety testing purposes. It should never be used in production
20655  * code
20656  */
20657 const void *__unmangle_inner_ptr(const void *ptr);
20658 #endif
20659
20660 /**
20661  * Constructs a new COption_u64Z containing a u64
20662  */
20663 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
20664
20665 /**
20666  * Constructs a new COption_u64Z containing nothing
20667  */
20668 struct LDKCOption_u64Z COption_u64Z_none(void);
20669
20670 /**
20671  * Frees any resources associated with the u64, if we are in the Some state
20672  */
20673 void COption_u64Z_free(struct LDKCOption_u64Z _res);
20674
20675 /**
20676  * Creates a new COption_u64Z which has the same data as `orig`
20677  * but with all dynamically-allocated buffers duplicated in new buffers.
20678  */
20679 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
20680
20681 /**
20682  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20683  */
20684 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
20685
20686 /**
20687  * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
20688  */
20689 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
20690
20691 /**
20692  * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
20693  */
20694 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
20695
20696 /**
20697  * Checks if the given object is currently in the success state
20698  */
20699 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
20700
20701 /**
20702  * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
20703  */
20704 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
20705
20706 /**
20707  * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
20708  * but with all dynamically-allocated buffers duplicated in new buffers.
20709  */
20710 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
20711
20712 /**
20713  * Creates a new CResult_RetryDecodeErrorZ in the success state.
20714  */
20715 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
20716
20717 /**
20718  * Creates a new CResult_RetryDecodeErrorZ in the error state.
20719  */
20720 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
20721
20722 /**
20723  * Checks if the given object is currently in the success state
20724  */
20725 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
20726
20727 /**
20728  * Frees any resources used by the CResult_RetryDecodeErrorZ.
20729  */
20730 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
20731
20732 /**
20733  * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
20734  * but with all dynamically-allocated buffers duplicated in new buffers.
20735  */
20736 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
20737
20738 /**
20739  * Creates a new CResult_NoneAPIErrorZ in the success state.
20740  */
20741 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
20742
20743 /**
20744  * Creates a new CResult_NoneAPIErrorZ in the error state.
20745  */
20746 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
20747
20748 /**
20749  * Checks if the given object is currently in the success state
20750  */
20751 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
20752
20753 /**
20754  * Frees any resources used by the CResult_NoneAPIErrorZ.
20755  */
20756 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
20757
20758 /**
20759  * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
20760  * but with all dynamically-allocated buffers duplicated in new buffers.
20761  */
20762 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
20763
20764 /**
20765  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20766  */
20767 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
20768
20769 /**
20770  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20771  */
20772 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
20773
20774 /**
20775  * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
20776  */
20777 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
20778
20779 /**
20780  * Constructs a new COption_ThirtyTwoBytesZ containing nothing
20781  */
20782 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
20783
20784 /**
20785  * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
20786  */
20787 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
20788
20789 /**
20790  * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
20791  * but with all dynamically-allocated buffers duplicated in new buffers.
20792  */
20793 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
20794
20795 /**
20796  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20797  */
20798 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
20799
20800 /**
20801  * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
20802  */
20803 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
20804
20805 /**
20806  * Constructs a new COption_CVec_u8ZZ containing nothing
20807  */
20808 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
20809
20810 /**
20811  * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
20812  */
20813 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
20814
20815 /**
20816  * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
20817  * but with all dynamically-allocated buffers duplicated in new buffers.
20818  */
20819 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
20820
20821 /**
20822  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
20823  */
20824 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
20825
20826 /**
20827  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
20828  */
20829 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
20830
20831 /**
20832  * Checks if the given object is currently in the success state
20833  */
20834 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
20835
20836 /**
20837  * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
20838  */
20839 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
20840
20841 /**
20842  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
20843  * but with all dynamically-allocated buffers duplicated in new buffers.
20844  */
20845 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
20846
20847 /**
20848  * Creates a new tuple which has the same data as `orig`
20849  * but with all dynamically-allocated buffers duplicated in new buffers.
20850  */
20851 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
20852
20853 /**
20854  * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
20855  */
20856 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
20857
20858 /**
20859  * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
20860  */
20861 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
20862
20863 /**
20864  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20865  */
20866 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
20867
20868 /**
20869  * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
20870  */
20871 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
20872
20873 /**
20874  * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
20875  */
20876 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
20877
20878 /**
20879  * Checks if the given object is currently in the success state
20880  */
20881 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
20882
20883 /**
20884  * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
20885  */
20886 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
20887
20888 /**
20889  * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
20890  * but with all dynamically-allocated buffers duplicated in new buffers.
20891  */
20892 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
20893
20894 /**
20895  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20896  */
20897 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
20898
20899 /**
20900  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
20901  */
20902 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
20903
20904 /**
20905  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
20906  */
20907 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
20908
20909 /**
20910  * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
20911  */
20912 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
20913
20914 /**
20915  * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
20916  * but with all dynamically-allocated buffers duplicated in new buffers.
20917  */
20918 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
20919
20920 /**
20921  * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
20922  */
20923 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
20924
20925 /**
20926  * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
20927  */
20928 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
20929
20930 /**
20931  * Checks if the given object is currently in the success state
20932  */
20933 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
20934
20935 /**
20936  * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
20937  */
20938 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
20939
20940 /**
20941  * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
20942  * but with all dynamically-allocated buffers duplicated in new buffers.
20943  */
20944 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
20945
20946 /**
20947  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
20948  */
20949 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
20950
20951 /**
20952  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
20953  */
20954 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
20955
20956 /**
20957  * Checks if the given object is currently in the success state
20958  */
20959 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
20960
20961 /**
20962  * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
20963  */
20964 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
20965
20966 /**
20967  * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
20968  * but with all dynamically-allocated buffers duplicated in new buffers.
20969  */
20970 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
20971
20972 /**
20973  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
20974  */
20975 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
20976
20977 /**
20978  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
20979  */
20980 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
20981
20982 /**
20983  * Checks if the given object is currently in the success state
20984  */
20985 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
20986
20987 /**
20988  * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
20989  */
20990 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
20991
20992 /**
20993  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
20994  * but with all dynamically-allocated buffers duplicated in new buffers.
20995  */
20996 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
20997
20998 /**
20999  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
21000  */
21001 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
21002
21003 /**
21004  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
21005  */
21006 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
21007
21008 /**
21009  * Checks if the given object is currently in the success state
21010  */
21011 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
21012
21013 /**
21014  * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
21015  */
21016 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
21017
21018 /**
21019  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
21020  * but with all dynamically-allocated buffers duplicated in new buffers.
21021  */
21022 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
21023
21024 /**
21025  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
21026  */
21027 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
21028
21029 /**
21030  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
21031  */
21032 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
21033
21034 /**
21035  * Checks if the given object is currently in the success state
21036  */
21037 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
21038
21039 /**
21040  * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
21041  */
21042 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
21043
21044 /**
21045  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
21046  * but with all dynamically-allocated buffers duplicated in new buffers.
21047  */
21048 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
21049
21050 /**
21051  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21052  */
21053 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
21054
21055 /**
21056  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21057  */
21058 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
21059
21060 /**
21061  * Constructs a new COption_u32Z containing a u32
21062  */
21063 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
21064
21065 /**
21066  * Constructs a new COption_u32Z containing nothing
21067  */
21068 struct LDKCOption_u32Z COption_u32Z_none(void);
21069
21070 /**
21071  * Frees any resources associated with the u32, if we are in the Some state
21072  */
21073 void COption_u32Z_free(struct LDKCOption_u32Z _res);
21074
21075 /**
21076  * Creates a new COption_u32Z which has the same data as `orig`
21077  * but with all dynamically-allocated buffers duplicated in new buffers.
21078  */
21079 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
21080
21081 /**
21082  * Creates a new tuple which has the same data as `orig`
21083  * but with all dynamically-allocated buffers duplicated in new buffers.
21084  */
21085 struct LDKC2Tuple_CVec_u8ZusizeZ C2Tuple_CVec_u8ZusizeZ_clone(const struct LDKC2Tuple_CVec_u8ZusizeZ *NONNULL_PTR orig);
21086
21087 /**
21088  * Creates a new C2Tuple_CVec_u8ZusizeZ from the contained elements.
21089  */
21090 struct LDKC2Tuple_CVec_u8ZusizeZ C2Tuple_CVec_u8ZusizeZ_new(struct LDKCVec_u8Z a, uintptr_t b);
21091
21092 /**
21093  * Frees any resources used by the C2Tuple_CVec_u8ZusizeZ.
21094  */
21095 void C2Tuple_CVec_u8ZusizeZ_free(struct LDKC2Tuple_CVec_u8ZusizeZ _res);
21096
21097 /**
21098  * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ in the success state.
21099  */
21100 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_ok(struct LDKC2Tuple_CVec_u8ZusizeZ o);
21101
21102 /**
21103  * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ in the error state.
21104  */
21105 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_err(void);
21106
21107 /**
21108  * Checks if the given object is currently in the success state
21109  */
21110 bool CResult_C2Tuple_CVec_u8ZusizeZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR o);
21111
21112 /**
21113  * Frees any resources used by the CResult_C2Tuple_CVec_u8ZusizeZNoneZ.
21114  */
21115 void CResult_C2Tuple_CVec_u8ZusizeZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ _res);
21116
21117 /**
21118  * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ which has the same data as `orig`
21119  * but with all dynamically-allocated buffers duplicated in new buffers.
21120  */
21121 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR orig);
21122
21123 /**
21124  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
21125  */
21126 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
21127
21128 /**
21129  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
21130  */
21131 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
21132
21133 /**
21134  * Checks if the given object is currently in the success state
21135  */
21136 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
21137
21138 /**
21139  * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
21140  */
21141 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
21142
21143 /**
21144  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
21145  * but with all dynamically-allocated buffers duplicated in new buffers.
21146  */
21147 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
21148
21149 /**
21150  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
21151  */
21152 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
21153
21154 /**
21155  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
21156  */
21157 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
21158
21159 /**
21160  * Checks if the given object is currently in the success state
21161  */
21162 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
21163
21164 /**
21165  * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
21166  */
21167 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
21168
21169 /**
21170  * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
21171  * but with all dynamically-allocated buffers duplicated in new buffers.
21172  */
21173 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
21174
21175 /**
21176  * Creates a new CResult_NoneNoneZ in the success state.
21177  */
21178 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
21179
21180 /**
21181  * Creates a new CResult_NoneNoneZ in the error state.
21182  */
21183 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
21184
21185 /**
21186  * Checks if the given object is currently in the success state
21187  */
21188 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
21189
21190 /**
21191  * Frees any resources used by the CResult_NoneNoneZ.
21192  */
21193 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
21194
21195 /**
21196  * Creates a new CResult_NoneNoneZ which has the same data as `orig`
21197  * but with all dynamically-allocated buffers duplicated in new buffers.
21198  */
21199 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
21200
21201 /**
21202  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21203  */
21204 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
21205
21206 /**
21207  * Creates a new tuple which has the same data as `orig`
21208  * but with all dynamically-allocated buffers duplicated in new buffers.
21209  */
21210 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
21211
21212 /**
21213  * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
21214  */
21215 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
21216
21217 /**
21218  * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
21219  */
21220 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
21221
21222 /**
21223  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
21224  */
21225 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
21226
21227 /**
21228  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
21229  */
21230 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
21231
21232 /**
21233  * Checks if the given object is currently in the success state
21234  */
21235 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
21236
21237 /**
21238  * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
21239  */
21240 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
21241
21242 /**
21243  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
21244  * but with all dynamically-allocated buffers duplicated in new buffers.
21245  */
21246 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
21247
21248 /**
21249  * Creates a new CResult_ECDSASignatureNoneZ in the success state.
21250  */
21251 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
21252
21253 /**
21254  * Creates a new CResult_ECDSASignatureNoneZ in the error state.
21255  */
21256 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
21257
21258 /**
21259  * Checks if the given object is currently in the success state
21260  */
21261 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
21262
21263 /**
21264  * Frees any resources used by the CResult_ECDSASignatureNoneZ.
21265  */
21266 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
21267
21268 /**
21269  * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
21270  * but with all dynamically-allocated buffers duplicated in new buffers.
21271  */
21272 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
21273
21274 /**
21275  * Creates a new CResult_PublicKeyNoneZ in the success state.
21276  */
21277 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
21278
21279 /**
21280  * Creates a new CResult_PublicKeyNoneZ in the error state.
21281  */
21282 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
21283
21284 /**
21285  * Checks if the given object is currently in the success state
21286  */
21287 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
21288
21289 /**
21290  * Frees any resources used by the CResult_PublicKeyNoneZ.
21291  */
21292 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
21293
21294 /**
21295  * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
21296  * but with all dynamically-allocated buffers duplicated in new buffers.
21297  */
21298 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
21299
21300 /**
21301  * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
21302  */
21303 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
21304
21305 /**
21306  * Constructs a new COption_BigEndianScalarZ containing nothing
21307  */
21308 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
21309
21310 /**
21311  * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
21312  */
21313 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
21314
21315 /**
21316  * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
21317  * but with all dynamically-allocated buffers duplicated in new buffers.
21318  */
21319 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
21320
21321 /**
21322  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21323  */
21324 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
21325
21326 /**
21327  * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
21328  */
21329 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
21330
21331 /**
21332  * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
21333  */
21334 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
21335
21336 /**
21337  * Checks if the given object is currently in the success state
21338  */
21339 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
21340
21341 /**
21342  * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
21343  */
21344 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
21345
21346 /**
21347  * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
21348  * but with all dynamically-allocated buffers duplicated in new buffers.
21349  */
21350 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
21351
21352 /**
21353  * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
21354  */
21355 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
21356
21357 /**
21358  * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
21359  */
21360 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
21361
21362 /**
21363  * Checks if the given object is currently in the success state
21364  */
21365 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
21366
21367 /**
21368  * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
21369  */
21370 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
21371
21372 /**
21373  * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
21374  * but with all dynamically-allocated buffers duplicated in new buffers.
21375  */
21376 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
21377
21378 /**
21379  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
21380  */
21381 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
21382
21383 /**
21384  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
21385  */
21386 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
21387
21388 /**
21389  * Checks if the given object is currently in the success state
21390  */
21391 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
21392
21393 /**
21394  * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
21395  */
21396 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
21397
21398 /**
21399  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
21400  * but with all dynamically-allocated buffers duplicated in new buffers.
21401  */
21402 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
21403
21404 /**
21405  * Creates a new CResult_CVec_u8ZNoneZ in the success state.
21406  */
21407 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
21408
21409 /**
21410  * Creates a new CResult_CVec_u8ZNoneZ in the error state.
21411  */
21412 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
21413
21414 /**
21415  * Checks if the given object is currently in the success state
21416  */
21417 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
21418
21419 /**
21420  * Frees any resources used by the CResult_CVec_u8ZNoneZ.
21421  */
21422 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
21423
21424 /**
21425  * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
21426  * but with all dynamically-allocated buffers duplicated in new buffers.
21427  */
21428 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
21429
21430 /**
21431  * Creates a new CResult_ShutdownScriptNoneZ in the success state.
21432  */
21433 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
21434
21435 /**
21436  * Creates a new CResult_ShutdownScriptNoneZ in the error state.
21437  */
21438 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
21439
21440 /**
21441  * Checks if the given object is currently in the success state
21442  */
21443 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
21444
21445 /**
21446  * Frees any resources used by the CResult_ShutdownScriptNoneZ.
21447  */
21448 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
21449
21450 /**
21451  * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
21452  * but with all dynamically-allocated buffers duplicated in new buffers.
21453  */
21454 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
21455
21456 /**
21457  * Constructs a new COption_u16Z containing a u16
21458  */
21459 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
21460
21461 /**
21462  * Constructs a new COption_u16Z containing nothing
21463  */
21464 struct LDKCOption_u16Z COption_u16Z_none(void);
21465
21466 /**
21467  * Frees any resources associated with the u16, if we are in the Some state
21468  */
21469 void COption_u16Z_free(struct LDKCOption_u16Z _res);
21470
21471 /**
21472  * Creates a new COption_u16Z which has the same data as `orig`
21473  * but with all dynamically-allocated buffers duplicated in new buffers.
21474  */
21475 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
21476
21477 /**
21478  * Constructs a new COption_boolZ containing a bool
21479  */
21480 struct LDKCOption_boolZ COption_boolZ_some(bool o);
21481
21482 /**
21483  * Constructs a new COption_boolZ containing nothing
21484  */
21485 struct LDKCOption_boolZ COption_boolZ_none(void);
21486
21487 /**
21488  * Frees any resources associated with the bool, if we are in the Some state
21489  */
21490 void COption_boolZ_free(struct LDKCOption_boolZ _res);
21491
21492 /**
21493  * Creates a new COption_boolZ which has the same data as `orig`
21494  * but with all dynamically-allocated buffers duplicated in new buffers.
21495  */
21496 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
21497
21498 /**
21499  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21500  */
21501 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
21502
21503 /**
21504  * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
21505  */
21506 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
21507
21508 /**
21509  * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
21510  */
21511 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
21512
21513 /**
21514  * Checks if the given object is currently in the success state
21515  */
21516 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
21517
21518 /**
21519  * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
21520  */
21521 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
21522
21523 /**
21524  * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
21525  * but with all dynamically-allocated buffers duplicated in new buffers.
21526  */
21527 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
21528
21529 /**
21530  * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
21531  */
21532 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
21533
21534 /**
21535  * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
21536  */
21537 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
21538
21539 /**
21540  * Checks if the given object is currently in the success state
21541  */
21542 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
21543
21544 /**
21545  * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
21546  */
21547 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
21548
21549 /**
21550  * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
21551  * but with all dynamically-allocated buffers duplicated in new buffers.
21552  */
21553 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
21554
21555 /**
21556  * Creates a new CResult_TransactionNoneZ in the success state.
21557  */
21558 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
21559
21560 /**
21561  * Creates a new CResult_TransactionNoneZ in the error state.
21562  */
21563 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
21564
21565 /**
21566  * Checks if the given object is currently in the success state
21567  */
21568 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
21569
21570 /**
21571  * Frees any resources used by the CResult_TransactionNoneZ.
21572  */
21573 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
21574
21575 /**
21576  * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
21577  * but with all dynamically-allocated buffers duplicated in new buffers.
21578  */
21579 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
21580
21581 /**
21582  * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
21583  */
21584 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
21585
21586 /**
21587  * Constructs a new COption_WriteableScoreZ containing nothing
21588  */
21589 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
21590
21591 /**
21592  * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
21593  */
21594 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
21595
21596 /**
21597  * Creates a new CResult_NoneIOErrorZ in the success state.
21598  */
21599 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
21600
21601 /**
21602  * Creates a new CResult_NoneIOErrorZ in the error state.
21603  */
21604 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
21605
21606 /**
21607  * Checks if the given object is currently in the success state
21608  */
21609 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
21610
21611 /**
21612  * Frees any resources used by the CResult_NoneIOErrorZ.
21613  */
21614 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
21615
21616 /**
21617  * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
21618  * but with all dynamically-allocated buffers duplicated in new buffers.
21619  */
21620 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
21621
21622 /**
21623  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21624  */
21625 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
21626
21627 /**
21628  * Creates a new CResult_RouteLightningErrorZ in the success state.
21629  */
21630 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
21631
21632 /**
21633  * Creates a new CResult_RouteLightningErrorZ in the error state.
21634  */
21635 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
21636
21637 /**
21638  * Checks if the given object is currently in the success state
21639  */
21640 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
21641
21642 /**
21643  * Frees any resources used by the CResult_RouteLightningErrorZ.
21644  */
21645 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
21646
21647 /**
21648  * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
21649  * but with all dynamically-allocated buffers duplicated in new buffers.
21650  */
21651 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
21652
21653 /**
21654  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
21655  */
21656 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
21657
21658 /**
21659  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
21660  */
21661 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
21662
21663 /**
21664  * Checks if the given object is currently in the success state
21665  */
21666 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
21667
21668 /**
21669  * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
21670  */
21671 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
21672
21673 /**
21674  * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
21675  * but with all dynamically-allocated buffers duplicated in new buffers.
21676  */
21677 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
21678
21679 /**
21680  * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
21681  */
21682 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
21683
21684 /**
21685  * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
21686  */
21687 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
21688
21689 /**
21690  * Checks if the given object is currently in the success state
21691  */
21692 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
21693
21694 /**
21695  * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
21696  */
21697 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
21698
21699 /**
21700  * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
21701  * but with all dynamically-allocated buffers duplicated in new buffers.
21702  */
21703 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
21704
21705 /**
21706  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21707  */
21708 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
21709
21710 /**
21711  * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
21712  */
21713 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
21714
21715 /**
21716  * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
21717  */
21718 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
21719
21720 /**
21721  * Checks if the given object is currently in the success state
21722  */
21723 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
21724
21725 /**
21726  * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
21727  */
21728 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
21729
21730 /**
21731  * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
21732  * but with all dynamically-allocated buffers duplicated in new buffers.
21733  */
21734 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
21735
21736 /**
21737  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21738  */
21739 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
21740
21741 /**
21742  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21743  */
21744 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
21745
21746 /**
21747  * Creates a new CResult_RouteDecodeErrorZ in the success state.
21748  */
21749 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
21750
21751 /**
21752  * Creates a new CResult_RouteDecodeErrorZ in the error state.
21753  */
21754 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
21755
21756 /**
21757  * Checks if the given object is currently in the success state
21758  */
21759 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
21760
21761 /**
21762  * Frees any resources used by the CResult_RouteDecodeErrorZ.
21763  */
21764 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
21765
21766 /**
21767  * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
21768  * but with all dynamically-allocated buffers duplicated in new buffers.
21769  */
21770 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
21771
21772 /**
21773  * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
21774  */
21775 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
21776
21777 /**
21778  * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
21779  */
21780 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
21781
21782 /**
21783  * Checks if the given object is currently in the success state
21784  */
21785 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
21786
21787 /**
21788  * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
21789  */
21790 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
21791
21792 /**
21793  * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
21794  * but with all dynamically-allocated buffers duplicated in new buffers.
21795  */
21796 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
21797
21798 /**
21799  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21800  */
21801 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
21802
21803 /**
21804  * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
21805  */
21806 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
21807
21808 /**
21809  * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
21810  */
21811 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
21812
21813 /**
21814  * Checks if the given object is currently in the success state
21815  */
21816 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
21817
21818 /**
21819  * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
21820  */
21821 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
21822
21823 /**
21824  * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
21825  * but with all dynamically-allocated buffers duplicated in new buffers.
21826  */
21827 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
21828
21829 /**
21830  * Creates a new tuple which has the same data as `orig`
21831  * but with all dynamically-allocated buffers duplicated in new buffers.
21832  */
21833 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
21834
21835 /**
21836  * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
21837  */
21838 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
21839
21840 /**
21841  * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
21842  */
21843 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
21844
21845 /**
21846  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21847  */
21848 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
21849
21850 /**
21851  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21852  */
21853 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
21854
21855 /**
21856  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21857  */
21858 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
21859
21860 /**
21861  * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
21862  */
21863 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
21864
21865 /**
21866  * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
21867  */
21868 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
21869
21870 /**
21871  * Checks if the given object is currently in the success state
21872  */
21873 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
21874
21875 /**
21876  * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
21877  */
21878 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
21879
21880 /**
21881  * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
21882  * but with all dynamically-allocated buffers duplicated in new buffers.
21883  */
21884 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
21885
21886 /**
21887  * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
21888  */
21889 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
21890
21891 /**
21892  * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
21893  */
21894 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
21895
21896 /**
21897  * Checks if the given object is currently in the success state
21898  */
21899 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
21900
21901 /**
21902  * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
21903  */
21904 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
21905
21906 /**
21907  * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
21908  * but with all dynamically-allocated buffers duplicated in new buffers.
21909  */
21910 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
21911
21912 /**
21913  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21914  */
21915 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
21916
21917 /**
21918  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
21919  */
21920 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
21921
21922 /**
21923  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
21924  */
21925 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
21926
21927 /**
21928  * Checks if the given object is currently in the success state
21929  */
21930 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
21931
21932 /**
21933  * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
21934  */
21935 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
21936
21937 /**
21938  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
21939  * but with all dynamically-allocated buffers duplicated in new buffers.
21940  */
21941 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
21942
21943 /**
21944  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21945  */
21946 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
21947
21948 /**
21949  * Creates a new tuple which has the same data as `orig`
21950  * but with all dynamically-allocated buffers duplicated in new buffers.
21951  */
21952 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
21953
21954 /**
21955  * Creates a new C2Tuple_u64u64Z from the contained elements.
21956  */
21957 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
21958
21959 /**
21960  * Frees any resources used by the C2Tuple_u64u64Z.
21961  */
21962 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
21963
21964 /**
21965  * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
21966  */
21967 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
21968
21969 /**
21970  * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
21971  */
21972 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
21973
21974 /**
21975  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
21976  */
21977 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
21978
21979 /**
21980  * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
21981  * but with all dynamically-allocated buffers duplicated in new buffers.
21982  */
21983 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
21984
21985 /**
21986  * Creates a new C2Tuple_Z from the contained elements.
21987  */
21988 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
21989
21990 /**
21991  * Frees any resources used by the C2Tuple_Z.
21992  */
21993 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
21994
21995 /**
21996  * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
21997  */
21998 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
21999
22000 /**
22001  * Frees any resources used by the C2Tuple__u1632_u1632Z.
22002  */
22003 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
22004
22005 /**
22006  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
22007  */
22008 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
22009
22010 /**
22011  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
22012  */
22013 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
22014
22015 /**
22016  * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
22017  */
22018 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
22019
22020 /**
22021  * Constructs a new COption_f64Z containing a f64
22022  */
22023 struct LDKCOption_f64Z COption_f64Z_some(double o);
22024
22025 /**
22026  * Constructs a new COption_f64Z containing nothing
22027  */
22028 struct LDKCOption_f64Z COption_f64Z_none(void);
22029
22030 /**
22031  * Frees any resources associated with the f64, if we are in the Some state
22032  */
22033 void COption_f64Z_free(struct LDKCOption_f64Z _res);
22034
22035 /**
22036  * Creates a new COption_f64Z which has the same data as `orig`
22037  * but with all dynamically-allocated buffers duplicated in new buffers.
22038  */
22039 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
22040
22041 /**
22042  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
22043  */
22044 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
22045
22046 /**
22047  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
22048  */
22049 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
22050
22051 /**
22052  * Checks if the given object is currently in the success state
22053  */
22054 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
22055
22056 /**
22057  * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
22058  */
22059 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
22060
22061 /**
22062  * Creates a new tuple which has the same data as `orig`
22063  * but with all dynamically-allocated buffers duplicated in new buffers.
22064  */
22065 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
22066
22067 /**
22068  * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
22069  */
22070 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
22071
22072 /**
22073  * Frees any resources used by the C2Tuple_usizeTransactionZ.
22074  */
22075 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
22076
22077 /**
22078  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22079  */
22080 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
22081
22082 /**
22083  * Creates a new tuple which has the same data as `orig`
22084  * but with all dynamically-allocated buffers duplicated in new buffers.
22085  */
22086 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
22087
22088 /**
22089  * Creates a new C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ from the contained elements.
22090  */
22091 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, struct LDKCOption_ThirtyTwoBytesZ b);
22092
22093 /**
22094  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ.
22095  */
22096 void C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ _res);
22097
22098 /**
22099  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22100  */
22101 void CVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ _res);
22102
22103 /**
22104  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
22105  */
22106 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
22107
22108 /**
22109  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
22110  */
22111 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
22112
22113 /**
22114  * Checks if the given object is currently in the success state
22115  */
22116 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
22117
22118 /**
22119  * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
22120  */
22121 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
22122
22123 /**
22124  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
22125  * but with all dynamically-allocated buffers duplicated in new buffers.
22126  */
22127 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
22128
22129 /**
22130  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22131  */
22132 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
22133
22134 /**
22135  * Creates a new tuple which has the same data as `orig`
22136  * but with all dynamically-allocated buffers duplicated in new buffers.
22137  */
22138 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
22139
22140 /**
22141  * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
22142  */
22143 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
22144
22145 /**
22146  * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
22147  */
22148 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
22149
22150 /**
22151  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22152  */
22153 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
22154
22155 /**
22156  * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
22157  */
22158 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
22159
22160 /**
22161  * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
22162  */
22163 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22164
22165 /**
22166  * Checks if the given object is currently in the success state
22167  */
22168 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
22169
22170 /**
22171  * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
22172  */
22173 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
22174
22175 /**
22176  * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
22177  * but with all dynamically-allocated buffers duplicated in new buffers.
22178  */
22179 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
22180
22181 /**
22182  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
22183  */
22184 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
22185
22186 /**
22187  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
22188  */
22189 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22190
22191 /**
22192  * Checks if the given object is currently in the success state
22193  */
22194 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
22195
22196 /**
22197  * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
22198  */
22199 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
22200
22201 /**
22202  * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
22203  * but with all dynamically-allocated buffers duplicated in new buffers.
22204  */
22205 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
22206
22207 /**
22208  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
22209  */
22210 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
22211
22212 /**
22213  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
22214  */
22215 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22216
22217 /**
22218  * Checks if the given object is currently in the success state
22219  */
22220 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
22221
22222 /**
22223  * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
22224  */
22225 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
22226
22227 /**
22228  * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
22229  * but with all dynamically-allocated buffers duplicated in new buffers.
22230  */
22231 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
22232
22233 /**
22234  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
22235  */
22236 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
22237
22238 /**
22239  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
22240  */
22241 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22242
22243 /**
22244  * Checks if the given object is currently in the success state
22245  */
22246 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
22247
22248 /**
22249  * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
22250  */
22251 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
22252
22253 /**
22254  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
22255  * but with all dynamically-allocated buffers duplicated in new buffers.
22256  */
22257 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
22258
22259 /**
22260  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
22261  */
22262 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
22263
22264 /**
22265  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
22266  */
22267 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22268
22269 /**
22270  * Checks if the given object is currently in the success state
22271  */
22272 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
22273
22274 /**
22275  * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
22276  */
22277 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
22278
22279 /**
22280  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
22281  * but with all dynamically-allocated buffers duplicated in new buffers.
22282  */
22283 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
22284
22285 /**
22286  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
22287  */
22288 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
22289
22290 /**
22291  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
22292  */
22293 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22294
22295 /**
22296  * Checks if the given object is currently in the success state
22297  */
22298 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
22299
22300 /**
22301  * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
22302  */
22303 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
22304
22305 /**
22306  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
22307  * but with all dynamically-allocated buffers duplicated in new buffers.
22308  */
22309 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
22310
22311 /**
22312  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
22313  */
22314 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
22315
22316 /**
22317  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
22318  */
22319 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22320
22321 /**
22322  * Checks if the given object is currently in the success state
22323  */
22324 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
22325
22326 /**
22327  * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
22328  */
22329 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
22330
22331 /**
22332  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
22333  * but with all dynamically-allocated buffers duplicated in new buffers.
22334  */
22335 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
22336
22337 /**
22338  * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
22339  */
22340 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
22341
22342 /**
22343  * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
22344  */
22345 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
22346
22347 /**
22348  * Checks if the given object is currently in the success state
22349  */
22350 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
22351
22352 /**
22353  * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
22354  */
22355 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
22356
22357 /**
22358  * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
22359  * but with all dynamically-allocated buffers duplicated in new buffers.
22360  */
22361 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
22362
22363 /**
22364  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
22365  */
22366 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
22367
22368 /**
22369  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
22370  */
22371 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
22372
22373 /**
22374  * Checks if the given object is currently in the success state
22375  */
22376 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
22377
22378 /**
22379  * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
22380  */
22381 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
22382
22383 /**
22384  * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
22385  * but with all dynamically-allocated buffers duplicated in new buffers.
22386  */
22387 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
22388
22389 /**
22390  * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
22391  */
22392 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
22393
22394 /**
22395  * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
22396  */
22397 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
22398
22399 /**
22400  * Checks if the given object is currently in the success state
22401  */
22402 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
22403
22404 /**
22405  * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
22406  */
22407 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
22408
22409 /**
22410  * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
22411  * but with all dynamically-allocated buffers duplicated in new buffers.
22412  */
22413 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
22414
22415 /**
22416  * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
22417  */
22418 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
22419
22420 /**
22421  * Constructs a new COption_NetworkUpdateZ containing nothing
22422  */
22423 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
22424
22425 /**
22426  * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
22427  */
22428 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
22429
22430 /**
22431  * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
22432  * but with all dynamically-allocated buffers duplicated in new buffers.
22433  */
22434 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
22435
22436 /**
22437  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
22438  */
22439 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
22440
22441 /**
22442  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
22443  */
22444 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
22445
22446 /**
22447  * Checks if the given object is currently in the success state
22448  */
22449 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
22450
22451 /**
22452  * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
22453  */
22454 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
22455
22456 /**
22457  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
22458  * but with all dynamically-allocated buffers duplicated in new buffers.
22459  */
22460 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
22461
22462 /**
22463  * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
22464  */
22465 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
22466
22467 /**
22468  * Constructs a new COption_UtxoLookupZ containing nothing
22469  */
22470 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
22471
22472 /**
22473  * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
22474  */
22475 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
22476
22477 /**
22478  * Creates a new CResult_NoneLightningErrorZ in the success state.
22479  */
22480 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
22481
22482 /**
22483  * Creates a new CResult_NoneLightningErrorZ in the error state.
22484  */
22485 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
22486
22487 /**
22488  * Checks if the given object is currently in the success state
22489  */
22490 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
22491
22492 /**
22493  * Frees any resources used by the CResult_NoneLightningErrorZ.
22494  */
22495 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
22496
22497 /**
22498  * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
22499  * but with all dynamically-allocated buffers duplicated in new buffers.
22500  */
22501 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
22502
22503 /**
22504  * Creates a new CResult_boolLightningErrorZ in the success state.
22505  */
22506 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
22507
22508 /**
22509  * Creates a new CResult_boolLightningErrorZ in the error state.
22510  */
22511 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
22512
22513 /**
22514  * Checks if the given object is currently in the success state
22515  */
22516 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
22517
22518 /**
22519  * Frees any resources used by the CResult_boolLightningErrorZ.
22520  */
22521 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
22522
22523 /**
22524  * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
22525  * but with all dynamically-allocated buffers duplicated in new buffers.
22526  */
22527 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
22528
22529 /**
22530  * Creates a new tuple which has the same data as `orig`
22531  * but with all dynamically-allocated buffers duplicated in new buffers.
22532  */
22533 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
22534
22535 /**
22536  * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
22537  */
22538 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
22539
22540 /**
22541  * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
22542  */
22543 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
22544
22545 /**
22546  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
22547  */
22548 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
22549
22550 /**
22551  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
22552  */
22553 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
22554
22555 /**
22556  * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
22557  */
22558 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
22559
22560 /**
22561  * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
22562  * but with all dynamically-allocated buffers duplicated in new buffers.
22563  */
22564 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
22565
22566 /**
22567  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22568  */
22569 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
22570
22571 /**
22572  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
22573  */
22574 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
22575
22576 /**
22577  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
22578  */
22579 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
22580
22581 /**
22582  * Checks if the given object is currently in the success state
22583  */
22584 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
22585
22586 /**
22587  * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
22588  */
22589 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
22590
22591 /**
22592  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
22593  * but with all dynamically-allocated buffers duplicated in new buffers.
22594  */
22595 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
22596
22597 /**
22598  * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
22599  */
22600 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
22601
22602 /**
22603  * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
22604  */
22605 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
22606
22607 /**
22608  * Checks if the given object is currently in the success state
22609  */
22610 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
22611
22612 /**
22613  * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
22614  */
22615 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
22616
22617 /**
22618  * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
22619  * but with all dynamically-allocated buffers duplicated in new buffers.
22620  */
22621 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
22622
22623 /**
22624  * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
22625  */
22626 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
22627
22628 /**
22629  * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
22630  */
22631 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
22632
22633 /**
22634  * Checks if the given object is currently in the success state
22635  */
22636 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
22637
22638 /**
22639  * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
22640  */
22641 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
22642
22643 /**
22644  * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
22645  * but with all dynamically-allocated buffers duplicated in new buffers.
22646  */
22647 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
22648
22649 /**
22650  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22651  */
22652 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
22653
22654 /**
22655  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
22656  */
22657 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
22658
22659 /**
22660  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
22661  */
22662 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
22663
22664 /**
22665  * Checks if the given object is currently in the success state
22666  */
22667 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
22668
22669 /**
22670  * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
22671  */
22672 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
22673
22674 /**
22675  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
22676  * but with all dynamically-allocated buffers duplicated in new buffers.
22677  */
22678 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
22679
22680 /**
22681  * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
22682  */
22683 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
22684
22685 /**
22686  * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
22687  */
22688 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
22689
22690 /**
22691  * Checks if the given object is currently in the success state
22692  */
22693 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
22694
22695 /**
22696  * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
22697  */
22698 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
22699
22700 /**
22701  * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
22702  * but with all dynamically-allocated buffers duplicated in new buffers.
22703  */
22704 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
22705
22706 /**
22707  * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
22708  */
22709 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
22710
22711 /**
22712  * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
22713  */
22714 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
22715
22716 /**
22717  * Checks if the given object is currently in the success state
22718  */
22719 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
22720
22721 /**
22722  * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
22723  */
22724 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
22725
22726 /**
22727  * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
22728  * but with all dynamically-allocated buffers duplicated in new buffers.
22729  */
22730 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
22731
22732 /**
22733  * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
22734  */
22735 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
22736
22737 /**
22738  * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
22739  */
22740 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
22741
22742 /**
22743  * Checks if the given object is currently in the success state
22744  */
22745 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
22746
22747 /**
22748  * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
22749  */
22750 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
22751
22752 /**
22753  * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
22754  */
22755 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
22756
22757 /**
22758  * Constructs a new COption_CVec_SocketAddressZZ containing nothing
22759  */
22760 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
22761
22762 /**
22763  * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
22764  */
22765 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
22766
22767 /**
22768  * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
22769  * but with all dynamically-allocated buffers duplicated in new buffers.
22770  */
22771 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
22772
22773 /**
22774  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22775  */
22776 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
22777
22778 /**
22779  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22780  */
22781 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
22782
22783 /**
22784  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22785  */
22786 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
22787
22788 /**
22789  * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
22790  */
22791 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
22792
22793 /**
22794  * Constructs a new COption_TxOutZ containing nothing
22795  */
22796 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
22797
22798 /**
22799  * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
22800  */
22801 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
22802
22803 /**
22804  * Creates a new COption_TxOutZ which has the same data as `orig`
22805  * but with all dynamically-allocated buffers duplicated in new buffers.
22806  */
22807 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
22808
22809 /**
22810  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22811  */
22812 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
22813
22814 /**
22815  * Creates a new CResult_CoinSelectionNoneZ in the success state.
22816  */
22817 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
22818
22819 /**
22820  * Creates a new CResult_CoinSelectionNoneZ in the error state.
22821  */
22822 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
22823
22824 /**
22825  * Checks if the given object is currently in the success state
22826  */
22827 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
22828
22829 /**
22830  * Frees any resources used by the CResult_CoinSelectionNoneZ.
22831  */
22832 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
22833
22834 /**
22835  * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
22836  * but with all dynamically-allocated buffers duplicated in new buffers.
22837  */
22838 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
22839
22840 /**
22841  * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
22842  */
22843 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
22844
22845 /**
22846  * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
22847  */
22848 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
22849
22850 /**
22851  * Checks if the given object is currently in the success state
22852  */
22853 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
22854
22855 /**
22856  * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
22857  */
22858 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
22859
22860 /**
22861  * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
22862  * but with all dynamically-allocated buffers duplicated in new buffers.
22863  */
22864 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
22865
22866 /**
22867  * Creates a new tuple which has the same data as `orig`
22868  * but with all dynamically-allocated buffers duplicated in new buffers.
22869  */
22870 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
22871
22872 /**
22873  * Creates a new C2Tuple_u64u16Z from the contained elements.
22874  */
22875 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
22876
22877 /**
22878  * Frees any resources used by the C2Tuple_u64u16Z.
22879  */
22880 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
22881
22882 /**
22883  * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
22884  */
22885 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
22886
22887 /**
22888  * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
22889  */
22890 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
22891
22892 /**
22893  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
22894  */
22895 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
22896
22897 /**
22898  * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
22899  * but with all dynamically-allocated buffers duplicated in new buffers.
22900  */
22901 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
22902
22903 /**
22904  * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
22905  */
22906 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
22907
22908 /**
22909  * Constructs a new COption_ChannelShutdownStateZ containing nothing
22910  */
22911 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
22912
22913 /**
22914  * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
22915  */
22916 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
22917
22918 /**
22919  * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
22920  * but with all dynamically-allocated buffers duplicated in new buffers.
22921  */
22922 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
22923
22924 /**
22925  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
22926  */
22927 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
22928
22929 /**
22930  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
22931  */
22932 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
22933
22934 /**
22935  * Checks if the given object is currently in the success state
22936  */
22937 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
22938
22939 /**
22940  * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
22941  */
22942 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
22943
22944 /**
22945  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
22946  * but with all dynamically-allocated buffers duplicated in new buffers.
22947  */
22948 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
22949
22950 /**
22951  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22952  */
22953 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
22954
22955 /**
22956  * Creates a new CResult_NonePaymentSendFailureZ in the success state.
22957  */
22958 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
22959
22960 /**
22961  * Creates a new CResult_NonePaymentSendFailureZ in the error state.
22962  */
22963 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
22964
22965 /**
22966  * Checks if the given object is currently in the success state
22967  */
22968 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
22969
22970 /**
22971  * Frees any resources used by the CResult_NonePaymentSendFailureZ.
22972  */
22973 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
22974
22975 /**
22976  * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
22977  * but with all dynamically-allocated buffers duplicated in new buffers.
22978  */
22979 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
22980
22981 /**
22982  * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
22983  */
22984 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
22985
22986 /**
22987  * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
22988  */
22989 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
22990
22991 /**
22992  * Checks if the given object is currently in the success state
22993  */
22994 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
22995
22996 /**
22997  * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
22998  */
22999 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
23000
23001 /**
23002  * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
23003  * but with all dynamically-allocated buffers duplicated in new buffers.
23004  */
23005 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
23006
23007 /**
23008  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
23009  */
23010 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
23011
23012 /**
23013  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
23014  */
23015 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
23016
23017 /**
23018  * Checks if the given object is currently in the success state
23019  */
23020 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
23021
23022 /**
23023  * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
23024  */
23025 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
23026
23027 /**
23028  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
23029  * but with all dynamically-allocated buffers duplicated in new buffers.
23030  */
23031 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
23032
23033 /**
23034  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
23035  */
23036 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
23037
23038 /**
23039  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
23040  */
23041 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
23042
23043 /**
23044  * Checks if the given object is currently in the success state
23045  */
23046 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
23047
23048 /**
23049  * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
23050  */
23051 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
23052
23053 /**
23054  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
23055  * but with all dynamically-allocated buffers duplicated in new buffers.
23056  */
23057 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
23058
23059 /**
23060  * Creates a new tuple which has the same data as `orig`
23061  * but with all dynamically-allocated buffers duplicated in new buffers.
23062  */
23063 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
23064
23065 /**
23066  * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
23067  */
23068 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
23069
23070 /**
23071  * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
23072  */
23073 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
23074
23075 /**
23076  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
23077  */
23078 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
23079
23080 /**
23081  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
23082  */
23083 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
23084
23085 /**
23086  * Checks if the given object is currently in the success state
23087  */
23088 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
23089
23090 /**
23091  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
23092  */
23093 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
23094
23095 /**
23096  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
23097  * but with all dynamically-allocated buffers duplicated in new buffers.
23098  */
23099 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
23100
23101 /**
23102  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23103  */
23104 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
23105
23106 /**
23107  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
23108  */
23109 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
23110
23111 /**
23112  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
23113  */
23114 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
23115
23116 /**
23117  * Checks if the given object is currently in the success state
23118  */
23119 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
23120
23121 /**
23122  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
23123  */
23124 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
23125
23126 /**
23127  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
23128  * but with all dynamically-allocated buffers duplicated in new buffers.
23129  */
23130 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
23131
23132 /**
23133  * Creates a new tuple which has the same data as `orig`
23134  * but with all dynamically-allocated buffers duplicated in new buffers.
23135  */
23136 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR orig);
23137
23138 /**
23139  * Creates a new C2Tuple_ThirtyTwoBytesPublicKeyZ from the contained elements.
23140  */
23141 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_new(struct LDKThirtyTwoBytes a, struct LDKPublicKey b);
23142
23143 /**
23144  * Frees any resources used by the C2Tuple_ThirtyTwoBytesPublicKeyZ.
23145  */
23146 void C2Tuple_ThirtyTwoBytesPublicKeyZ_free(struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res);
23147
23148 /**
23149  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23150  */
23151 void CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res);
23152
23153 /**
23154  * Constructs a new COption_StrZ containing a crate::c_types::Str
23155  */
23156 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
23157
23158 /**
23159  * Constructs a new COption_StrZ containing nothing
23160  */
23161 struct LDKCOption_StrZ COption_StrZ_none(void);
23162
23163 /**
23164  * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
23165  */
23166 void COption_StrZ_free(struct LDKCOption_StrZ _res);
23167
23168 /**
23169  * Creates a new COption_StrZ which has the same data as `orig`
23170  * but with all dynamically-allocated buffers duplicated in new buffers.
23171  */
23172 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
23173
23174 /**
23175  * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
23176  */
23177 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
23178
23179 /**
23180  * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
23181  */
23182 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
23183
23184 /**
23185  * Checks if the given object is currently in the success state
23186  */
23187 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
23188
23189 /**
23190  * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
23191  */
23192 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
23193
23194 /**
23195  * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
23196  * but with all dynamically-allocated buffers duplicated in new buffers.
23197  */
23198 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
23199
23200 /**
23201  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
23202  */
23203 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
23204
23205 /**
23206  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
23207  */
23208 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
23209
23210 /**
23211  * Checks if the given object is currently in the success state
23212  */
23213 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
23214
23215 /**
23216  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
23217  */
23218 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
23219
23220 /**
23221  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
23222  * but with all dynamically-allocated buffers duplicated in new buffers.
23223  */
23224 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
23225
23226 /**
23227  * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
23228  */
23229 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
23230
23231 /**
23232  * Constructs a new COption_OffersMessageZ containing nothing
23233  */
23234 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
23235
23236 /**
23237  * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
23238  */
23239 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
23240
23241 /**
23242  * Creates a new COption_OffersMessageZ which has the same data as `orig`
23243  * but with all dynamically-allocated buffers duplicated in new buffers.
23244  */
23245 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
23246
23247 /**
23248  * Creates a new tuple which has the same data as `orig`
23249  * but with all dynamically-allocated buffers duplicated in new buffers.
23250  */
23251 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
23252
23253 /**
23254  * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
23255  */
23256 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
23257
23258 /**
23259  * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
23260  */
23261 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
23262
23263 /**
23264  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23265  */
23266 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
23267
23268 /**
23269  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
23270  */
23271 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
23272
23273 /**
23274  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
23275  */
23276 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
23277
23278 /**
23279  * Checks if the given object is currently in the success state
23280  */
23281 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
23282
23283 /**
23284  * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
23285  */
23286 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
23287
23288 /**
23289  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
23290  * but with all dynamically-allocated buffers duplicated in new buffers.
23291  */
23292 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
23293
23294 /**
23295  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
23296  */
23297 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
23298
23299 /**
23300  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
23301  */
23302 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
23303
23304 /**
23305  * Checks if the given object is currently in the success state
23306  */
23307 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
23308
23309 /**
23310  * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
23311  */
23312 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
23313
23314 /**
23315  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
23316  * but with all dynamically-allocated buffers duplicated in new buffers.
23317  */
23318 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
23319
23320 /**
23321  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
23322  */
23323 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
23324
23325 /**
23326  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
23327  */
23328 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
23329
23330 /**
23331  * Checks if the given object is currently in the success state
23332  */
23333 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
23334
23335 /**
23336  * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
23337  */
23338 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
23339
23340 /**
23341  * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
23342  * but with all dynamically-allocated buffers duplicated in new buffers.
23343  */
23344 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
23345
23346 /**
23347  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
23348  */
23349 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
23350
23351 /**
23352  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
23353  */
23354 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
23355
23356 /**
23357  * Checks if the given object is currently in the success state
23358  */
23359 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
23360
23361 /**
23362  * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
23363  */
23364 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
23365
23366 /**
23367  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
23368  * but with all dynamically-allocated buffers duplicated in new buffers.
23369  */
23370 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
23371
23372 /**
23373  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
23374  */
23375 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
23376
23377 /**
23378  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
23379  */
23380 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
23381
23382 /**
23383  * Checks if the given object is currently in the success state
23384  */
23385 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
23386
23387 /**
23388  * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
23389  */
23390 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
23391
23392 /**
23393  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
23394  * but with all dynamically-allocated buffers duplicated in new buffers.
23395  */
23396 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
23397
23398 /**
23399  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23400  */
23401 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
23402
23403 /**
23404  * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
23405  */
23406 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
23407
23408 /**
23409  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
23410  */
23411 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
23412
23413 /**
23414  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
23415  */
23416 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
23417
23418 /**
23419  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
23420  */
23421 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
23422
23423 /**
23424  * Checks if the given object is currently in the success state
23425  */
23426 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
23427
23428 /**
23429  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
23430  */
23431 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
23432
23433 /**
23434  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
23435  */
23436 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
23437
23438 /**
23439  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
23440  */
23441 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
23442
23443 /**
23444  * Checks if the given object is currently in the success state
23445  */
23446 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
23447
23448 /**
23449  * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
23450  */
23451 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
23452
23453 /**
23454  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
23455  * but with all dynamically-allocated buffers duplicated in new buffers.
23456  */
23457 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
23458
23459 /**
23460  * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
23461  */
23462 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
23463
23464 /**
23465  * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
23466  */
23467 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
23468
23469 /**
23470  * Checks if the given object is currently in the success state
23471  */
23472 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
23473
23474 /**
23475  * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
23476  */
23477 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
23478
23479 /**
23480  * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
23481  * but with all dynamically-allocated buffers duplicated in new buffers.
23482  */
23483 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
23484
23485 /**
23486  * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
23487  */
23488 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
23489
23490 /**
23491  * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
23492  */
23493 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
23494
23495 /**
23496  * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
23497  */
23498 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
23499
23500 /**
23501  * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
23502  * but with all dynamically-allocated buffers duplicated in new buffers.
23503  */
23504 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
23505
23506 /**
23507  * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
23508  */
23509 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
23510
23511 /**
23512  * Constructs a new COption_APIErrorZ containing nothing
23513  */
23514 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
23515
23516 /**
23517  * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
23518  */
23519 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
23520
23521 /**
23522  * Creates a new COption_APIErrorZ which has the same data as `orig`
23523  * but with all dynamically-allocated buffers duplicated in new buffers.
23524  */
23525 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
23526
23527 /**
23528  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
23529  */
23530 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
23531
23532 /**
23533  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
23534  */
23535 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
23536
23537 /**
23538  * Checks if the given object is currently in the success state
23539  */
23540 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
23541
23542 /**
23543  * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
23544  */
23545 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
23546
23547 /**
23548  * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
23549  * but with all dynamically-allocated buffers duplicated in new buffers.
23550  */
23551 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
23552
23553 /**
23554  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
23555  */
23556 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
23557
23558 /**
23559  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
23560  */
23561 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23562
23563 /**
23564  * Checks if the given object is currently in the success state
23565  */
23566 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
23567
23568 /**
23569  * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
23570  */
23571 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
23572
23573 /**
23574  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
23575  * but with all dynamically-allocated buffers duplicated in new buffers.
23576  */
23577 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
23578
23579 /**
23580  * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
23581  */
23582 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
23583
23584 /**
23585  * Constructs a new COption_MonitorEventZ containing nothing
23586  */
23587 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
23588
23589 /**
23590  * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
23591  */
23592 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
23593
23594 /**
23595  * Creates a new COption_MonitorEventZ which has the same data as `orig`
23596  * but with all dynamically-allocated buffers duplicated in new buffers.
23597  */
23598 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
23599
23600 /**
23601  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
23602  */
23603 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
23604
23605 /**
23606  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
23607  */
23608 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
23609
23610 /**
23611  * Checks if the given object is currently in the success state
23612  */
23613 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
23614
23615 /**
23616  * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
23617  */
23618 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
23619
23620 /**
23621  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
23622  * but with all dynamically-allocated buffers duplicated in new buffers.
23623  */
23624 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
23625
23626 /**
23627  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
23628  */
23629 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
23630
23631 /**
23632  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
23633  */
23634 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23635
23636 /**
23637  * Checks if the given object is currently in the success state
23638  */
23639 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
23640
23641 /**
23642  * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
23643  */
23644 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
23645
23646 /**
23647  * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
23648  * but with all dynamically-allocated buffers duplicated in new buffers.
23649  */
23650 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
23651
23652 /**
23653  * Creates a new tuple which has the same data as `orig`
23654  * but with all dynamically-allocated buffers duplicated in new buffers.
23655  */
23656 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
23657
23658 /**
23659  * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
23660  */
23661 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
23662
23663 /**
23664  * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
23665  */
23666 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
23667
23668 /**
23669  * Creates a new tuple which has the same data as `orig`
23670  * but with all dynamically-allocated buffers duplicated in new buffers.
23671  */
23672 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
23673
23674 /**
23675  * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
23676  */
23677 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
23678
23679 /**
23680  * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
23681  */
23682 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
23683
23684 /**
23685  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23686  */
23687 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
23688
23689 /**
23690  * Creates a new tuple which has the same data as `orig`
23691  * but with all dynamically-allocated buffers duplicated in new buffers.
23692  */
23693 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
23694
23695 /**
23696  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
23697  */
23698 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
23699
23700 /**
23701  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
23702  */
23703 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
23704
23705 /**
23706  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23707  */
23708 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
23709
23710 /**
23711  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23712  */
23713 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
23714
23715 /**
23716  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23717  */
23718 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
23719
23720 /**
23721  * Creates a new tuple which has the same data as `orig`
23722  * but with all dynamically-allocated buffers duplicated in new buffers.
23723  */
23724 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
23725
23726 /**
23727  * Creates a new C2Tuple_u32TxOutZ from the contained elements.
23728  */
23729 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
23730
23731 /**
23732  * Frees any resources used by the C2Tuple_u32TxOutZ.
23733  */
23734 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
23735
23736 /**
23737  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23738  */
23739 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
23740
23741 /**
23742  * Creates a new tuple which has the same data as `orig`
23743  * but with all dynamically-allocated buffers duplicated in new buffers.
23744  */
23745 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
23746
23747 /**
23748  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
23749  */
23750 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
23751
23752 /**
23753  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
23754  */
23755 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
23756
23757 /**
23758  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23759  */
23760 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
23761
23762 /**
23763  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23764  */
23765 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
23766
23767 /**
23768  * Creates a new tuple which has the same data as `orig`
23769  * but with all dynamically-allocated buffers duplicated in new buffers.
23770  */
23771 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
23772
23773 /**
23774  * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
23775  */
23776 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
23777
23778 /**
23779  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
23780  */
23781 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
23782
23783 /**
23784  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
23785  */
23786 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
23787
23788 /**
23789  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
23790  */
23791 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
23792
23793 /**
23794  * Checks if the given object is currently in the success state
23795  */
23796 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
23797
23798 /**
23799  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
23800  */
23801 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
23802
23803 /**
23804  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
23805  * but with all dynamically-allocated buffers duplicated in new buffers.
23806  */
23807 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
23808
23809 /**
23810  * Creates a new tuple which has the same data as `orig`
23811  * but with all dynamically-allocated buffers duplicated in new buffers.
23812  */
23813 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
23814
23815 /**
23816  * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
23817  */
23818 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
23819
23820 /**
23821  * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
23822  */
23823 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
23824
23825 /**
23826  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23827  */
23828 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
23829
23830 /**
23831  * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
23832  */
23833 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
23834
23835 /**
23836  * Constructs a new COption_OnionMessageContentsZ containing nothing
23837  */
23838 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
23839
23840 /**
23841  * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
23842  */
23843 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
23844
23845 /**
23846  * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
23847  * but with all dynamically-allocated buffers duplicated in new buffers.
23848  */
23849 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
23850
23851 /**
23852  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
23853  */
23854 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
23855
23856 /**
23857  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
23858  */
23859 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
23860
23861 /**
23862  * Checks if the given object is currently in the success state
23863  */
23864 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
23865
23866 /**
23867  * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
23868  */
23869 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
23870
23871 /**
23872  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
23873  * but with all dynamically-allocated buffers duplicated in new buffers.
23874  */
23875 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
23876
23877 /**
23878  * Creates a new tuple which has the same data as `orig`
23879  * but with all dynamically-allocated buffers duplicated in new buffers.
23880  */
23881 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
23882
23883 /**
23884  * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
23885  */
23886 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
23887
23888 /**
23889  * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
23890  */
23891 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
23892
23893 /**
23894  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23895  */
23896 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
23897
23898 /**
23899  * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
23900  */
23901 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
23902
23903 /**
23904  * Constructs a new COption_TypeZ containing nothing
23905  */
23906 struct LDKCOption_TypeZ COption_TypeZ_none(void);
23907
23908 /**
23909  * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
23910  */
23911 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
23912
23913 /**
23914  * Creates a new COption_TypeZ which has the same data as `orig`
23915  * but with all dynamically-allocated buffers duplicated in new buffers.
23916  */
23917 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
23918
23919 /**
23920  * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
23921  */
23922 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
23923
23924 /**
23925  * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
23926  */
23927 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
23928
23929 /**
23930  * Checks if the given object is currently in the success state
23931  */
23932 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
23933
23934 /**
23935  * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
23936  */
23937 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
23938
23939 /**
23940  * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
23941  * but with all dynamically-allocated buffers duplicated in new buffers.
23942  */
23943 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
23944
23945 /**
23946  * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
23947  */
23948 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
23949
23950 /**
23951  * Constructs a new COption_SocketAddressZ containing nothing
23952  */
23953 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
23954
23955 /**
23956  * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
23957  */
23958 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
23959
23960 /**
23961  * Creates a new COption_SocketAddressZ which has the same data as `orig`
23962  * but with all dynamically-allocated buffers duplicated in new buffers.
23963  */
23964 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
23965
23966 /**
23967  * Creates a new tuple which has the same data as `orig`
23968  * but with all dynamically-allocated buffers duplicated in new buffers.
23969  */
23970 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR orig);
23971
23972 /**
23973  * Creates a new C2Tuple_PublicKeyCOption_SocketAddressZZ from the contained elements.
23974  */
23975 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_SocketAddressZ b);
23976
23977 /**
23978  * Frees any resources used by the C2Tuple_PublicKeyCOption_SocketAddressZZ.
23979  */
23980 void C2Tuple_PublicKeyCOption_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res);
23981
23982 /**
23983  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23984  */
23985 void CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res);
23986
23987 /**
23988  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
23989  */
23990 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
23991
23992 /**
23993  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
23994  */
23995 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
23996
23997 /**
23998  * Checks if the given object is currently in the success state
23999  */
24000 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
24001
24002 /**
24003  * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
24004  */
24005 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
24006
24007 /**
24008  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
24009  * but with all dynamically-allocated buffers duplicated in new buffers.
24010  */
24011 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
24012
24013 /**
24014  * Creates a new CResult_NonePeerHandleErrorZ in the success state.
24015  */
24016 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
24017
24018 /**
24019  * Creates a new CResult_NonePeerHandleErrorZ in the error state.
24020  */
24021 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
24022
24023 /**
24024  * Checks if the given object is currently in the success state
24025  */
24026 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
24027
24028 /**
24029  * Frees any resources used by the CResult_NonePeerHandleErrorZ.
24030  */
24031 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
24032
24033 /**
24034  * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
24035  * but with all dynamically-allocated buffers duplicated in new buffers.
24036  */
24037 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
24038
24039 /**
24040  * Creates a new CResult_boolPeerHandleErrorZ in the success state.
24041  */
24042 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
24043
24044 /**
24045  * Creates a new CResult_boolPeerHandleErrorZ in the error state.
24046  */
24047 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
24048
24049 /**
24050  * Checks if the given object is currently in the success state
24051  */
24052 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
24053
24054 /**
24055  * Frees any resources used by the CResult_boolPeerHandleErrorZ.
24056  */
24057 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
24058
24059 /**
24060  * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
24061  * but with all dynamically-allocated buffers duplicated in new buffers.
24062  */
24063 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
24064
24065 /**
24066  * Creates a new CResult_u32GraphSyncErrorZ in the success state.
24067  */
24068 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
24069
24070 /**
24071  * Creates a new CResult_u32GraphSyncErrorZ in the error state.
24072  */
24073 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
24074
24075 /**
24076  * Checks if the given object is currently in the success state
24077  */
24078 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
24079
24080 /**
24081  * Frees any resources used by the CResult_u32GraphSyncErrorZ.
24082  */
24083 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
24084
24085 /**
24086  * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
24087  */
24088 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
24089
24090 /**
24091  * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
24092  */
24093 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
24094
24095 /**
24096  * Checks if the given object is currently in the success state
24097  */
24098 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
24099
24100 /**
24101  * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
24102  */
24103 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
24104
24105 /**
24106  * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
24107  * but with all dynamically-allocated buffers duplicated in new buffers.
24108  */
24109 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
24110
24111 /**
24112  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24113  */
24114 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
24115
24116 /**
24117  * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
24118  */
24119 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
24120
24121 /**
24122  * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
24123  */
24124 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
24125
24126 /**
24127  * Checks if the given object is currently in the success state
24128  */
24129 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
24130
24131 /**
24132  * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
24133  */
24134 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
24135
24136 /**
24137  * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
24138  * but with all dynamically-allocated buffers duplicated in new buffers.
24139  */
24140 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
24141
24142 /**
24143  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24144  */
24145 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
24146
24147 /**
24148  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
24149  */
24150 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
24151
24152 /**
24153  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
24154  */
24155 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
24156
24157 /**
24158  * Checks if the given object is currently in the success state
24159  */
24160 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
24161
24162 /**
24163  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
24164  */
24165 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
24166
24167 /**
24168  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
24169  * but with all dynamically-allocated buffers duplicated in new buffers.
24170  */
24171 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
24172
24173 /**
24174  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
24175  */
24176 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
24177
24178 /**
24179  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
24180  */
24181 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
24182
24183 /**
24184  * Checks if the given object is currently in the success state
24185  */
24186 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
24187
24188 /**
24189  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
24190  */
24191 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
24192
24193 /**
24194  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
24195  * but with all dynamically-allocated buffers duplicated in new buffers.
24196  */
24197 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
24198
24199 /**
24200  * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
24201  */
24202 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
24203
24204 /**
24205  * Constructs a new COption_SecretKeyZ containing nothing
24206  */
24207 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
24208
24209 /**
24210  * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
24211  */
24212 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
24213
24214 /**
24215  * Creates a new COption_SecretKeyZ which has the same data as `orig`
24216  * but with all dynamically-allocated buffers duplicated in new buffers.
24217  */
24218 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
24219
24220 /**
24221  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
24222  */
24223 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
24224
24225 /**
24226  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
24227  */
24228 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
24229
24230 /**
24231  * Checks if the given object is currently in the success state
24232  */
24233 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
24234
24235 /**
24236  * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
24237  */
24238 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
24239
24240 /**
24241  * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
24242  * but with all dynamically-allocated buffers duplicated in new buffers.
24243  */
24244 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
24245
24246 /**
24247  * Constructs a new COption_NoneZ containing a
24248  */
24249 enum LDKCOption_NoneZ COption_NoneZ_some(void);
24250
24251 /**
24252  * Constructs a new COption_NoneZ containing nothing
24253  */
24254 enum LDKCOption_NoneZ COption_NoneZ_none(void);
24255
24256 /**
24257  * Frees any resources associated with the , if we are in the Some state
24258  */
24259 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
24260
24261 /**
24262  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24263  */
24264 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
24265
24266 /**
24267  * Constructs a new COption_i64Z containing a i64
24268  */
24269 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
24270
24271 /**
24272  * Constructs a new COption_i64Z containing nothing
24273  */
24274 struct LDKCOption_i64Z COption_i64Z_none(void);
24275
24276 /**
24277  * Frees any resources associated with the i64, if we are in the Some state
24278  */
24279 void COption_i64Z_free(struct LDKCOption_i64Z _res);
24280
24281 /**
24282  * Creates a new COption_i64Z which has the same data as `orig`
24283  * but with all dynamically-allocated buffers duplicated in new buffers.
24284  */
24285 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
24286
24287 /**
24288  * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
24289  */
24290 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
24291
24292 /**
24293  * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
24294  */
24295 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
24296
24297 /**
24298  * Checks if the given object is currently in the success state
24299  */
24300 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
24301
24302 /**
24303  * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
24304  */
24305 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
24306
24307 /**
24308  * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
24309  * but with all dynamically-allocated buffers duplicated in new buffers.
24310  */
24311 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
24312
24313 /**
24314  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
24315  */
24316 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
24317
24318 /**
24319  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
24320  */
24321 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
24322
24323 /**
24324  * Checks if the given object is currently in the success state
24325  */
24326 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
24327
24328 /**
24329  * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
24330  */
24331 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
24332
24333 /**
24334  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
24335  * but with all dynamically-allocated buffers duplicated in new buffers.
24336  */
24337 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
24338
24339 /**
24340  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24341  */
24342 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
24343
24344 /**
24345  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24346  */
24347 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
24348
24349 /**
24350  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24351  */
24352 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
24353
24354 /**
24355  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24356  */
24357 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
24358
24359 /**
24360  * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
24361  */
24362 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
24363
24364 /**
24365  * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
24366  */
24367 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
24368
24369 /**
24370  * Checks if the given object is currently in the success state
24371  */
24372 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
24373
24374 /**
24375  * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
24376  */
24377 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
24378
24379 /**
24380  * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
24381  * but with all dynamically-allocated buffers duplicated in new buffers.
24382  */
24383 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
24384
24385 /**
24386  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
24387  */
24388 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
24389
24390 /**
24391  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
24392  */
24393 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
24394
24395 /**
24396  * Checks if the given object is currently in the success state
24397  */
24398 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
24399
24400 /**
24401  * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
24402  */
24403 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
24404
24405 /**
24406  * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
24407  * but with all dynamically-allocated buffers duplicated in new buffers.
24408  */
24409 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
24410
24411 /**
24412  * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
24413  */
24414 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
24415
24416 /**
24417  * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
24418  */
24419 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
24420
24421 /**
24422  * Checks if the given object is currently in the success state
24423  */
24424 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
24425
24426 /**
24427  * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
24428  */
24429 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
24430
24431 /**
24432  * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
24433  * but with all dynamically-allocated buffers duplicated in new buffers.
24434  */
24435 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
24436
24437 /**
24438  * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
24439  */
24440 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
24441
24442 /**
24443  * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
24444  */
24445 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
24446
24447 /**
24448  * Checks if the given object is currently in the success state
24449  */
24450 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
24451
24452 /**
24453  * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
24454  */
24455 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
24456
24457 /**
24458  * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
24459  * but with all dynamically-allocated buffers duplicated in new buffers.
24460  */
24461 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
24462
24463 /**
24464  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
24465  */
24466 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
24467
24468 /**
24469  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
24470  */
24471 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
24472
24473 /**
24474  * Checks if the given object is currently in the success state
24475  */
24476 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
24477
24478 /**
24479  * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
24480  */
24481 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
24482
24483 /**
24484  * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
24485  * but with all dynamically-allocated buffers duplicated in new buffers.
24486  */
24487 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
24488
24489 /**
24490  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
24491  */
24492 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
24493
24494 /**
24495  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
24496  */
24497 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
24498
24499 /**
24500  * Checks if the given object is currently in the success state
24501  */
24502 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
24503
24504 /**
24505  * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
24506  */
24507 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
24508
24509 /**
24510  * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
24511  * but with all dynamically-allocated buffers duplicated in new buffers.
24512  */
24513 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
24514
24515 /**
24516  * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
24517  */
24518 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
24519
24520 /**
24521  * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
24522  */
24523 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
24524
24525 /**
24526  * Checks if the given object is currently in the success state
24527  */
24528 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
24529
24530 /**
24531  * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
24532  */
24533 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
24534
24535 /**
24536  * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
24537  * but with all dynamically-allocated buffers duplicated in new buffers.
24538  */
24539 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
24540
24541 /**
24542  * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
24543  */
24544 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
24545
24546 /**
24547  * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
24548  */
24549 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
24550
24551 /**
24552  * Checks if the given object is currently in the success state
24553  */
24554 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
24555
24556 /**
24557  * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
24558  */
24559 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
24560
24561 /**
24562  * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
24563  * but with all dynamically-allocated buffers duplicated in new buffers.
24564  */
24565 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
24566
24567 /**
24568  * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
24569  */
24570 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
24571
24572 /**
24573  * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
24574  */
24575 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
24576
24577 /**
24578  * Checks if the given object is currently in the success state
24579  */
24580 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
24581
24582 /**
24583  * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
24584  */
24585 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
24586
24587 /**
24588  * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
24589  * but with all dynamically-allocated buffers duplicated in new buffers.
24590  */
24591 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
24592
24593 /**
24594  * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
24595  */
24596 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
24597
24598 /**
24599  * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
24600  */
24601 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
24602
24603 /**
24604  * Checks if the given object is currently in the success state
24605  */
24606 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
24607
24608 /**
24609  * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
24610  */
24611 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
24612
24613 /**
24614  * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
24615  * but with all dynamically-allocated buffers duplicated in new buffers.
24616  */
24617 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
24618
24619 /**
24620  * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
24621  */
24622 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
24623
24624 /**
24625  * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
24626  */
24627 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
24628
24629 /**
24630  * Checks if the given object is currently in the success state
24631  */
24632 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
24633
24634 /**
24635  * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
24636  */
24637 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
24638
24639 /**
24640  * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
24641  * but with all dynamically-allocated buffers duplicated in new buffers.
24642  */
24643 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
24644
24645 /**
24646  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
24647  */
24648 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
24649
24650 /**
24651  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
24652  */
24653 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
24654
24655 /**
24656  * Checks if the given object is currently in the success state
24657  */
24658 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
24659
24660 /**
24661  * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
24662  */
24663 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
24664
24665 /**
24666  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
24667  * but with all dynamically-allocated buffers duplicated in new buffers.
24668  */
24669 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
24670
24671 /**
24672  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
24673  */
24674 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
24675
24676 /**
24677  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
24678  */
24679 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
24680
24681 /**
24682  * Checks if the given object is currently in the success state
24683  */
24684 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
24685
24686 /**
24687  * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
24688  */
24689 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
24690
24691 /**
24692  * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
24693  * but with all dynamically-allocated buffers duplicated in new buffers.
24694  */
24695 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
24696
24697 /**
24698  * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
24699  */
24700 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
24701
24702 /**
24703  * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
24704  */
24705 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
24706
24707 /**
24708  * Checks if the given object is currently in the success state
24709  */
24710 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
24711
24712 /**
24713  * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
24714  */
24715 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
24716
24717 /**
24718  * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
24719  * but with all dynamically-allocated buffers duplicated in new buffers.
24720  */
24721 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
24722
24723 /**
24724  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
24725  */
24726 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
24727
24728 /**
24729  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
24730  */
24731 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
24732
24733 /**
24734  * Checks if the given object is currently in the success state
24735  */
24736 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
24737
24738 /**
24739  * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
24740  */
24741 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
24742
24743 /**
24744  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
24745  * but with all dynamically-allocated buffers duplicated in new buffers.
24746  */
24747 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
24748
24749 /**
24750  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
24751  */
24752 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
24753
24754 /**
24755  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
24756  */
24757 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
24758
24759 /**
24760  * Checks if the given object is currently in the success state
24761  */
24762 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
24763
24764 /**
24765  * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
24766  */
24767 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
24768
24769 /**
24770  * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
24771  * but with all dynamically-allocated buffers duplicated in new buffers.
24772  */
24773 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
24774
24775 /**
24776  * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
24777  */
24778 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
24779
24780 /**
24781  * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
24782  */
24783 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
24784
24785 /**
24786  * Checks if the given object is currently in the success state
24787  */
24788 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
24789
24790 /**
24791  * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
24792  */
24793 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
24794
24795 /**
24796  * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
24797  * but with all dynamically-allocated buffers duplicated in new buffers.
24798  */
24799 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
24800
24801 /**
24802  * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
24803  */
24804 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
24805
24806 /**
24807  * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
24808  */
24809 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
24810
24811 /**
24812  * Checks if the given object is currently in the success state
24813  */
24814 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
24815
24816 /**
24817  * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
24818  */
24819 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
24820
24821 /**
24822  * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
24823  * but with all dynamically-allocated buffers duplicated in new buffers.
24824  */
24825 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
24826
24827 /**
24828  * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
24829  */
24830 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
24831
24832 /**
24833  * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
24834  */
24835 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
24836
24837 /**
24838  * Checks if the given object is currently in the success state
24839  */
24840 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
24841
24842 /**
24843  * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
24844  */
24845 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
24846
24847 /**
24848  * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
24849  * but with all dynamically-allocated buffers duplicated in new buffers.
24850  */
24851 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
24852
24853 /**
24854  * Creates a new CResult_InitDecodeErrorZ in the success state.
24855  */
24856 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
24857
24858 /**
24859  * Creates a new CResult_InitDecodeErrorZ in the error state.
24860  */
24861 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
24862
24863 /**
24864  * Checks if the given object is currently in the success state
24865  */
24866 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
24867
24868 /**
24869  * Frees any resources used by the CResult_InitDecodeErrorZ.
24870  */
24871 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
24872
24873 /**
24874  * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
24875  * but with all dynamically-allocated buffers duplicated in new buffers.
24876  */
24877 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
24878
24879 /**
24880  * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
24881  */
24882 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
24883
24884 /**
24885  * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
24886  */
24887 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
24888
24889 /**
24890  * Checks if the given object is currently in the success state
24891  */
24892 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
24893
24894 /**
24895  * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
24896  */
24897 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
24898
24899 /**
24900  * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
24901  * but with all dynamically-allocated buffers duplicated in new buffers.
24902  */
24903 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
24904
24905 /**
24906  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
24907  */
24908 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
24909
24910 /**
24911  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
24912  */
24913 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
24914
24915 /**
24916  * Checks if the given object is currently in the success state
24917  */
24918 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
24919
24920 /**
24921  * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
24922  */
24923 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
24924
24925 /**
24926  * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
24927  * but with all dynamically-allocated buffers duplicated in new buffers.
24928  */
24929 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
24930
24931 /**
24932  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
24933  */
24934 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
24935
24936 /**
24937  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
24938  */
24939 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
24940
24941 /**
24942  * Checks if the given object is currently in the success state
24943  */
24944 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
24945
24946 /**
24947  * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
24948  */
24949 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
24950
24951 /**
24952  * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
24953  * but with all dynamically-allocated buffers duplicated in new buffers.
24954  */
24955 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
24956
24957 /**
24958  * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
24959  */
24960 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
24961
24962 /**
24963  * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
24964  */
24965 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
24966
24967 /**
24968  * Checks if the given object is currently in the success state
24969  */
24970 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
24971
24972 /**
24973  * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
24974  */
24975 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
24976
24977 /**
24978  * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
24979  * but with all dynamically-allocated buffers duplicated in new buffers.
24980  */
24981 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
24982
24983 /**
24984  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
24985  */
24986 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
24987
24988 /**
24989  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
24990  */
24991 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24992
24993 /**
24994  * Checks if the given object is currently in the success state
24995  */
24996 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
24997
24998 /**
24999  * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
25000  */
25001 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
25002
25003 /**
25004  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
25005  * but with all dynamically-allocated buffers duplicated in new buffers.
25006  */
25007 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
25008
25009 /**
25010  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
25011  */
25012 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
25013
25014 /**
25015  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
25016  */
25017 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
25018
25019 /**
25020  * Checks if the given object is currently in the success state
25021  */
25022 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
25023
25024 /**
25025  * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
25026  */
25027 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
25028
25029 /**
25030  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
25031  * but with all dynamically-allocated buffers duplicated in new buffers.
25032  */
25033 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
25034
25035 /**
25036  * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
25037  */
25038 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
25039
25040 /**
25041  * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
25042  */
25043 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
25044
25045 /**
25046  * Checks if the given object is currently in the success state
25047  */
25048 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
25049
25050 /**
25051  * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
25052  */
25053 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
25054
25055 /**
25056  * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
25057  * but with all dynamically-allocated buffers duplicated in new buffers.
25058  */
25059 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
25060
25061 /**
25062  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
25063  */
25064 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
25065
25066 /**
25067  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
25068  */
25069 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
25070
25071 /**
25072  * Checks if the given object is currently in the success state
25073  */
25074 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
25075
25076 /**
25077  * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
25078  */
25079 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
25080
25081 /**
25082  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
25083  * but with all dynamically-allocated buffers duplicated in new buffers.
25084  */
25085 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
25086
25087 /**
25088  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
25089  */
25090 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
25091
25092 /**
25093  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
25094  */
25095 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
25096
25097 /**
25098  * Checks if the given object is currently in the success state
25099  */
25100 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
25101
25102 /**
25103  * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
25104  */
25105 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
25106
25107 /**
25108  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
25109  * but with all dynamically-allocated buffers duplicated in new buffers.
25110  */
25111 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
25112
25113 /**
25114  * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
25115  */
25116 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
25117
25118 /**
25119  * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
25120  */
25121 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
25122
25123 /**
25124  * Checks if the given object is currently in the success state
25125  */
25126 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
25127
25128 /**
25129  * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
25130  */
25131 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
25132
25133 /**
25134  * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
25135  * but with all dynamically-allocated buffers duplicated in new buffers.
25136  */
25137 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
25138
25139 /**
25140  * Creates a new CResult_PingDecodeErrorZ in the success state.
25141  */
25142 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
25143
25144 /**
25145  * Creates a new CResult_PingDecodeErrorZ in the error state.
25146  */
25147 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
25148
25149 /**
25150  * Checks if the given object is currently in the success state
25151  */
25152 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
25153
25154 /**
25155  * Frees any resources used by the CResult_PingDecodeErrorZ.
25156  */
25157 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
25158
25159 /**
25160  * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
25161  * but with all dynamically-allocated buffers duplicated in new buffers.
25162  */
25163 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
25164
25165 /**
25166  * Creates a new CResult_PongDecodeErrorZ in the success state.
25167  */
25168 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
25169
25170 /**
25171  * Creates a new CResult_PongDecodeErrorZ in the error state.
25172  */
25173 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
25174
25175 /**
25176  * Checks if the given object is currently in the success state
25177  */
25178 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
25179
25180 /**
25181  * Frees any resources used by the CResult_PongDecodeErrorZ.
25182  */
25183 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
25184
25185 /**
25186  * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
25187  * but with all dynamically-allocated buffers duplicated in new buffers.
25188  */
25189 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
25190
25191 /**
25192  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
25193  */
25194 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
25195
25196 /**
25197  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
25198  */
25199 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
25200
25201 /**
25202  * Checks if the given object is currently in the success state
25203  */
25204 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
25205
25206 /**
25207  * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
25208  */
25209 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
25210
25211 /**
25212  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
25213  * but with all dynamically-allocated buffers duplicated in new buffers.
25214  */
25215 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
25216
25217 /**
25218  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
25219  */
25220 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
25221
25222 /**
25223  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
25224  */
25225 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
25226
25227 /**
25228  * Checks if the given object is currently in the success state
25229  */
25230 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
25231
25232 /**
25233  * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
25234  */
25235 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
25236
25237 /**
25238  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
25239  * but with all dynamically-allocated buffers duplicated in new buffers.
25240  */
25241 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
25242
25243 /**
25244  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
25245  */
25246 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
25247
25248 /**
25249  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
25250  */
25251 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
25252
25253 /**
25254  * Checks if the given object is currently in the success state
25255  */
25256 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
25257
25258 /**
25259  * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
25260  */
25261 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
25262
25263 /**
25264  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
25265  * but with all dynamically-allocated buffers duplicated in new buffers.
25266  */
25267 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
25268
25269 /**
25270  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
25271  */
25272 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
25273
25274 /**
25275  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
25276  */
25277 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
25278
25279 /**
25280  * Checks if the given object is currently in the success state
25281  */
25282 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
25283
25284 /**
25285  * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
25286  */
25287 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
25288
25289 /**
25290  * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
25291  * but with all dynamically-allocated buffers duplicated in new buffers.
25292  */
25293 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
25294
25295 /**
25296  * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
25297  */
25298 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
25299
25300 /**
25301  * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
25302  */
25303 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
25304
25305 /**
25306  * Checks if the given object is currently in the success state
25307  */
25308 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
25309
25310 /**
25311  * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
25312  */
25313 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
25314
25315 /**
25316  * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
25317  * but with all dynamically-allocated buffers duplicated in new buffers.
25318  */
25319 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
25320
25321 /**
25322  * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
25323  */
25324 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
25325
25326 /**
25327  * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
25328  */
25329 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
25330
25331 /**
25332  * Checks if the given object is currently in the success state
25333  */
25334 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
25335
25336 /**
25337  * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
25338  */
25339 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
25340
25341 /**
25342  * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
25343  * but with all dynamically-allocated buffers duplicated in new buffers.
25344  */
25345 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
25346
25347 /**
25348  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
25349  */
25350 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
25351
25352 /**
25353  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
25354  */
25355 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
25356
25357 /**
25358  * Checks if the given object is currently in the success state
25359  */
25360 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
25361
25362 /**
25363  * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
25364  */
25365 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
25366
25367 /**
25368  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
25369  * but with all dynamically-allocated buffers duplicated in new buffers.
25370  */
25371 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
25372
25373 /**
25374  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
25375  */
25376 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
25377
25378 /**
25379  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
25380  */
25381 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
25382
25383 /**
25384  * Checks if the given object is currently in the success state
25385  */
25386 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
25387
25388 /**
25389  * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
25390  */
25391 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
25392
25393 /**
25394  * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
25395  * but with all dynamically-allocated buffers duplicated in new buffers.
25396  */
25397 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
25398
25399 /**
25400  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
25401  */
25402 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
25403
25404 /**
25405  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
25406  */
25407 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
25408
25409 /**
25410  * Checks if the given object is currently in the success state
25411  */
25412 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
25413
25414 /**
25415  * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
25416  */
25417 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
25418
25419 /**
25420  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
25421  * but with all dynamically-allocated buffers duplicated in new buffers.
25422  */
25423 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
25424
25425 /**
25426  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
25427  */
25428 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
25429
25430 /**
25431  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
25432  */
25433 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
25434
25435 /**
25436  * Checks if the given object is currently in the success state
25437  */
25438 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
25439
25440 /**
25441  * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
25442  */
25443 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
25444
25445 /**
25446  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
25447  * but with all dynamically-allocated buffers duplicated in new buffers.
25448  */
25449 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
25450
25451 /**
25452  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
25453  */
25454 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
25455
25456 /**
25457  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
25458  */
25459 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
25460
25461 /**
25462  * Checks if the given object is currently in the success state
25463  */
25464 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
25465
25466 /**
25467  * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
25468  */
25469 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
25470
25471 /**
25472  * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
25473  * but with all dynamically-allocated buffers duplicated in new buffers.
25474  */
25475 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
25476
25477 /**
25478  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
25479  */
25480 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
25481
25482 /**
25483  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
25484  */
25485 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
25486
25487 /**
25488  * Checks if the given object is currently in the success state
25489  */
25490 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
25491
25492 /**
25493  * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
25494  */
25495 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
25496
25497 /**
25498  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
25499  * but with all dynamically-allocated buffers duplicated in new buffers.
25500  */
25501 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
25502
25503 /**
25504  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
25505  */
25506 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
25507
25508 /**
25509  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
25510  */
25511 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
25512
25513 /**
25514  * Checks if the given object is currently in the success state
25515  */
25516 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
25517
25518 /**
25519  * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
25520  */
25521 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
25522
25523 /**
25524  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
25525  * but with all dynamically-allocated buffers duplicated in new buffers.
25526  */
25527 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
25528
25529 /**
25530  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25531  */
25532 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
25533
25534 /**
25535  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
25536  */
25537 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
25538
25539 /**
25540  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
25541  */
25542 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
25543
25544 /**
25545  * Checks if the given object is currently in the success state
25546  */
25547 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
25548
25549 /**
25550  * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
25551  */
25552 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
25553
25554 /**
25555  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
25556  * but with all dynamically-allocated buffers duplicated in new buffers.
25557  */
25558 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
25559
25560 /**
25561  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25562  */
25563 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
25564
25565 /**
25566  * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
25567  */
25568 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
25569
25570 /**
25571  * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
25572  */
25573 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
25574
25575 /**
25576  * Checks if the given object is currently in the success state
25577  */
25578 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
25579
25580 /**
25581  * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
25582  */
25583 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
25584
25585 /**
25586  * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
25587  * but with all dynamically-allocated buffers duplicated in new buffers.
25588  */
25589 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
25590
25591 /**
25592  * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
25593  */
25594 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
25595
25596 /**
25597  * Constructs a new COption_HTLCClaimZ containing nothing
25598  */
25599 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
25600
25601 /**
25602  * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
25603  */
25604 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
25605
25606 /**
25607  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
25608  */
25609 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
25610
25611 /**
25612  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
25613  */
25614 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
25615
25616 /**
25617  * Checks if the given object is currently in the success state
25618  */
25619 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
25620
25621 /**
25622  * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
25623  */
25624 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
25625
25626 /**
25627  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
25628  * but with all dynamically-allocated buffers duplicated in new buffers.
25629  */
25630 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
25631
25632 /**
25633  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
25634  */
25635 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
25636
25637 /**
25638  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
25639  */
25640 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
25641
25642 /**
25643  * Checks if the given object is currently in the success state
25644  */
25645 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
25646
25647 /**
25648  * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
25649  */
25650 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
25651
25652 /**
25653  * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
25654  * but with all dynamically-allocated buffers duplicated in new buffers.
25655  */
25656 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
25657
25658 /**
25659  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
25660  */
25661 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
25662
25663 /**
25664  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
25665  */
25666 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
25667
25668 /**
25669  * Checks if the given object is currently in the success state
25670  */
25671 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
25672
25673 /**
25674  * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
25675  */
25676 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
25677
25678 /**
25679  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
25680  * but with all dynamically-allocated buffers duplicated in new buffers.
25681  */
25682 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
25683
25684 /**
25685  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
25686  */
25687 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
25688
25689 /**
25690  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
25691  */
25692 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
25693
25694 /**
25695  * Checks if the given object is currently in the success state
25696  */
25697 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
25698
25699 /**
25700  * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
25701  */
25702 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
25703
25704 /**
25705  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
25706  * but with all dynamically-allocated buffers duplicated in new buffers.
25707  */
25708 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
25709
25710 /**
25711  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
25712  */
25713 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
25714
25715 /**
25716  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
25717  */
25718 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
25719
25720 /**
25721  * Checks if the given object is currently in the success state
25722  */
25723 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
25724
25725 /**
25726  * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
25727  */
25728 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
25729
25730 /**
25731  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
25732  * but with all dynamically-allocated buffers duplicated in new buffers.
25733  */
25734 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
25735
25736 /**
25737  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
25738  */
25739 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
25740
25741 /**
25742  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
25743  */
25744 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
25745
25746 /**
25747  * Checks if the given object is currently in the success state
25748  */
25749 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
25750
25751 /**
25752  * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
25753  */
25754 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
25755
25756 /**
25757  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
25758  * but with all dynamically-allocated buffers duplicated in new buffers.
25759  */
25760 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
25761
25762 /**
25763  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
25764  */
25765 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
25766
25767 /**
25768  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
25769  */
25770 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25771
25772 /**
25773  * Checks if the given object is currently in the success state
25774  */
25775 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25776
25777 /**
25778  * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
25779  */
25780 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
25781
25782 /**
25783  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
25784  * but with all dynamically-allocated buffers duplicated in new buffers.
25785  */
25786 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25787
25788 /**
25789  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
25790  */
25791 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
25792
25793 /**
25794  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
25795  */
25796 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25797
25798 /**
25799  * Checks if the given object is currently in the success state
25800  */
25801 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25802
25803 /**
25804  * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
25805  */
25806 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
25807
25808 /**
25809  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
25810  * but with all dynamically-allocated buffers duplicated in new buffers.
25811  */
25812 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25813
25814 /**
25815  * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
25816  */
25817 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
25818
25819 /**
25820  * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
25821  */
25822 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
25823
25824 /**
25825  * Checks if the given object is currently in the success state
25826  */
25827 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
25828
25829 /**
25830  * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
25831  */
25832 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
25833
25834 /**
25835  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
25836  */
25837 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
25838
25839 /**
25840  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
25841  */
25842 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25843
25844 /**
25845  * Checks if the given object is currently in the success state
25846  */
25847 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25848
25849 /**
25850  * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
25851  */
25852 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
25853
25854 /**
25855  * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
25856  * but with all dynamically-allocated buffers duplicated in new buffers.
25857  */
25858 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25859
25860 /**
25861  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
25862  */
25863 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
25864
25865 /**
25866  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
25867  */
25868 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
25869
25870 /**
25871  * Checks if the given object is currently in the success state
25872  */
25873 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
25874
25875 /**
25876  * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
25877  */
25878 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
25879
25880 /**
25881  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
25882  */
25883 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
25884
25885 /**
25886  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
25887  */
25888 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
25889
25890 /**
25891  * Checks if the given object is currently in the success state
25892  */
25893 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
25894
25895 /**
25896  * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
25897  */
25898 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
25899
25900 /**
25901  * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
25902  * but with all dynamically-allocated buffers duplicated in new buffers.
25903  */
25904 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
25905
25906 /**
25907  * Constructs a new COption_usizeZ containing a usize
25908  */
25909 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
25910
25911 /**
25912  * Constructs a new COption_usizeZ containing nothing
25913  */
25914 struct LDKCOption_usizeZ COption_usizeZ_none(void);
25915
25916 /**
25917  * Frees any resources associated with the usize, if we are in the Some state
25918  */
25919 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
25920
25921 /**
25922  * Creates a new COption_usizeZ which has the same data as `orig`
25923  * but with all dynamically-allocated buffers duplicated in new buffers.
25924  */
25925 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
25926
25927 /**
25928  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
25929  */
25930 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
25931
25932 /**
25933  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
25934  */
25935 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
25936
25937 /**
25938  * Checks if the given object is currently in the success state
25939  */
25940 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
25941
25942 /**
25943  * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
25944  */
25945 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
25946
25947 /**
25948  * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
25949  * but with all dynamically-allocated buffers duplicated in new buffers.
25950  */
25951 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
25952
25953 /**
25954  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
25955  */
25956 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
25957
25958 /**
25959  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
25960  */
25961 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
25962
25963 /**
25964  * Checks if the given object is currently in the success state
25965  */
25966 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
25967
25968 /**
25969  * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
25970  */
25971 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
25972
25973 /**
25974  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
25975  * but with all dynamically-allocated buffers duplicated in new buffers.
25976  */
25977 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
25978
25979 /**
25980  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
25981  */
25982 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
25983
25984 /**
25985  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
25986  */
25987 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
25988
25989 /**
25990  * Checks if the given object is currently in the success state
25991  */
25992 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
25993
25994 /**
25995  * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
25996  */
25997 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
25998
25999 /**
26000  * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
26001  * but with all dynamically-allocated buffers duplicated in new buffers.
26002  */
26003 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
26004
26005 /**
26006  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
26007  */
26008 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
26009
26010 /**
26011  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
26012  */
26013 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26014
26015 /**
26016  * Checks if the given object is currently in the success state
26017  */
26018 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
26019
26020 /**
26021  * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
26022  */
26023 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
26024
26025 /**
26026  * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
26027  * but with all dynamically-allocated buffers duplicated in new buffers.
26028  */
26029 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
26030
26031 /**
26032  * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
26033  */
26034 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
26035
26036 /**
26037  * Constructs a new COption_PathFailureZ containing nothing
26038  */
26039 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
26040
26041 /**
26042  * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
26043  */
26044 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
26045
26046 /**
26047  * Creates a new COption_PathFailureZ which has the same data as `orig`
26048  * but with all dynamically-allocated buffers duplicated in new buffers.
26049  */
26050 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
26051
26052 /**
26053  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
26054  */
26055 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
26056
26057 /**
26058  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
26059  */
26060 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
26061
26062 /**
26063  * Checks if the given object is currently in the success state
26064  */
26065 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
26066
26067 /**
26068  * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
26069  */
26070 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
26071
26072 /**
26073  * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
26074  * but with all dynamically-allocated buffers duplicated in new buffers.
26075  */
26076 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
26077
26078 /**
26079  * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
26080  */
26081 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
26082
26083 /**
26084  * Constructs a new COption_ClosureReasonZ containing nothing
26085  */
26086 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
26087
26088 /**
26089  * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
26090  */
26091 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
26092
26093 /**
26094  * Creates a new COption_ClosureReasonZ which has the same data as `orig`
26095  * but with all dynamically-allocated buffers duplicated in new buffers.
26096  */
26097 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
26098
26099 /**
26100  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
26101  */
26102 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
26103
26104 /**
26105  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
26106  */
26107 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
26108
26109 /**
26110  * Checks if the given object is currently in the success state
26111  */
26112 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
26113
26114 /**
26115  * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
26116  */
26117 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
26118
26119 /**
26120  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
26121  * but with all dynamically-allocated buffers duplicated in new buffers.
26122  */
26123 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
26124
26125 /**
26126  * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
26127  */
26128 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
26129
26130 /**
26131  * Constructs a new COption_HTLCDestinationZ containing nothing
26132  */
26133 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
26134
26135 /**
26136  * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
26137  */
26138 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
26139
26140 /**
26141  * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
26142  * but with all dynamically-allocated buffers duplicated in new buffers.
26143  */
26144 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
26145
26146 /**
26147  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
26148  */
26149 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
26150
26151 /**
26152  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
26153  */
26154 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
26155
26156 /**
26157  * Checks if the given object is currently in the success state
26158  */
26159 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
26160
26161 /**
26162  * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
26163  */
26164 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
26165
26166 /**
26167  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
26168  * but with all dynamically-allocated buffers duplicated in new buffers.
26169  */
26170 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
26171
26172 /**
26173  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
26174  */
26175 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
26176
26177 /**
26178  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
26179  */
26180 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
26181
26182 /**
26183  * Checks if the given object is currently in the success state
26184  */
26185 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
26186
26187 /**
26188  * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
26189  */
26190 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
26191
26192 /**
26193  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
26194  * but with all dynamically-allocated buffers duplicated in new buffers.
26195  */
26196 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
26197
26198 /**
26199  * Constructs a new COption_U128Z containing a crate::c_types::U128
26200  */
26201 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
26202
26203 /**
26204  * Constructs a new COption_U128Z containing nothing
26205  */
26206 struct LDKCOption_U128Z COption_U128Z_none(void);
26207
26208 /**
26209  * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
26210  */
26211 void COption_U128Z_free(struct LDKCOption_U128Z _res);
26212
26213 /**
26214  * Creates a new COption_U128Z which has the same data as `orig`
26215  * but with all dynamically-allocated buffers duplicated in new buffers.
26216  */
26217 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
26218
26219 /**
26220  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26221  */
26222 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
26223
26224 /**
26225  * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
26226  */
26227 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
26228
26229 /**
26230  * Constructs a new COption_PaymentFailureReasonZ containing nothing
26231  */
26232 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
26233
26234 /**
26235  * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
26236  */
26237 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
26238
26239 /**
26240  * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
26241  * but with all dynamically-allocated buffers duplicated in new buffers.
26242  */
26243 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
26244
26245 /**
26246  * Constructs a new COption_EventZ containing a crate::lightning::events::Event
26247  */
26248 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
26249
26250 /**
26251  * Constructs a new COption_EventZ containing nothing
26252  */
26253 struct LDKCOption_EventZ COption_EventZ_none(void);
26254
26255 /**
26256  * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
26257  */
26258 void COption_EventZ_free(struct LDKCOption_EventZ _res);
26259
26260 /**
26261  * Creates a new COption_EventZ which has the same data as `orig`
26262  * but with all dynamically-allocated buffers duplicated in new buffers.
26263  */
26264 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
26265
26266 /**
26267  * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
26268  */
26269 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
26270
26271 /**
26272  * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
26273  */
26274 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
26275
26276 /**
26277  * Checks if the given object is currently in the success state
26278  */
26279 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
26280
26281 /**
26282  * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
26283  */
26284 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
26285
26286 /**
26287  * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
26288  * but with all dynamically-allocated buffers duplicated in new buffers.
26289  */
26290 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
26291
26292 /**
26293  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
26294  */
26295 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
26296
26297 /**
26298  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
26299  */
26300 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
26301
26302 /**
26303  * Checks if the given object is currently in the success state
26304  */
26305 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
26306
26307 /**
26308  * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
26309  */
26310 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
26311
26312 /**
26313  * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
26314  * but with all dynamically-allocated buffers duplicated in new buffers.
26315  */
26316 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
26317
26318 /**
26319  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
26320  */
26321 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
26322
26323 /**
26324  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
26325  */
26326 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
26327
26328 /**
26329  * Checks if the given object is currently in the success state
26330  */
26331 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
26332
26333 /**
26334  * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
26335  */
26336 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
26337
26338 /**
26339  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
26340  * but with all dynamically-allocated buffers duplicated in new buffers.
26341  */
26342 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
26343
26344 /**
26345  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
26346  */
26347 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
26348
26349 /**
26350  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
26351  */
26352 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
26353
26354 /**
26355  * Checks if the given object is currently in the success state
26356  */
26357 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
26358
26359 /**
26360  * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
26361  */
26362 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
26363
26364 /**
26365  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
26366  * but with all dynamically-allocated buffers duplicated in new buffers.
26367  */
26368 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
26369
26370 /**
26371  * Creates a new tuple which has the same data as `orig`
26372  * but with all dynamically-allocated buffers duplicated in new buffers.
26373  */
26374 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
26375
26376 /**
26377  * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
26378  */
26379 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
26380
26381 /**
26382  * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
26383  */
26384 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
26385
26386 /**
26387  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
26388  */
26389 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
26390
26391 /**
26392  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
26393  */
26394 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
26395
26396 /**
26397  * Checks if the given object is currently in the success state
26398  */
26399 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
26400
26401 /**
26402  * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
26403  */
26404 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
26405
26406 /**
26407  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
26408  * but with all dynamically-allocated buffers duplicated in new buffers.
26409  */
26410 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
26411
26412 /**
26413  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26414  */
26415 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
26416
26417 /**
26418  * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
26419  */
26420 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
26421
26422 /**
26423  * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
26424  */
26425 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
26426
26427 /**
26428  * Checks if the given object is currently in the success state
26429  */
26430 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
26431
26432 /**
26433  * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
26434  */
26435 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
26436
26437 /**
26438  * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
26439  * but with all dynamically-allocated buffers duplicated in new buffers.
26440  */
26441 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
26442
26443 /**
26444  * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
26445  */
26446 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
26447
26448 /**
26449  * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
26450  */
26451 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
26452
26453 /**
26454  * Checks if the given object is currently in the success state
26455  */
26456 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
26457
26458 /**
26459  * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
26460  */
26461 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
26462
26463 /**
26464  * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
26465  * but with all dynamically-allocated buffers duplicated in new buffers.
26466  */
26467 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
26468
26469 /**
26470  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
26471  */
26472 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
26473
26474 /**
26475  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
26476  */
26477 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
26478
26479 /**
26480  * Checks if the given object is currently in the success state
26481  */
26482 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
26483
26484 /**
26485  * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
26486  */
26487 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
26488
26489 /**
26490  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
26491  * but with all dynamically-allocated buffers duplicated in new buffers.
26492  */
26493 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
26494
26495 /**
26496  * Creates a new CResult_DescriptionCreationErrorZ in the success state.
26497  */
26498 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
26499
26500 /**
26501  * Creates a new CResult_DescriptionCreationErrorZ in the error state.
26502  */
26503 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
26504
26505 /**
26506  * Checks if the given object is currently in the success state
26507  */
26508 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
26509
26510 /**
26511  * Frees any resources used by the CResult_DescriptionCreationErrorZ.
26512  */
26513 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
26514
26515 /**
26516  * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
26517  * but with all dynamically-allocated buffers duplicated in new buffers.
26518  */
26519 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
26520
26521 /**
26522  * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
26523  */
26524 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
26525
26526 /**
26527  * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
26528  */
26529 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
26530
26531 /**
26532  * Checks if the given object is currently in the success state
26533  */
26534 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
26535
26536 /**
26537  * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
26538  */
26539 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
26540
26541 /**
26542  * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
26543  * but with all dynamically-allocated buffers duplicated in new buffers.
26544  */
26545 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
26546
26547 /**
26548  * Creates a new CResult_OutPointDecodeErrorZ in the success state.
26549  */
26550 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
26551
26552 /**
26553  * Creates a new CResult_OutPointDecodeErrorZ in the error state.
26554  */
26555 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
26556
26557 /**
26558  * Checks if the given object is currently in the success state
26559  */
26560 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
26561
26562 /**
26563  * Frees any resources used by the CResult_OutPointDecodeErrorZ.
26564  */
26565 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
26566
26567 /**
26568  * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
26569  * but with all dynamically-allocated buffers duplicated in new buffers.
26570  */
26571 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
26572
26573 /**
26574  * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
26575  */
26576 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
26577
26578 /**
26579  * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
26580  */
26581 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
26582
26583 /**
26584  * Checks if the given object is currently in the success state
26585  */
26586 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
26587
26588 /**
26589  * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
26590  */
26591 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
26592
26593 /**
26594  * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
26595  * but with all dynamically-allocated buffers duplicated in new buffers.
26596  */
26597 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
26598
26599 /**
26600  * Creates a new CResult_HostnameDecodeErrorZ in the success state.
26601  */
26602 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
26603
26604 /**
26605  * Creates a new CResult_HostnameDecodeErrorZ in the error state.
26606  */
26607 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
26608
26609 /**
26610  * Checks if the given object is currently in the success state
26611  */
26612 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
26613
26614 /**
26615  * Frees any resources used by the CResult_HostnameDecodeErrorZ.
26616  */
26617 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
26618
26619 /**
26620  * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
26621  * but with all dynamically-allocated buffers duplicated in new buffers.
26622  */
26623 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
26624
26625 /**
26626  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
26627  */
26628 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
26629
26630 /**
26631  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
26632  */
26633 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
26634
26635 /**
26636  * Checks if the given object is currently in the success state
26637  */
26638 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
26639
26640 /**
26641  * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
26642  */
26643 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
26644
26645 /**
26646  * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
26647  * but with all dynamically-allocated buffers duplicated in new buffers.
26648  */
26649 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
26650
26651 /**
26652  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
26653  */
26654 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
26655
26656 /**
26657  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
26658  */
26659 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
26660
26661 /**
26662  * Checks if the given object is currently in the success state
26663  */
26664 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
26665
26666 /**
26667  * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
26668  */
26669 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
26670
26671 /**
26672  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
26673  * but with all dynamically-allocated buffers duplicated in new buffers.
26674  */
26675 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
26676
26677 /**
26678  * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
26679  */
26680 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
26681
26682 /**
26683  * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
26684  */
26685 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
26686
26687 /**
26688  * Checks if the given object is currently in the success state
26689  */
26690 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
26691
26692 /**
26693  * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
26694  */
26695 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
26696
26697 /**
26698  * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
26699  * but with all dynamically-allocated buffers duplicated in new buffers.
26700  */
26701 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
26702
26703 /**
26704  * Creates a new CResult_ReceiveTlvsDecodeErrorZ in the success state.
26705  */
26706 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_ok(struct LDKReceiveTlvs o);
26707
26708 /**
26709  * Creates a new CResult_ReceiveTlvsDecodeErrorZ in the error state.
26710  */
26711 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_err(struct LDKDecodeError e);
26712
26713 /**
26714  * Checks if the given object is currently in the success state
26715  */
26716 bool CResult_ReceiveTlvsDecodeErrorZ_is_ok(const struct LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR o);
26717
26718 /**
26719  * Frees any resources used by the CResult_ReceiveTlvsDecodeErrorZ.
26720  */
26721 void CResult_ReceiveTlvsDecodeErrorZ_free(struct LDKCResult_ReceiveTlvsDecodeErrorZ _res);
26722
26723 /**
26724  * Creates a new CResult_ReceiveTlvsDecodeErrorZ which has the same data as `orig`
26725  * but with all dynamically-allocated buffers duplicated in new buffers.
26726  */
26727 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_clone(const struct LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR orig);
26728
26729 /**
26730  * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
26731  */
26732 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
26733
26734 /**
26735  * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
26736  */
26737 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
26738
26739 /**
26740  * Checks if the given object is currently in the success state
26741  */
26742 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
26743
26744 /**
26745  * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
26746  */
26747 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
26748
26749 /**
26750  * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
26751  * but with all dynamically-allocated buffers duplicated in new buffers.
26752  */
26753 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
26754
26755 /**
26756  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
26757  */
26758 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
26759
26760 /**
26761  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
26762  */
26763 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
26764
26765 /**
26766  * Checks if the given object is currently in the success state
26767  */
26768 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
26769
26770 /**
26771  * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
26772  */
26773 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
26774
26775 /**
26776  * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
26777  * but with all dynamically-allocated buffers duplicated in new buffers.
26778  */
26779 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
26780
26781 /**
26782  * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the success state.
26783  */
26784 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
26785
26786 /**
26787  * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the error state.
26788  */
26789 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_err(struct LDKPaymentError e);
26790
26791 /**
26792  * Checks if the given object is currently in the success state
26793  */
26794 bool CResult_ThirtyTwoBytesPaymentErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR o);
26795
26796 /**
26797  * Frees any resources used by the CResult_ThirtyTwoBytesPaymentErrorZ.
26798  */
26799 void CResult_ThirtyTwoBytesPaymentErrorZ_free(struct LDKCResult_ThirtyTwoBytesPaymentErrorZ _res);
26800
26801 /**
26802  * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ which has the same data as `orig`
26803  * but with all dynamically-allocated buffers duplicated in new buffers.
26804  */
26805 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR orig);
26806
26807 /**
26808  * Creates a new CResult_NonePaymentErrorZ in the success state.
26809  */
26810 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void);
26811
26812 /**
26813  * Creates a new CResult_NonePaymentErrorZ in the error state.
26814  */
26815 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e);
26816
26817 /**
26818  * Checks if the given object is currently in the success state
26819  */
26820 bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o);
26821
26822 /**
26823  * Frees any resources used by the CResult_NonePaymentErrorZ.
26824  */
26825 void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res);
26826
26827 /**
26828  * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig`
26829  * but with all dynamically-allocated buffers duplicated in new buffers.
26830  */
26831 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig);
26832
26833 /**
26834  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ in the success state.
26835  */
26836 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
26837
26838 /**
26839  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ in the error state.
26840  */
26841 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_err(struct LDKProbingError e);
26842
26843 /**
26844  * Checks if the given object is currently in the success state
26845  */
26846 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR o);
26847
26848 /**
26849  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ.
26850  */
26851 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ _res);
26852
26853 /**
26854  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ which has the same data as `orig`
26855  * but with all dynamically-allocated buffers duplicated in new buffers.
26856  */
26857 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR orig);
26858
26859 /**
26860  * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
26861  */
26862 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
26863
26864 /**
26865  * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
26866  */
26867 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
26868
26869 /**
26870  * Checks if the given object is currently in the success state
26871  */
26872 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
26873
26874 /**
26875  * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
26876  */
26877 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
26878
26879 /**
26880  * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
26881  * but with all dynamically-allocated buffers duplicated in new buffers.
26882  */
26883 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
26884
26885 /**
26886  * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
26887  */
26888 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
26889
26890 /**
26891  * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
26892  */
26893 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
26894
26895 /**
26896  * Checks if the given object is currently in the success state
26897  */
26898 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
26899
26900 /**
26901  * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
26902  */
26903 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
26904
26905 /**
26906  * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
26907  * but with all dynamically-allocated buffers duplicated in new buffers.
26908  */
26909 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
26910
26911 /**
26912  * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26913  */
26914 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26915
26916 /**
26917  * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26918  */
26919 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26920
26921 /**
26922  * Checks if the given object is currently in the success state
26923  */
26924 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26925
26926 /**
26927  * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26928  */
26929 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26930
26931 /**
26932  * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26933  * but with all dynamically-allocated buffers duplicated in new buffers.
26934  */
26935 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26936
26937 /**
26938  * Creates a new tuple which has the same data as `orig`
26939  * but with all dynamically-allocated buffers duplicated in new buffers.
26940  */
26941 struct LDKC2Tuple_PublicKeyOnionMessageZ C2Tuple_PublicKeyOnionMessageZ_clone(const struct LDKC2Tuple_PublicKeyOnionMessageZ *NONNULL_PTR orig);
26942
26943 /**
26944  * Creates a new C2Tuple_PublicKeyOnionMessageZ from the contained elements.
26945  */
26946 struct LDKC2Tuple_PublicKeyOnionMessageZ C2Tuple_PublicKeyOnionMessageZ_new(struct LDKPublicKey a, struct LDKOnionMessage b);
26947
26948 /**
26949  * Frees any resources used by the C2Tuple_PublicKeyOnionMessageZ.
26950  */
26951 void C2Tuple_PublicKeyOnionMessageZ_free(struct LDKC2Tuple_PublicKeyOnionMessageZ _res);
26952
26953 /**
26954  * Creates a new CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ in the success state.
26955  */
26956 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_ok(struct LDKC2Tuple_PublicKeyOnionMessageZ o);
26957
26958 /**
26959  * Creates a new CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ in the error state.
26960  */
26961 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_err(struct LDKSendError e);
26962
26963 /**
26964  * Checks if the given object is currently in the success state
26965  */
26966 bool CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_is_ok(const struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ *NONNULL_PTR o);
26967
26968 /**
26969  * Frees any resources used by the CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ.
26970  */
26971 void CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_free(struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ _res);
26972
26973 /**
26974  * Creates a new CResult_PeeledOnionNoneZ in the success state.
26975  */
26976 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
26977
26978 /**
26979  * Creates a new CResult_PeeledOnionNoneZ in the error state.
26980  */
26981 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
26982
26983 /**
26984  * Checks if the given object is currently in the success state
26985  */
26986 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
26987
26988 /**
26989  * Frees any resources used by the CResult_PeeledOnionNoneZ.
26990  */
26991 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
26992
26993 /**
26994  * Creates a new CResult_NoneSendErrorZ in the success state.
26995  */
26996 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
26997
26998 /**
26999  * Creates a new CResult_NoneSendErrorZ in the error state.
27000  */
27001 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
27002
27003 /**
27004  * Checks if the given object is currently in the success state
27005  */
27006 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
27007
27008 /**
27009  * Frees any resources used by the CResult_NoneSendErrorZ.
27010  */
27011 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
27012
27013 /**
27014  * Creates a new CResult_BlindedPathNoneZ in the success state.
27015  */
27016 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
27017
27018 /**
27019  * Creates a new CResult_BlindedPathNoneZ in the error state.
27020  */
27021 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
27022
27023 /**
27024  * Checks if the given object is currently in the success state
27025  */
27026 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
27027
27028 /**
27029  * Frees any resources used by the CResult_BlindedPathNoneZ.
27030  */
27031 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
27032
27033 /**
27034  * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
27035  * but with all dynamically-allocated buffers duplicated in new buffers.
27036  */
27037 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
27038
27039 /**
27040  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
27041  */
27042 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
27043
27044 /**
27045  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
27046  */
27047 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
27048
27049 /**
27050  * Checks if the given object is currently in the success state
27051  */
27052 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
27053
27054 /**
27055  * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
27056  */
27057 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
27058
27059 /**
27060  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
27061  * but with all dynamically-allocated buffers duplicated in new buffers.
27062  */
27063 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
27064
27065 /**
27066  * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
27067  */
27068 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
27069
27070 /**
27071  * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
27072  */
27073 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
27074
27075 /**
27076  * Checks if the given object is currently in the success state
27077  */
27078 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
27079
27080 /**
27081  * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
27082  */
27083 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
27084
27085 /**
27086  * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
27087  * but with all dynamically-allocated buffers duplicated in new buffers.
27088  */
27089 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
27090
27091 /**
27092  * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
27093  */
27094 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
27095
27096 /**
27097  * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
27098  */
27099 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
27100
27101 /**
27102  * Checks if the given object is currently in the success state
27103  */
27104 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
27105
27106 /**
27107  * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
27108  */
27109 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
27110
27111 /**
27112  * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
27113  * but with all dynamically-allocated buffers duplicated in new buffers.
27114  */
27115 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
27116
27117 /**
27118  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
27119  */
27120 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
27121
27122 /**
27123  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
27124  */
27125 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
27126
27127 /**
27128  * Checks if the given object is currently in the success state
27129  */
27130 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
27131
27132 /**
27133  * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
27134  */
27135 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
27136
27137 /**
27138  * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
27139  * but with all dynamically-allocated buffers duplicated in new buffers.
27140  */
27141 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
27142
27143 /**
27144  * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
27145  */
27146 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
27147
27148 /**
27149  * Constructs a new COption_FilterZ containing nothing
27150  */
27151 struct LDKCOption_FilterZ COption_FilterZ_none(void);
27152
27153 /**
27154  * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
27155  */
27156 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
27157
27158 /**
27159  * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
27160  */
27161 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
27162
27163 /**
27164  * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
27165  */
27166 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
27167
27168 /**
27169  * Checks if the given object is currently in the success state
27170  */
27171 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
27172
27173 /**
27174  * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
27175  */
27176 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
27177
27178 /**
27179  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27180  */
27181 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
27182
27183 /**
27184  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27185  */
27186 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
27187
27188 /**
27189  * Creates a new tuple which has the same data as `orig`
27190  * but with all dynamically-allocated buffers duplicated in new buffers.
27191  */
27192 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
27193
27194 /**
27195  * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
27196  */
27197 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
27198
27199 /**
27200  * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
27201  */
27202 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
27203
27204 /**
27205  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27206  */
27207 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
27208
27209 /**
27210  * Frees any resources used by the APIError
27211  */
27212 void APIError_free(struct LDKAPIError this_ptr);
27213
27214 /**
27215  * Creates a copy of the APIError
27216  */
27217 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
27218
27219 /**
27220  * Utility method to constructs a new APIMisuseError-variant APIError
27221  */
27222 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
27223
27224 /**
27225  * Utility method to constructs a new FeeRateTooHigh-variant APIError
27226  */
27227 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
27228
27229 /**
27230  * Utility method to constructs a new InvalidRoute-variant APIError
27231  */
27232 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
27233
27234 /**
27235  * Utility method to constructs a new ChannelUnavailable-variant APIError
27236  */
27237 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
27238
27239 /**
27240  * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
27241  */
27242 struct LDKAPIError APIError_monitor_update_in_progress(void);
27243
27244 /**
27245  * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
27246  */
27247 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
27248
27249 /**
27250  * Checks if two APIErrors contain equal inner contents.
27251  * This ignores pointers and is_owned flags and looks at the values in fields.
27252  */
27253 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
27254
27255 /**
27256  * Serialize the APIError object into a byte array which can be read by APIError_read
27257  */
27258 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
27259
27260 /**
27261  * Read a APIError from a byte array, created by APIError_write
27262  */
27263 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
27264
27265 /**
27266  * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
27267  */
27268 void BigSize_free(struct LDKBigSize this_obj);
27269
27270 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
27271
27272 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
27273
27274 /**
27275  * Constructs a new BigSize given each field
27276  */
27277 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
27278
27279 /**
27280  * Creates a copy of the BigSize
27281  */
27282 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
27283
27284 /**
27285  * Generates a non-cryptographic 64-bit hash of the BigSize.
27286  */
27287 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
27288
27289 /**
27290  * Checks if two BigSizes contain equal inner contents.
27291  * This ignores pointers and is_owned flags and looks at the values in fields.
27292  * Two objects with NULL inner values will be considered "equal" here.
27293  */
27294 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
27295
27296 /**
27297  * Serialize the BigSize object into a byte array which can be read by BigSize_read
27298  */
27299 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
27300
27301 /**
27302  * Read a BigSize from a byte array, created by BigSize_write
27303  */
27304 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
27305
27306 /**
27307  * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
27308  */
27309 void Hostname_free(struct LDKHostname this_obj);
27310
27311 /**
27312  * Creates a copy of the Hostname
27313  */
27314 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
27315
27316 /**
27317  * Checks if two Hostnames contain equal inner contents.
27318  * This ignores pointers and is_owned flags and looks at the values in fields.
27319  * Two objects with NULL inner values will be considered "equal" here.
27320  */
27321 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
27322
27323 /**
27324  * Returns the length of the hostname.
27325  */
27326 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
27327
27328 /**
27329  * Serialize the Hostname object into a byte array which can be read by Hostname_read
27330  */
27331 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
27332
27333 /**
27334  * Read a Hostname from a byte array, created by Hostname_write
27335  */
27336 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
27337
27338 /**
27339  * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
27340  */
27341 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
27342
27343 /**
27344  * Creates a copy of the TransactionU16LenLimited
27345  */
27346 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
27347
27348 /**
27349  * Checks if two TransactionU16LenLimiteds contain equal inner contents.
27350  * This ignores pointers and is_owned flags and looks at the values in fields.
27351  * Two objects with NULL inner values will be considered "equal" here.
27352  */
27353 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
27354
27355 /**
27356  * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
27357  * serialized length is <= u16::MAX.
27358  */
27359 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
27360
27361 /**
27362  * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
27363  */
27364 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
27365
27366 /**
27367  * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
27368  */
27369 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
27370
27371 /**
27372  * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
27373  */
27374 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
27375
27376 /**
27377  * Creates a digital signature of a message given a SecretKey, like the node's secret.
27378  * A receiver knowing the PublicKey (e.g. the node's id) and the message can be sure that the signature was generated by the caller.
27379  * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
27380  */
27381 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
27382
27383 /**
27384  * Recovers the PublicKey of the signer of the message given the message and the signature.
27385  */
27386 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
27387
27388 /**
27389  * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
27390  * and the PublicKey.
27391  */
27392 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
27393
27394 /**
27395  * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
27396  */
27397 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
27398
27399 /**
27400  * Calls the free function if one is set
27401  */
27402 void KVStore_free(struct LDKKVStore this_ptr);
27403
27404 /**
27405  * Calls the free function if one is set
27406  */
27407 void Persister_free(struct LDKPersister this_ptr);
27408
27409 /**
27410  * Read previously persisted [`ChannelMonitor`]s from the store.
27411  */
27412 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
27413
27414 /**
27415  * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
27416  */
27417 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
27418
27419 /**
27420  * Constructs a new [`MonitorUpdatingPersister`].
27421  *
27422  * The `maximum_pending_updates` parameter controls how many updates may be stored before a
27423  * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
27424  * consolidation will frequently occur with fewer updates than what you set here; this number
27425  * is merely the maximum that may be stored. When setting this value, consider that for higher
27426  * values of `maximum_pending_updates`:
27427  *
27428  *   - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
27429  * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
27430  * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
27431  *   - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
27432  * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
27433  * less frequent \"waves.\"
27434  *   - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
27435  * [`MonitorUpdatingPersister::cleanup_stale_updates`].
27436  */
27437 MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(struct LDKKVStore kv_store, struct LDKLogger logger, uint64_t maximum_pending_updates, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
27438
27439 /**
27440  * Reads all stored channel monitors, along with any stored updates for them.
27441  *
27442  * It is extremely important that your [`KVStore::read`] implementation uses the
27443  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
27444  * documentation for [`MonitorUpdatingPersister`].
27445  */
27446 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator);
27447
27448 /**
27449  * Read a single channel monitor, along with any stored updates for it.
27450  *
27451  * It is extremely important that your [`KVStore::read`] implementation uses the
27452  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
27453  * documentation for [`MonitorUpdatingPersister`].
27454  *
27455  * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
27456  * [`OutPoint`], with an underscore `_` between them. For example, given:
27457  *
27458  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
27459  *   - Index: `1`
27460  *
27461  * The correct `monitor_key` would be:
27462  * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
27463  *
27464  * Loading a large number of monitors will be faster if done in parallel. You can use this
27465  * function to accomplish this. Take care to limit the number of parallel readers.
27466  */
27467 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, struct LDKStr monitor_key);
27468
27469 /**
27470  * Cleans up stale updates for all monitors.
27471  *
27472  * This function works by first listing all monitors, and then for each of them, listing all
27473  * updates. The updates that have an `update_id` less than or equal to than the stored monitor
27474  * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
27475  * be passed to [`KVStore::remove`].
27476  */
27477 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
27478
27479 /**
27480  * Constructs a new Persist which calls the relevant methods on this_arg.
27481  * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
27482  */
27483 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
27484
27485 /**
27486  * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
27487  */
27488 void UntrustedString_free(struct LDKUntrustedString this_obj);
27489
27490 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
27491
27492 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
27493
27494 /**
27495  * Constructs a new UntrustedString given each field
27496  */
27497 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
27498
27499 /**
27500  * Creates a copy of the UntrustedString
27501  */
27502 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
27503
27504 /**
27505  * Checks if two UntrustedStrings contain equal inner contents.
27506  * This ignores pointers and is_owned flags and looks at the values in fields.
27507  * Two objects with NULL inner values will be considered "equal" here.
27508  */
27509 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
27510
27511 /**
27512  * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
27513  */
27514 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
27515
27516 /**
27517  * Read a UntrustedString from a byte array, created by UntrustedString_write
27518  */
27519 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
27520
27521 /**
27522  * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
27523  */
27524 void PrintableString_free(struct LDKPrintableString this_obj);
27525
27526 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
27527
27528 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
27529
27530 /**
27531  * Constructs a new PrintableString given each field
27532  */
27533 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
27534
27535 /**
27536  * Calls the free function if one is set
27537  */
27538 void FutureCallback_free(struct LDKFutureCallback this_ptr);
27539
27540 /**
27541  * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
27542  */
27543 void Future_free(struct LDKFuture this_obj);
27544
27545 /**
27546  * Creates a copy of the Future
27547  */
27548 struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig);
27549
27550 /**
27551  * Registers a callback to be called upon completion of this future. If the future has already
27552  * completed, the callback will be called immediately.
27553  */
27554 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
27555
27556 /**
27557  * Waits until this [`Future`] completes.
27558  */
27559 void Future_wait(struct LDKFuture this_arg);
27560
27561 /**
27562  * Waits until this [`Future`] completes or the given amount of time has elapsed.
27563  *
27564  * Returns true if the [`Future`] completed, false if the time elapsed.
27565  */
27566 MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait);
27567
27568 /**
27569  * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
27570  */
27571 void Sleeper_free(struct LDKSleeper this_obj);
27572
27573 /**
27574  * Constructs a new sleeper from one future, allowing blocking on it.
27575  */
27576 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future);
27577
27578 /**
27579  * Constructs a new sleeper from two futures, allowing blocking on both at once.
27580  */
27581 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b);
27582
27583 /**
27584  * Constructs a new sleeper on many futures, allowing blocking on all at once.
27585  */
27586 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
27587
27588 /**
27589  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
27590  */
27591 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
27592
27593 /**
27594  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
27595  * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
27596  * elapsed.
27597  */
27598 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
27599
27600 /**
27601  * Creates a copy of the Level
27602  */
27603 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
27604
27605 /**
27606  * Utility method to constructs a new Gossip-variant Level
27607  */
27608 enum LDKLevel Level_gossip(void);
27609
27610 /**
27611  * Utility method to constructs a new Trace-variant Level
27612  */
27613 enum LDKLevel Level_trace(void);
27614
27615 /**
27616  * Utility method to constructs a new Debug-variant Level
27617  */
27618 enum LDKLevel Level_debug(void);
27619
27620 /**
27621  * Utility method to constructs a new Info-variant Level
27622  */
27623 enum LDKLevel Level_info(void);
27624
27625 /**
27626  * Utility method to constructs a new Warn-variant Level
27627  */
27628 enum LDKLevel Level_warn(void);
27629
27630 /**
27631  * Utility method to constructs a new Error-variant Level
27632  */
27633 enum LDKLevel Level_error(void);
27634
27635 /**
27636  * Checks if two Levels contain equal inner contents.
27637  * This ignores pointers and is_owned flags and looks at the values in fields.
27638  */
27639 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
27640
27641 /**
27642  * Generates a non-cryptographic 64-bit hash of the Level.
27643  */
27644 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
27645
27646 /**
27647  * Returns the most verbose logging level.
27648  */
27649 MUST_USE_RES enum LDKLevel Level_max(void);
27650
27651 /**
27652  * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
27653  */
27654 void Record_free(struct LDKRecord this_obj);
27655
27656 /**
27657  * The verbosity level of the message.
27658  */
27659 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
27660
27661 /**
27662  * The verbosity level of the message.
27663  */
27664 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
27665
27666 /**
27667  * The message body.
27668  */
27669 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
27670
27671 /**
27672  * The message body.
27673  */
27674 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27675
27676 /**
27677  * The module path of the message.
27678  */
27679 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
27680
27681 /**
27682  * The module path of the message.
27683  */
27684 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27685
27686 /**
27687  * The source file containing the message.
27688  */
27689 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
27690
27691 /**
27692  * The source file containing the message.
27693  */
27694 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27695
27696 /**
27697  * The line containing the message.
27698  */
27699 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
27700
27701 /**
27702  * The line containing the message.
27703  */
27704 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
27705
27706 /**
27707  * Creates a copy of the Record
27708  */
27709 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
27710
27711 /**
27712  * Calls the free function if one is set
27713  */
27714 void Logger_free(struct LDKLogger this_ptr);
27715
27716 /**
27717  * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
27718  */
27719 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
27720
27721 /**
27722  * Confirmations we will wait for before considering the channel locked in.
27723  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
27724  * equivalent limit applied to outbound channels).
27725  *
27726  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
27727  * transaction before operation. If you wish to accept channels with zero confirmations, see
27728  * [`UserConfig::manually_accept_inbound_channels`] and
27729  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
27730  *
27731  * Default value: 6.
27732  *
27733  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27734  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
27735  */
27736 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27737
27738 /**
27739  * Confirmations we will wait for before considering the channel locked in.
27740  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
27741  * equivalent limit applied to outbound channels).
27742  *
27743  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
27744  * transaction before operation. If you wish to accept channels with zero confirmations, see
27745  * [`UserConfig::manually_accept_inbound_channels`] and
27746  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
27747  *
27748  * Default value: 6.
27749  *
27750  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27751  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
27752  */
27753 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
27754
27755 /**
27756  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
27757  * the number of blocks we have to punish our counterparty if they broadcast a revoked
27758  * transaction).
27759  *
27760  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
27761  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
27762  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
27763  * possibly with time in between to RBF the spending transaction).
27764  *
27765  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
27766  * case of an honest unilateral channel close, which implicitly decrease the economic value of
27767  * our channel.
27768  *
27769  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
27770  * can tweak config to ask for more security, not less.
27771  */
27772 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27773
27774 /**
27775  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
27776  * the number of blocks we have to punish our counterparty if they broadcast a revoked
27777  * transaction).
27778  *
27779  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
27780  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
27781  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
27782  * possibly with time in between to RBF the spending transaction).
27783  *
27784  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
27785  * case of an honest unilateral channel close, which implicitly decrease the economic value of
27786  * our channel.
27787  *
27788  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
27789  * can tweak config to ask for more security, not less.
27790  */
27791 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
27792
27793 /**
27794  * Set to the smallest value HTLC we will accept to process.
27795  *
27796  * This value is sent to our counterparty on channel-open and we close the channel any time
27797  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
27798  *
27799  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
27800  * by the protocol.
27801  */
27802 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27803
27804 /**
27805  * Set to the smallest value HTLC we will accept to process.
27806  *
27807  * This value is sent to our counterparty on channel-open and we close the channel any time
27808  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
27809  *
27810  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
27811  * by the protocol.
27812  */
27813 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
27814
27815 /**
27816  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
27817  * HTLCs to.
27818  *
27819  * This can be set to a value between 1-100, where the value corresponds to the percent of the
27820  * channel value in whole percentages.
27821  *
27822  * Note that:
27823  * * If configured to another value than the default value 10, any new channels created with
27824  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
27825  * `ChannelManager`.
27826  *
27827  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
27828  * no way to configure the cap for the total value of outbound HTLCs in-flight.
27829  *
27830  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
27831  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
27832  * restrict exposure to loss due to being offline for too long.
27833  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
27834  * for more information.
27835  *
27836  * Default value: 10.
27837  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
27838  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
27839  */
27840 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27841
27842 /**
27843  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
27844  * HTLCs to.
27845  *
27846  * This can be set to a value between 1-100, where the value corresponds to the percent of the
27847  * channel value in whole percentages.
27848  *
27849  * Note that:
27850  * * If configured to another value than the default value 10, any new channels created with
27851  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
27852  * `ChannelManager`.
27853  *
27854  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
27855  * no way to configure the cap for the total value of outbound HTLCs in-flight.
27856  *
27857  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
27858  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
27859  * restrict exposure to loss due to being offline for too long.
27860  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
27861  * for more information.
27862  *
27863  * Default value: 10.
27864  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
27865  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
27866  */
27867 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
27868
27869 /**
27870  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
27871  * BOLTs) option for outbound private channels. This provides better privacy by not including
27872  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
27873  * relay HTLCs to us using the channel's SCID alias.
27874  *
27875  * If this option is set, channels may be created that will not be readable by LDK versions
27876  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
27877  * [`DecodeError::InvalidValue`].
27878  *
27879  * Note that setting this to true does *not* prevent us from opening channels with
27880  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
27881  * private channel without that option.
27882  *
27883  * Ignored if the channel is negotiated to be announced, see
27884  * [`ChannelHandshakeConfig::announced_channel`] and
27885  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
27886  *
27887  * Default value: false. This value is likely to change to true in the future.
27888  *
27889  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27890  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27891  */
27892 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27893
27894 /**
27895  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
27896  * BOLTs) option for outbound private channels. This provides better privacy by not including
27897  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
27898  * relay HTLCs to us using the channel's SCID alias.
27899  *
27900  * If this option is set, channels may be created that will not be readable by LDK versions
27901  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
27902  * [`DecodeError::InvalidValue`].
27903  *
27904  * Note that setting this to true does *not* prevent us from opening channels with
27905  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
27906  * private channel without that option.
27907  *
27908  * Ignored if the channel is negotiated to be announced, see
27909  * [`ChannelHandshakeConfig::announced_channel`] and
27910  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
27911  *
27912  * Default value: false. This value is likely to change to true in the future.
27913  *
27914  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27915  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27916  */
27917 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27918
27919 /**
27920  * Set to announce the channel publicly and notify all nodes that they can route via this
27921  * channel.
27922  *
27923  * This should only be set to true for nodes which expect to be online reliably.
27924  *
27925  * As the node which funds a channel picks this value this will only apply for new outbound
27926  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
27927  *
27928  * Default value: false.
27929  */
27930 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27931
27932 /**
27933  * Set to announce the channel publicly and notify all nodes that they can route via this
27934  * channel.
27935  *
27936  * This should only be set to true for nodes which expect to be online reliably.
27937  *
27938  * As the node which funds a channel picks this value this will only apply for new outbound
27939  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
27940  *
27941  * Default value: false.
27942  */
27943 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27944
27945 /**
27946  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
27947  * supports it, they will then enforce the mutual-close output to us matches what we provided
27948  * at intialization, preventing us from closing to an alternate pubkey.
27949  *
27950  * This is set to true by default to provide a slight increase in security, though ultimately
27951  * any attacker who is able to take control of a channel can just as easily send the funds via
27952  * lightning payments, so we never require that our counterparties support this option.
27953  *
27954  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
27955  *
27956  * Default value: true.
27957  *
27958  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
27959  */
27960 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27961
27962 /**
27963  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
27964  * supports it, they will then enforce the mutual-close output to us matches what we provided
27965  * at intialization, preventing us from closing to an alternate pubkey.
27966  *
27967  * This is set to true by default to provide a slight increase in security, though ultimately
27968  * any attacker who is able to take control of a channel can just as easily send the funds via
27969  * lightning payments, so we never require that our counterparties support this option.
27970  *
27971  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
27972  *
27973  * Default value: true.
27974  *
27975  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
27976  */
27977 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27978
27979 /**
27980  * The Proportion of the channel value to configure as counterparty's channel reserve,
27981  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
27982  *
27983  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
27984  * on their side, at all times.
27985  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
27986  * claiming at least this value on chain.
27987  *
27988  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
27989  * amount can never be used for payments.
27990  * Also, if our selected channel reserve for counterparty and counterparty's selected
27991  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
27992  * will fail.
27993  *
27994  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
27995  * other than the default value.
27996  *
27997  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
27998  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
27999  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
28000  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
28001  *                instead, although channel negotiations will fail in that case.
28002  */
28003 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
28004
28005 /**
28006  * The Proportion of the channel value to configure as counterparty's channel reserve,
28007  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
28008  *
28009  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
28010  * on their side, at all times.
28011  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
28012  * claiming at least this value on chain.
28013  *
28014  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
28015  * amount can never be used for payments.
28016  * Also, if our selected channel reserve for counterparty and counterparty's selected
28017  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
28018  * will fail.
28019  *
28020  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
28021  * other than the default value.
28022  *
28023  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
28024  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
28025  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
28026  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
28027  *                instead, although channel negotiations will fail in that case.
28028  */
28029 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
28030
28031 /**
28032  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
28033  * channels. This feature requires having a reserve of onchain funds readily available to bump
28034  * transactions in the event of a channel force close to avoid the possibility of losing funds.
28035  *
28036  * Note that if you wish accept inbound channels with anchor outputs, you must enable
28037  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
28038  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
28039  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
28040  * channels featuring anchor outputs in the event of a force close.
28041  *
28042  * If this option is set, channels may be created that will not be readable by LDK versions
28043  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
28044  * [`DecodeError::InvalidValue`].
28045  *
28046  * Note that setting this to true does *not* prevent us from opening channels with
28047  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
28048  * fall back to a `static_remote_key` channel.
28049  *
28050  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
28051  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
28052  * Considered Harmful`] mailing list post.
28053  *
28054  * Default value: false. This value is likely to change to true in the future.
28055  *
28056  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28057  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
28058  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
28059  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
28060  */
28061 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
28062
28063 /**
28064  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
28065  * channels. This feature requires having a reserve of onchain funds readily available to bump
28066  * transactions in the event of a channel force close to avoid the possibility of losing funds.
28067  *
28068  * Note that if you wish accept inbound channels with anchor outputs, you must enable
28069  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
28070  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
28071  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
28072  * channels featuring anchor outputs in the event of a force close.
28073  *
28074  * If this option is set, channels may be created that will not be readable by LDK versions
28075  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
28076  * [`DecodeError::InvalidValue`].
28077  *
28078  * Note that setting this to true does *not* prevent us from opening channels with
28079  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
28080  * fall back to a `static_remote_key` channel.
28081  *
28082  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
28083  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
28084  * Considered Harmful`] mailing list post.
28085  *
28086  * Default value: false. This value is likely to change to true in the future.
28087  *
28088  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28089  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
28090  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
28091  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
28092  */
28093 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
28094
28095 /**
28096  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
28097  *
28098  * Increasing the value can help improve liquidity and stability in
28099  * routing at the cost of higher long term disk / DB usage.
28100  *
28101  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
28102  * other than the default value.
28103  *
28104  * Default value: 50
28105  * Maximum value: 483, any values larger will be treated as 483.
28106  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
28107  */
28108 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
28109
28110 /**
28111  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
28112  *
28113  * Increasing the value can help improve liquidity and stability in
28114  * routing at the cost of higher long term disk / DB usage.
28115  *
28116  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
28117  * other than the default value.
28118  *
28119  * Default value: 50
28120  * Maximum value: 483, any values larger will be treated as 483.
28121  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
28122  */
28123 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
28124
28125 /**
28126  * Constructs a new ChannelHandshakeConfig given each field
28127  */
28128 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg);
28129
28130 /**
28131  * Creates a copy of the ChannelHandshakeConfig
28132  */
28133 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
28134
28135 /**
28136  * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
28137  */
28138 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
28139
28140 /**
28141  * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
28142  */
28143 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
28144
28145 /**
28146  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
28147  * only applies to inbound channels.
28148  *
28149  * Default value: 0.
28150  */
28151 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28152
28153 /**
28154  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
28155  * only applies to inbound channels.
28156  *
28157  * Default value: 0.
28158  */
28159 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28160
28161 /**
28162  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
28163  * only applies to inbound channels.
28164  *
28165  * Default value: 2^24 - 1.
28166  */
28167 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28168
28169 /**
28170  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
28171  * only applies to inbound channels.
28172  *
28173  * Default value: 2^24 - 1.
28174  */
28175 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28176
28177 /**
28178  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
28179  * you to limit the maximum minimum-size they can require.
28180  *
28181  * Default value: u64::max_value.
28182  */
28183 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28184
28185 /**
28186  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
28187  * you to limit the maximum minimum-size they can require.
28188  *
28189  * Default value: u64::max_value.
28190  */
28191 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28192
28193 /**
28194  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
28195  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
28196  *
28197  * Default value: 0.
28198  */
28199 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28200
28201 /**
28202  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
28203  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
28204  *
28205  * Default value: 0.
28206  */
28207 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28208
28209 /**
28210  * The remote node will require we keep a certain amount in direct payment to ourselves at all
28211  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
28212  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
28213  *
28214  * Default value: u64::max_value.
28215  */
28216 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28217
28218 /**
28219  * The remote node will require we keep a certain amount in direct payment to ourselves at all
28220  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
28221  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
28222  *
28223  * Default value: u64::max_value.
28224  */
28225 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28226
28227 /**
28228  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
28229  * time. This allows you to set a minimum such value.
28230  *
28231  * Default value: 0.
28232  */
28233 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28234
28235 /**
28236  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
28237  * time. This allows you to set a minimum such value.
28238  *
28239  * Default value: 0.
28240  */
28241 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
28242
28243 /**
28244  * Before a channel is usable the funding transaction will need to be confirmed by at least a
28245  * certain number of blocks, specified by the node which is not the funder (as the funder can
28246  * assume they aren't going to double-spend themselves).
28247  * This config allows you to set a limit on the maximum amount of time to wait.
28248  *
28249  * Default value: 144, or roughly one day and only applies to outbound channels.
28250  */
28251 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28252
28253 /**
28254  * Before a channel is usable the funding transaction will need to be confirmed by at least a
28255  * certain number of blocks, specified by the node which is not the funder (as the funder can
28256  * assume they aren't going to double-spend themselves).
28257  * This config allows you to set a limit on the maximum amount of time to wait.
28258  *
28259  * Default value: 144, or roughly one day and only applies to outbound channels.
28260  */
28261 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
28262
28263 /**
28264  * Whether we implicitly trust funding transactions generated by us for our own outbound
28265  * channels to not be double-spent.
28266  *
28267  * If this is set, we assume that our own funding transactions are *never* double-spent, and
28268  * thus we can trust them without any confirmations. This is generally a reasonable
28269  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
28270  * control of the signing keys).
28271  *
28272  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
28273  * double-spend the funding transaction to RBF with an alternative channel open.
28274  *
28275  * This only applies if our counterparty set their confirmations-required value to 0, and we
28276  * always trust our own funding transaction at 1 confirmation irrespective of this value.
28277  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
28278  * `true` (0) and `false` (1).
28279  *
28280  * Default value: true
28281  */
28282 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28283
28284 /**
28285  * Whether we implicitly trust funding transactions generated by us for our own outbound
28286  * channels to not be double-spent.
28287  *
28288  * If this is set, we assume that our own funding transactions are *never* double-spent, and
28289  * thus we can trust them without any confirmations. This is generally a reasonable
28290  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
28291  * control of the signing keys).
28292  *
28293  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
28294  * double-spend the funding transaction to RBF with an alternative channel open.
28295  *
28296  * This only applies if our counterparty set their confirmations-required value to 0, and we
28297  * always trust our own funding transaction at 1 confirmation irrespective of this value.
28298  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
28299  * `true` (0) and `false` (1).
28300  *
28301  * Default value: true
28302  */
28303 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
28304
28305 /**
28306  * Set to force an incoming channel to match our announced channel preference in
28307  * [`ChannelHandshakeConfig::announced_channel`].
28308  *
28309  * For a node which is not online reliably, this should be set to true and
28310  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
28311  * channels will ever be opened.
28312  *
28313  * Default value: true.
28314  */
28315 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28316
28317 /**
28318  * Set to force an incoming channel to match our announced channel preference in
28319  * [`ChannelHandshakeConfig::announced_channel`].
28320  *
28321  * For a node which is not online reliably, this should be set to true and
28322  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
28323  * channels will ever be opened.
28324  *
28325  * Default value: true.
28326  */
28327 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
28328
28329 /**
28330  * Set to the amount of time we're willing to wait to claim money back to us.
28331  *
28332  * Not checking this value would be a security issue, as our peer would be able to set it to
28333  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
28334  *
28335  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
28336  * reduce the loss of having useless locked funds (if your peer accepts)
28337  */
28338 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28339
28340 /**
28341  * Set to the amount of time we're willing to wait to claim money back to us.
28342  *
28343  * Not checking this value would be a security issue, as our peer would be able to set it to
28344  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
28345  *
28346  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
28347  * reduce the loss of having useless locked funds (if your peer accepts)
28348  */
28349 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
28350
28351 /**
28352  * Constructs a new ChannelHandshakeLimits given each field
28353  */
28354 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint32_t max_minimum_depth_arg, bool trust_own_funding_0conf_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
28355
28356 /**
28357  * Creates a copy of the ChannelHandshakeLimits
28358  */
28359 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
28360
28361 /**
28362  * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
28363  */
28364 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
28365
28366 /**
28367  * Frees any resources used by the MaxDustHTLCExposure
28368  */
28369 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
28370
28371 /**
28372  * Creates a copy of the MaxDustHTLCExposure
28373  */
28374 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
28375
28376 /**
28377  * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
28378  */
28379 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
28380
28381 /**
28382  * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
28383  */
28384 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
28385
28386 /**
28387  * Checks if two MaxDustHTLCExposures contain equal inner contents.
28388  * This ignores pointers and is_owned flags and looks at the values in fields.
28389  */
28390 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
28391
28392 /**
28393  * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
28394  */
28395 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
28396
28397 /**
28398  * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
28399  */
28400 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
28401
28402 /**
28403  * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
28404  */
28405 void ChannelConfig_free(struct LDKChannelConfig this_obj);
28406
28407 /**
28408  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
28409  * over the channel.
28410  * This may be allowed to change at runtime in a later update, however doing so must result in
28411  * update messages sent to notify all nodes of our updated relay fee.
28412  *
28413  * Default value: 0.
28414  */
28415 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28416
28417 /**
28418  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
28419  * over the channel.
28420  * This may be allowed to change at runtime in a later update, however doing so must result in
28421  * update messages sent to notify all nodes of our updated relay fee.
28422  *
28423  * Default value: 0.
28424  */
28425 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
28426
28427 /**
28428  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
28429  * excess of [`forwarding_fee_proportional_millionths`].
28430  * This may be allowed to change at runtime in a later update, however doing so must result in
28431  * update messages sent to notify all nodes of our updated relay fee.
28432  *
28433  * The default value of a single satoshi roughly matches the market rate on many routing nodes
28434  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
28435  * this node.
28436  *
28437  * Default value: 1000.
28438  *
28439  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28440  */
28441 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28442
28443 /**
28444  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
28445  * excess of [`forwarding_fee_proportional_millionths`].
28446  * This may be allowed to change at runtime in a later update, however doing so must result in
28447  * update messages sent to notify all nodes of our updated relay fee.
28448  *
28449  * The default value of a single satoshi roughly matches the market rate on many routing nodes
28450  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
28451  * this node.
28452  *
28453  * Default value: 1000.
28454  *
28455  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28456  */
28457 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
28458
28459 /**
28460  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
28461  * the channel this config applies to.
28462  *
28463  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
28464  * HTLC balance when a channel appears on-chain whereas
28465  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
28466  * (non-HTLC-encumbered) balance.
28467  *
28468  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
28469  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
28470  * commitment transaction at least once per this many blocks (minus some margin to allow us
28471  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
28472  * the spending transaction).
28473  *
28474  * Default value: 72 (12 hours at an average of 6 blocks/hour).
28475  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
28476  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
28477  *
28478  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
28479  */
28480 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28481
28482 /**
28483  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
28484  * the channel this config applies to.
28485  *
28486  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
28487  * HTLC balance when a channel appears on-chain whereas
28488  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
28489  * (non-HTLC-encumbered) balance.
28490  *
28491  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
28492  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
28493  * commitment transaction at least once per this many blocks (minus some margin to allow us
28494  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
28495  * the spending transaction).
28496  *
28497  * Default value: 72 (12 hours at an average of 6 blocks/hour).
28498  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
28499  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
28500  *
28501  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
28502  */
28503 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
28504
28505 /**
28506  * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
28507  * small to claim on-chain.
28508  *
28509  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
28510  * not be claimable on-chain, instead being turned into additional miner fees if either
28511  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
28512  * to such payments may be sustantial if there are many dust HTLCs present when the
28513  * channel is force-closed.
28514  *
28515  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
28516  * channel negotiated throughout the channel open process, along with the fees required to have
28517  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
28518  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
28519  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
28520  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
28521  * variant is primarily intended for use with pre-anchor channels.
28522  *
28523  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
28524  * exposure across all three types per-channel.
28525  *
28526  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
28527  */
28528 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28529
28530 /**
28531  * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
28532  * small to claim on-chain.
28533  *
28534  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
28535  * not be claimable on-chain, instead being turned into additional miner fees if either
28536  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
28537  * to such payments may be sustantial if there are many dust HTLCs present when the
28538  * channel is force-closed.
28539  *
28540  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
28541  * channel negotiated throughout the channel open process, along with the fees required to have
28542  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
28543  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
28544  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
28545  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
28546  * variant is primarily intended for use with pre-anchor channels.
28547  *
28548  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
28549  * exposure across all three types per-channel.
28550  *
28551  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
28552  */
28553 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
28554
28555 /**
28556  * The additional fee we're willing to pay to avoid waiting for the counterparty's
28557  * `to_self_delay` to reclaim funds.
28558  *
28559  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
28560  * closing transaction which both sides find acceptable, ultimately paid by the channel
28561  * funder/initiator.
28562  *
28563  * When we are the funder, because we have to pay the channel closing fee, we bound the
28564  * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
28565  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
28566  * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
28567  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
28568  * funds.
28569  *
28570  * When we are not the funder, we require the closing transaction fee pay at least our
28571  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
28572  * Thus, this value is ignored when we are not the funder.
28573  *
28574  * Default value: 1000 satoshis.
28575  *
28576  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
28577  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
28578  */
28579 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28580
28581 /**
28582  * The additional fee we're willing to pay to avoid waiting for the counterparty's
28583  * `to_self_delay` to reclaim funds.
28584  *
28585  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
28586  * closing transaction which both sides find acceptable, ultimately paid by the channel
28587  * funder/initiator.
28588  *
28589  * When we are the funder, because we have to pay the channel closing fee, we bound the
28590  * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
28591  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
28592  * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
28593  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
28594  * funds.
28595  *
28596  * When we are not the funder, we require the closing transaction fee pay at least our
28597  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
28598  * Thus, this value is ignored when we are not the funder.
28599  *
28600  * Default value: 1000 satoshis.
28601  *
28602  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
28603  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
28604  */
28605 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
28606
28607 /**
28608  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
28609  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
28610  *
28611  * Usage:
28612  * - The payee will set this option and set its invoice route hints to use [intercept scids]
28613  *   generated by this channel's counterparty.
28614  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
28615  *   [`forward_intercepted_htlc`] with less than the amount provided in
28616  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
28617  *   actual forward amounts is their fee.
28618  *
28619  * # Note
28620  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
28621  * as-expected if this feature is activated, otherwise they may lose money!
28622  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
28623  * counterparty.
28624  *
28625  * # Note
28626  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
28627  * Unsetting this flag between restarts may lead to payment receive failures.
28628  *
28629  * Default value: false.
28630  *
28631  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28632  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
28633  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28634  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
28635  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
28636  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
28637  */
28638 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28639
28640 /**
28641  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
28642  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
28643  *
28644  * Usage:
28645  * - The payee will set this option and set its invoice route hints to use [intercept scids]
28646  *   generated by this channel's counterparty.
28647  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
28648  *   [`forward_intercepted_htlc`] with less than the amount provided in
28649  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
28650  *   actual forward amounts is their fee.
28651  *
28652  * # Note
28653  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
28654  * as-expected if this feature is activated, otherwise they may lose money!
28655  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
28656  * counterparty.
28657  *
28658  * # Note
28659  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
28660  * Unsetting this flag between restarts may lead to payment receive failures.
28661  *
28662  * Default value: false.
28663  *
28664  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28665  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
28666  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28667  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
28668  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
28669  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
28670  */
28671 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
28672
28673 /**
28674  * Constructs a new ChannelConfig given each field
28675  */
28676 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, struct LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg, bool accept_underpaying_htlcs_arg);
28677
28678 /**
28679  * Creates a copy of the ChannelConfig
28680  */
28681 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
28682
28683 /**
28684  * Checks if two ChannelConfigs contain equal inner contents.
28685  * This ignores pointers and is_owned flags and looks at the values in fields.
28686  * Two objects with NULL inner values will be considered "equal" here.
28687  */
28688 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
28689
28690 /**
28691  * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
28692  */
28693 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
28694
28695 /**
28696  * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
28697  */
28698 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
28699
28700 /**
28701  * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
28702  */
28703 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
28704
28705 /**
28706  * Read a ChannelConfig from a byte array, created by ChannelConfig_write
28707  */
28708 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
28709
28710 /**
28711  * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
28712  */
28713 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
28714
28715 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28716
28717 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28718
28719 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28720
28721 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28722
28723 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28724
28725 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
28726
28727 /**
28728  *
28729  * Returns a copy of the field.
28730  */
28731 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28732
28733 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
28734
28735 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28736
28737 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28738
28739 /**
28740  * Constructs a new ChannelConfigUpdate given each field
28741  */
28742 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_new(struct LDKCOption_u32Z forwarding_fee_proportional_millionths_arg, struct LDKCOption_u32Z forwarding_fee_base_msat_arg, struct LDKCOption_u16Z cltv_expiry_delta_arg, struct LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, struct LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg);
28743
28744 /**
28745  * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
28746  */
28747 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
28748
28749 /**
28750  * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
28751  */
28752 void UserConfig_free(struct LDKUserConfig this_obj);
28753
28754 /**
28755  * Channel handshake config that we propose to our counterparty.
28756  */
28757 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28758
28759 /**
28760  * Channel handshake config that we propose to our counterparty.
28761  */
28762 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
28763
28764 /**
28765  * Limits applied to our counterparty's proposed channel handshake config settings.
28766  */
28767 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28768
28769 /**
28770  * Limits applied to our counterparty's proposed channel handshake config settings.
28771  */
28772 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
28773
28774 /**
28775  * Channel config which affects behavior during channel lifetime.
28776  */
28777 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28778
28779 /**
28780  * Channel config which affects behavior during channel lifetime.
28781  */
28782 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
28783
28784 /**
28785  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
28786  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
28787  * node which is not online reliably.
28788  *
28789  * For nodes which are not online reliably, you should set all channels to *not* be announced
28790  * (using [`ChannelHandshakeConfig::announced_channel`] and
28791  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
28792  * ensure you are not exposed to any forwarding risk.
28793  *
28794  * Note that because you cannot change a channel's announced state after creation, there is no
28795  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
28796  * from a publicly-announced forwarding node to a private non-forwarding node you must close
28797  * all your channels and open new ones. For privacy, you should also change your node_id
28798  * (swapping all private and public key material for new ones) at that time.
28799  *
28800  * Default value: false.
28801  */
28802 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28803
28804 /**
28805  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
28806  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
28807  * node which is not online reliably.
28808  *
28809  * For nodes which are not online reliably, you should set all channels to *not* be announced
28810  * (using [`ChannelHandshakeConfig::announced_channel`] and
28811  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
28812  * ensure you are not exposed to any forwarding risk.
28813  *
28814  * Note that because you cannot change a channel's announced state after creation, there is no
28815  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
28816  * from a publicly-announced forwarding node to a private non-forwarding node you must close
28817  * all your channels and open new ones. For privacy, you should also change your node_id
28818  * (swapping all private and public key material for new ones) at that time.
28819  *
28820  * Default value: false.
28821  */
28822 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28823
28824 /**
28825  * If this is set to false, we do not accept inbound requests to open a new channel.
28826  * Default value: true.
28827  */
28828 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28829
28830 /**
28831  * If this is set to false, we do not accept inbound requests to open a new channel.
28832  * Default value: true.
28833  */
28834 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28835
28836 /**
28837  * If this is set to true, the user needs to manually accept inbound requests to open a new
28838  * channel.
28839  *
28840  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
28841  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
28842  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
28843  * user explicitly chooses to accept the request.
28844  *
28845  * Default value: false.
28846  *
28847  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
28848  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
28849  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
28850  */
28851 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28852
28853 /**
28854  * If this is set to true, the user needs to manually accept inbound requests to open a new
28855  * channel.
28856  *
28857  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
28858  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
28859  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
28860  * user explicitly chooses to accept the request.
28861  *
28862  * Default value: false.
28863  *
28864  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
28865  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
28866  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
28867  */
28868 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28869
28870 /**
28871  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
28872  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
28873  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
28874  *
28875  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
28876  *
28877  *  Default value: false.
28878  *
28879  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28880  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28881  */
28882 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28883
28884 /**
28885  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
28886  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
28887  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
28888  *
28889  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
28890  *
28891  *  Default value: false.
28892  *
28893  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28894  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28895  */
28896 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28897
28898 /**
28899  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
28900  * parts. If this is set to true, we'll accept the payment.
28901  *
28902  * Setting this to true will break backwards compatibility upon downgrading to an LDK
28903  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
28904  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
28905  *
28906  * Default value: false.
28907  *
28908  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28909  */
28910 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28911
28912 /**
28913  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
28914  * parts. If this is set to true, we'll accept the payment.
28915  *
28916  * Setting this to true will break backwards compatibility upon downgrading to an LDK
28917  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
28918  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
28919  *
28920  * Default value: false.
28921  *
28922  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28923  */
28924 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28925
28926 /**
28927  * Constructs a new UserConfig given each field
28928  */
28929 MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg, bool accept_mpp_keysend_arg);
28930
28931 /**
28932  * Creates a copy of the UserConfig
28933  */
28934 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
28935
28936 /**
28937  * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
28938  */
28939 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
28940
28941 /**
28942  * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
28943  */
28944 void BestBlock_free(struct LDKBestBlock this_obj);
28945
28946 /**
28947  * Creates a copy of the BestBlock
28948  */
28949 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
28950
28951 /**
28952  * Checks if two BestBlocks contain equal inner contents.
28953  * This ignores pointers and is_owned flags and looks at the values in fields.
28954  * Two objects with NULL inner values will be considered "equal" here.
28955  */
28956 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
28957
28958 /**
28959  * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
28960  * network.
28961  */
28962 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
28963
28964 /**
28965  * Returns a `BestBlock` as identified by the given block hash and height.
28966  */
28967 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
28968
28969 /**
28970  * Returns the best block hash.
28971  */
28972 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
28973
28974 /**
28975  * Returns the best block height.
28976  */
28977 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
28978
28979 /**
28980  * Calls the free function if one is set
28981  */
28982 void Listen_free(struct LDKListen this_ptr);
28983
28984 /**
28985  * Calls the free function if one is set
28986  */
28987 void Confirm_free(struct LDKConfirm this_ptr);
28988
28989 /**
28990  * Creates a copy of the ChannelMonitorUpdateStatus
28991  */
28992 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
28993
28994 /**
28995  * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
28996  */
28997 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
28998
28999 /**
29000  * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
29001  */
29002 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
29003
29004 /**
29005  * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
29006  */
29007 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
29008
29009 /**
29010  * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
29011  * This ignores pointers and is_owned flags and looks at the values in fields.
29012  */
29013 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
29014
29015 /**
29016  * Calls the free function if one is set
29017  */
29018 void Watch_free(struct LDKWatch this_ptr);
29019
29020 /**
29021  * Calls the free function if one is set
29022  */
29023 void Filter_free(struct LDKFilter this_ptr);
29024
29025 /**
29026  * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
29027  */
29028 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
29029
29030 /**
29031  * First block where the transaction output may have been spent.
29032  */
29033 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
29034
29035 /**
29036  * First block where the transaction output may have been spent.
29037  */
29038 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
29039
29040 /**
29041  * Outpoint identifying the transaction output.
29042  */
29043 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
29044
29045 /**
29046  * Outpoint identifying the transaction output.
29047  */
29048 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
29049
29050 /**
29051  * Spending condition of the transaction output.
29052  */
29053 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
29054
29055 /**
29056  * Spending condition of the transaction output.
29057  */
29058 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
29059
29060 /**
29061  * Constructs a new WatchedOutput given each field
29062  */
29063 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
29064
29065 /**
29066  * Creates a copy of the WatchedOutput
29067  */
29068 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
29069
29070 /**
29071  * Checks if two WatchedOutputs contain equal inner contents.
29072  * This ignores pointers and is_owned flags and looks at the values in fields.
29073  * Two objects with NULL inner values will be considered "equal" here.
29074  */
29075 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
29076
29077 /**
29078  * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
29079  */
29080 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
29081
29082 /**
29083  * Calls the free function if one is set
29084  */
29085 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
29086
29087 /**
29088  * Creates a copy of the ConfirmationTarget
29089  */
29090 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
29091
29092 /**
29093  * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
29094  */
29095 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
29096
29097 /**
29098  * Utility method to constructs a new MaxAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
29099  */
29100 enum LDKConfirmationTarget ConfirmationTarget_max_allowed_non_anchor_channel_remote_fee(void);
29101
29102 /**
29103  * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
29104  */
29105 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
29106
29107 /**
29108  * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
29109  */
29110 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
29111
29112 /**
29113  * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
29114  */
29115 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
29116
29117 /**
29118  * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
29119  */
29120 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
29121
29122 /**
29123  * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
29124  */
29125 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
29126
29127 /**
29128  * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
29129  */
29130 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
29131
29132 /**
29133  * Checks if two ConfirmationTargets contain equal inner contents.
29134  * This ignores pointers and is_owned flags and looks at the values in fields.
29135  */
29136 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
29137
29138 /**
29139  * Calls the free function if one is set
29140  */
29141 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
29142
29143 /**
29144  * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
29145  */
29146 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
29147
29148 /**
29149  * Creates a copy of the MonitorUpdateId
29150  */
29151 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
29152
29153 /**
29154  * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
29155  */
29156 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
29157
29158 /**
29159  * Checks if two MonitorUpdateIds contain equal inner contents.
29160  * This ignores pointers and is_owned flags and looks at the values in fields.
29161  * Two objects with NULL inner values will be considered "equal" here.
29162  */
29163 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
29164
29165 /**
29166  * Calls the free function if one is set
29167  */
29168 void Persist_free(struct LDKPersist this_ptr);
29169
29170 /**
29171  * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
29172  */
29173 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
29174
29175 /**
29176  * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
29177  */
29178 void ChainMonitor_free(struct LDKChainMonitor this_obj);
29179
29180 /**
29181  * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
29182  *
29183  * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
29184  * will call back to it indicating transactions and outputs of interest. This allows clients to
29185  * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
29186  * always need to fetch full blocks absent another means for determining which blocks contain
29187  * transactions relevant to the watched channels.
29188  */
29189 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
29190
29191 /**
29192  * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
29193  * claims which are awaiting confirmation.
29194  *
29195  * Includes the balances from each [`ChannelMonitor`] *except* those included in
29196  * `ignored_channels`, allowing you to filter out balances from channels which are still open
29197  * (and whose balance should likely be pulled from the [`ChannelDetails`]).
29198  *
29199  * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
29200  * inclusion in the return value.
29201  */
29202 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
29203
29204 /**
29205  * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
29206  * such [`ChannelMonitor`] is currently being monitored for.
29207  *
29208  * Note that the result holds a mutex over our monitor set, and should not be held
29209  * indefinitely.
29210  */
29211 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
29212
29213 /**
29214  * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
29215  *
29216  * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
29217  * monitoring for on-chain state resolutions.
29218  */
29219 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29220
29221 /**
29222  * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
29223  */
29224 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29225
29226 /**
29227  * Indicates the persistence of a [`ChannelMonitor`] has completed after
29228  * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
29229  *
29230  * Thus, the anticipated use is, at a high level:
29231  *  1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
29232  *     update to disk and begins updating any remote (e.g. watchtower/backup) copies,
29233  *     returning [`ChannelMonitorUpdateStatus::InProgress`],
29234  *  2) once all remote copies are updated, you call this function with the
29235  *     `completed_update_id` that completed, and once all pending updates have completed the
29236  *     channel will be re-enabled.
29237  *
29238  * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
29239  * registered [`ChannelMonitor`]s.
29240  */
29241 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id);
29242
29243 /**
29244  * Gets a [`Future`] that completes when an event is available either via
29245  * [`chain::Watch::release_pending_monitor_events`] or
29246  * [`EventsProvider::process_pending_events`].
29247  *
29248  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
29249  * [`ChainMonitor`] and should instead register actions to be taken later.
29250  *
29251  * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
29252  */
29253 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29254
29255 /**
29256  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
29257  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
29258  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
29259  * invoking this every 30 seconds, or lower if running in an environment with spotty
29260  * connections, like on mobile.
29261  */
29262 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29263
29264 /**
29265  * Constructs a new Listen which calls the relevant methods on this_arg.
29266  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
29267  */
29268 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29269
29270 /**
29271  * Constructs a new Confirm which calls the relevant methods on this_arg.
29272  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
29273  */
29274 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29275
29276 /**
29277  * Constructs a new Watch which calls the relevant methods on this_arg.
29278  * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
29279  */
29280 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29281
29282 /**
29283  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
29284  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
29285  */
29286 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29287
29288 /**
29289  * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
29290  */
29291 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
29292
29293 /**
29294  * The sequence number of this update. Updates *must* be replayed in-order according to this
29295  * sequence number (and updates may panic if they are not). The update_id values are strictly
29296  * increasing and increase by one for each new update, with two exceptions specified below.
29297  *
29298  * This sequence number is also used to track up to which points updates which returned
29299  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
29300  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
29301  *
29302  * The only instances we allow where update_id values are not strictly increasing have a
29303  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
29304  * will force close the channel by broadcasting the latest commitment transaction or
29305  * special post-force-close updates, like providing preimages necessary to claim outputs on the
29306  * broadcast commitment transaction. See its docs for more details.
29307  *
29308  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
29309  */
29310 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
29311
29312 /**
29313  * The sequence number of this update. Updates *must* be replayed in-order according to this
29314  * sequence number (and updates may panic if they are not). The update_id values are strictly
29315  * increasing and increase by one for each new update, with two exceptions specified below.
29316  *
29317  * This sequence number is also used to track up to which points updates which returned
29318  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
29319  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
29320  *
29321  * The only instances we allow where update_id values are not strictly increasing have a
29322  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
29323  * will force close the channel by broadcasting the latest commitment transaction or
29324  * special post-force-close updates, like providing preimages necessary to claim outputs on the
29325  * broadcast commitment transaction. See its docs for more details.
29326  *
29327  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
29328  */
29329 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
29330
29331 /**
29332  * Creates a copy of the ChannelMonitorUpdate
29333  */
29334 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
29335
29336 /**
29337  * Checks if two ChannelMonitorUpdates contain equal inner contents.
29338  * This ignores pointers and is_owned flags and looks at the values in fields.
29339  * Two objects with NULL inner values will be considered "equal" here.
29340  */
29341 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
29342
29343 /**
29344  * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
29345  */
29346 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
29347
29348 /**
29349  * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
29350  */
29351 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
29352
29353 /**
29354  * Frees any resources used by the MonitorEvent
29355  */
29356 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
29357
29358 /**
29359  * Creates a copy of the MonitorEvent
29360  */
29361 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
29362
29363 /**
29364  * Utility method to constructs a new HTLCEvent-variant MonitorEvent
29365  */
29366 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
29367
29368 /**
29369  * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
29370  */
29371 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
29372
29373 /**
29374  * Utility method to constructs a new Completed-variant MonitorEvent
29375  */
29376 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
29377
29378 /**
29379  * Checks if two MonitorEvents contain equal inner contents.
29380  * This ignores pointers and is_owned flags and looks at the values in fields.
29381  */
29382 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
29383
29384 /**
29385  * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
29386  */
29387 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
29388
29389 /**
29390  * Read a MonitorEvent from a byte array, created by MonitorEvent_write
29391  */
29392 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
29393
29394 /**
29395  * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
29396  */
29397 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
29398
29399 /**
29400  * Creates a copy of the HTLCUpdate
29401  */
29402 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
29403
29404 /**
29405  * Checks if two HTLCUpdates contain equal inner contents.
29406  * This ignores pointers and is_owned flags and looks at the values in fields.
29407  * Two objects with NULL inner values will be considered "equal" here.
29408  */
29409 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
29410
29411 /**
29412  * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
29413  */
29414 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
29415
29416 /**
29417  * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
29418  */
29419 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
29420
29421 /**
29422  * Frees any resources used by the Balance
29423  */
29424 void Balance_free(struct LDKBalance this_ptr);
29425
29426 /**
29427  * Creates a copy of the Balance
29428  */
29429 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
29430
29431 /**
29432  * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
29433  */
29434 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
29435
29436 /**
29437  * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
29438  */
29439 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
29440
29441 /**
29442  * Utility method to constructs a new ContentiousClaimable-variant Balance
29443  */
29444 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
29445
29446 /**
29447  * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
29448  */
29449 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
29450
29451 /**
29452  * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
29453  */
29454 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
29455
29456 /**
29457  * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
29458  */
29459 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
29460
29461 /**
29462  * Checks if two Balances contain equal inner contents.
29463  * This ignores pointers and is_owned flags and looks at the values in fields.
29464  */
29465 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
29466
29467 /**
29468  * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
29469  * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
29470  * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
29471  * [`Balance::MaybePreimageClaimableHTLC`].
29472  *
29473  * On-chain fees required to claim the balance are not included in this amount.
29474  */
29475 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
29476
29477 /**
29478  * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
29479  */
29480 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
29481
29482 /**
29483  * Creates a copy of the ChannelMonitor
29484  */
29485 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
29486
29487 /**
29488  * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
29489  */
29490 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
29491
29492 /**
29493  * Updates a ChannelMonitor on the basis of some new information provided by the Channel
29494  * itself.
29495  *
29496  * panics if the given update is not the next update by update_id.
29497  */
29498 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
29499
29500 /**
29501  * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
29502  * ChannelMonitor.
29503  */
29504 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29505
29506 /**
29507  * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
29508  */
29509 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29510
29511 /**
29512  * Gets a list of txids, with their output scripts (in the order they appear in the
29513  * transaction), which we must learn about spends of via block_connected().
29514  */
29515 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29516
29517 /**
29518  * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
29519  * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
29520  * have been registered.
29521  */
29522 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
29523
29524 /**
29525  * Get the list of HTLCs who's status has been updated on chain. This should be called by
29526  * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
29527  */
29528 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29529
29530 /**
29531  * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
29532  *
29533  * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
29534  * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
29535  * within each channel. As the confirmation of a commitment transaction may be critical to the
29536  * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
29537  * environment with spotty connections, like on mobile.
29538  *
29539  * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
29540  * order to handle these events.
29541  *
29542  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
29543  * [`BumpTransaction`]: crate::events::Event::BumpTransaction
29544  */
29545 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
29546
29547 /**
29548  * Gets the counterparty's initial commitment transaction. The returned commitment
29549  * transaction is unsigned. This is intended to be called during the initial persistence of
29550  * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
29551  * watchtowers in the persistence pipeline to have enough data to form justice transactions.
29552  *
29553  * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
29554  * that for the initial commitment transaction, we don't have a corresponding update.
29555  *
29556  * This will only return `Some` for channel monitors that have been created after upgrading
29557  * to LDK 0.0.117+.
29558  *
29559  * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
29560  *
29561  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29562  */
29563 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29564
29565 /**
29566  * Gets all of the counterparty commitment transactions provided by the given update. This
29567  * may be empty if the update doesn't include any new counterparty commitments. Returned
29568  * commitment transactions are unsigned.
29569  *
29570  * This is provided so that watchtower clients in the persistence pipeline are able to build
29571  * justice transactions for each counterparty commitment upon each update. It's intended to be
29572  * used within an implementation of [`Persist::update_persisted_channel`], which is provided
29573  * with a monitor and an update. Once revoked, signing a justice transaction can be done using
29574  * [`Self::sign_to_local_justice_tx`].
29575  *
29576  * It is expected that a watchtower client may use this method to retrieve the latest counterparty
29577  * commitment transaction(s), and then hold the necessary data until a later update in which
29578  * the monitor has been updated with the corresponding revocation data, at which point the
29579  * monitor can sign the justice transaction.
29580  *
29581  * This will only return a non-empty list for monitor updates that have been created after
29582  * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
29583  * may have been created prior to upgrading.
29584  *
29585  * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
29586  */
29587 MUST_USE_RES struct LDKCVec_CommitmentTransactionZ ChannelMonitor_counterparty_commitment_txs_from_update(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
29588
29589 /**
29590  * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
29591  * signing the justice transaction easier for implementors of
29592  * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
29593  * signing the input at `input_idx`. This method will only produce a valid signature for
29594  * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
29595  * be used for revoked HTLC outputs.
29596  *
29597  * `Value` is the value of the output being spent by the input at `input_idx`, committed
29598  * in the BIP 143 signature.
29599  *
29600  * This method will only succeed if this monitor has received the revocation secret for the
29601  * provided `commitment_number`. If a commitment number is provided that does not correspond
29602  * to the commitment transaction being revoked, this will return a signed transaction, but
29603  * the signature will not be valid.
29604  *
29605  * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::EcdsaChannelSigner::sign_justice_revoked_output
29606  * [`Persist`]: crate::chain::chainmonitor::Persist
29607  */
29608 MUST_USE_RES struct LDKCResult_TransactionNoneZ ChannelMonitor_sign_to_local_justice_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input_idx, uint64_t value, uint64_t commitment_number);
29609
29610 /**
29611  * Gets the `node_id` of the counterparty for this channel.
29612  *
29613  * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
29614  * otherwise.
29615  *
29616  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29617  */
29618 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29619
29620 /**
29621  * Used by [`ChannelManager`] deserialization to broadcast the latest holder state if its copy
29622  * of the channel state was out-of-date.
29623  *
29624  * You may also use this to broadcast the latest local commitment transaction, either because
29625  * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
29626  * counterparty side knows a revocation secret we gave them that they shouldn't know).
29627  *
29628  * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
29629  * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
29630  * close channel with their commitment transaction after a substantial amount of time. Best
29631  * may be to contact the other node operator out-of-band to coordinate other options available
29632  * to you.
29633  *
29634  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
29635  */
29636 MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
29637
29638 /**
29639  * Processes transactions in a newly connected block, which may result in any of the following:
29640  * - update the monitor's state against resolved HTLCs
29641  * - punish the counterparty in the case of seeing a revoked commitment transaction
29642  * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
29643  * - detect settled outputs for later spending
29644  * - schedule and bump any in-flight claims
29645  *
29646  * Returns any new outputs to watch from `txdata`; after called, these are also included in
29647  * [`get_outputs_to_watch`].
29648  *
29649  * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
29650  */
29651 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29652
29653 /**
29654  * Determines if the disconnected block contained any transactions of interest and updates
29655  * appropriately.
29656  */
29657 void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29658
29659 /**
29660  * Processes transactions confirmed in a block with the given header and height, returning new
29661  * outputs to watch. See [`block_connected`] for details.
29662  *
29663  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
29664  * blocks. See [`chain::Confirm`] for calling expectations.
29665  *
29666  * [`block_connected`]: Self::block_connected
29667  */
29668 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29669
29670 /**
29671  * Processes a transaction that was reorganized out of the chain.
29672  *
29673  * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
29674  * than blocks. See [`chain::Confirm`] for calling expectations.
29675  *
29676  * [`block_disconnected`]: Self::block_disconnected
29677  */
29678 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29679
29680 /**
29681  * Updates the monitor with the current best chain tip, returning new outputs to watch. See
29682  * [`block_connected`] for details.
29683  *
29684  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
29685  * blocks. See [`chain::Confirm`] for calling expectations.
29686  *
29687  * [`block_connected`]: Self::block_connected
29688  */
29689 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29690
29691 /**
29692  * Returns the set of txids that should be monitored for re-organization out of the chain.
29693  */
29694 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29695
29696 /**
29697  * Gets the latest best block which was connected either via the [`chain::Listen`] or
29698  * [`chain::Confirm`] interfaces.
29699  */
29700 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29701
29702 /**
29703  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
29704  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
29705  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
29706  * invoking this every 30 seconds, or lower if running in an environment with spotty
29707  * connections, like on mobile.
29708  */
29709 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29710
29711 /**
29712  * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
29713  * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
29714  * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
29715  * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
29716  * confirmations.
29717  *
29718  * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
29719  * once they are no longer under reorg risk. This method serves as a way to retrieve these
29720  * descriptors at a later time, either for historical purposes, or to replay any
29721  * missed/unhandled descriptors. For the purpose of gathering historical records, if the
29722  * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
29723  * an empty set), you can retrieve all spendable outputs by providing all descendant spending
29724  * transactions starting from the channel's funding transaction and going down three levels.
29725  *
29726  * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
29727  * outputs which can be spent by us are found, at least one descriptor is returned.
29728  *
29729  * `confirmation_height` must be the height of the block in which `tx` was included in.
29730  */
29731 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
29732
29733 /**
29734  * Gets the balances in this channel which are either claimable by us if we were to
29735  * force-close the channel now or which are claimable on-chain (possibly awaiting
29736  * confirmation).
29737  *
29738  * Any balances in the channel which are available on-chain (excluding on-chain fees) are
29739  * included here until an [`Event::SpendableOutputs`] event has been generated for the
29740  * balance, or until our counterparty has claimed the balance and accrued several
29741  * confirmations on the claim transaction.
29742  *
29743  * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
29744  * LDK prior to 0.0.111, not all or excess balances may be included.
29745  *
29746  * See [`Balance`] for additional details on the types of claimable balances which
29747  * may be returned here and their meanings.
29748  */
29749 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29750
29751 /**
29752  * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
29753  */
29754 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
29755
29756 /**
29757  * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
29758  */
29759 void OutPoint_free(struct LDKOutPoint this_obj);
29760
29761 /**
29762  * The referenced transaction's txid.
29763  */
29764 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
29765
29766 /**
29767  * The referenced transaction's txid.
29768  */
29769 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29770
29771 /**
29772  * The index of the referenced output in its transaction's vout.
29773  */
29774 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
29775
29776 /**
29777  * The index of the referenced output in its transaction's vout.
29778  */
29779 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
29780
29781 /**
29782  * Constructs a new OutPoint given each field
29783  */
29784 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
29785
29786 /**
29787  * Creates a copy of the OutPoint
29788  */
29789 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
29790
29791 /**
29792  * Checks if two OutPoints contain equal inner contents.
29793  * This ignores pointers and is_owned flags and looks at the values in fields.
29794  * Two objects with NULL inner values will be considered "equal" here.
29795  */
29796 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
29797
29798 /**
29799  * Generates a non-cryptographic 64-bit hash of the OutPoint.
29800  */
29801 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
29802
29803 /**
29804  * Convert an `OutPoint` to a lightning channel id.
29805  */
29806 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
29807
29808 /**
29809  * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
29810  */
29811 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
29812
29813 /**
29814  * Read a OutPoint from a byte array, created by OutPoint_write
29815  */
29816 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
29817
29818 /**
29819  * Frees any resources used by the FailureCode
29820  */
29821 void FailureCode_free(struct LDKFailureCode this_ptr);
29822
29823 /**
29824  * Creates a copy of the FailureCode
29825  */
29826 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
29827
29828 /**
29829  * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
29830  */
29831 struct LDKFailureCode FailureCode_temporary_node_failure(void);
29832
29833 /**
29834  * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
29835  */
29836 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
29837
29838 /**
29839  * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
29840  */
29841 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
29842
29843 /**
29844  * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
29845  */
29846 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
29847
29848 /**
29849  * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
29850  */
29851 void ChannelManager_free(struct LDKChannelManager this_obj);
29852
29853 /**
29854  * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
29855  */
29856 void ChainParameters_free(struct LDKChainParameters this_obj);
29857
29858 /**
29859  * The network for determining the `chain_hash` in Lightning messages.
29860  */
29861 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
29862
29863 /**
29864  * The network for determining the `chain_hash` in Lightning messages.
29865  */
29866 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
29867
29868 /**
29869  * The hash and height of the latest block successfully connected.
29870  *
29871  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
29872  */
29873 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
29874
29875 /**
29876  * The hash and height of the latest block successfully connected.
29877  *
29878  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
29879  */
29880 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
29881
29882 /**
29883  * Constructs a new ChainParameters given each field
29884  */
29885 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
29886
29887 /**
29888  * Creates a copy of the ChainParameters
29889  */
29890 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
29891
29892 /**
29893  * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
29894  */
29895 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
29896
29897 /**
29898  * Base routing fee in millisatoshis.
29899  */
29900 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29901
29902 /**
29903  * Base routing fee in millisatoshis.
29904  */
29905 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
29906
29907 /**
29908  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
29909  */
29910 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29911
29912 /**
29913  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
29914  */
29915 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
29916
29917 /**
29918  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
29919  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
29920  * `cltv_expiry_delta` for more details.
29921  */
29922 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29923
29924 /**
29925  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
29926  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
29927  * `cltv_expiry_delta` for more details.
29928  */
29929 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
29930
29931 /**
29932  * Constructs a new CounterpartyForwardingInfo given each field
29933  */
29934 MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg);
29935
29936 /**
29937  * Creates a copy of the CounterpartyForwardingInfo
29938  */
29939 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
29940
29941 /**
29942  * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
29943  */
29944 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
29945
29946 /**
29947  * The node_id of our counterparty
29948  */
29949 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29950
29951 /**
29952  * The node_id of our counterparty
29953  */
29954 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29955
29956 /**
29957  * The Features the channel counterparty provided upon last connection.
29958  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
29959  * many routing-relevant features are present in the init context.
29960  */
29961 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29962
29963 /**
29964  * The Features the channel counterparty provided upon last connection.
29965  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
29966  * many routing-relevant features are present in the init context.
29967  */
29968 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
29969
29970 /**
29971  * The value, in satoshis, that must always be held in the channel for our counterparty. This
29972  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
29973  * claiming at least this value on chain.
29974  *
29975  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
29976  *
29977  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
29978  */
29979 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29980
29981 /**
29982  * The value, in satoshis, that must always be held in the channel for our counterparty. This
29983  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
29984  * claiming at least this value on chain.
29985  *
29986  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
29987  *
29988  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
29989  */
29990 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
29991
29992 /**
29993  * Information on the fees and requirements that the counterparty requires when forwarding
29994  * payments to us through this channel.
29995  *
29996  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29997  */
29998 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29999
30000 /**
30001  * Information on the fees and requirements that the counterparty requires when forwarding
30002  * payments to us through this channel.
30003  *
30004  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30005  */
30006 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
30007
30008 /**
30009  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
30010  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
30011  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
30012  */
30013 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
30014
30015 /**
30016  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
30017  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
30018  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
30019  */
30020 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30021
30022 /**
30023  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
30024  */
30025 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
30026
30027 /**
30028  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
30029  */
30030 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30031
30032 /**
30033  * Constructs a new ChannelCounterparty given each field
30034  *
30035  * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30036  */
30037 MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg);
30038
30039 /**
30040  * Creates a copy of the ChannelCounterparty
30041  */
30042 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
30043
30044 /**
30045  * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
30046  */
30047 void ChannelDetails_free(struct LDKChannelDetails this_obj);
30048
30049 /**
30050  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
30051  * thereafter this is the txid of the funding transaction xor the funding transaction output).
30052  * Note that this means this value is *not* persistent - it can change once during the
30053  * lifetime of the channel.
30054  */
30055 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
30056
30057 /**
30058  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
30059  * thereafter this is the txid of the funding transaction xor the funding transaction output).
30060  * Note that this means this value is *not* persistent - it can change once during the
30061  * lifetime of the channel.
30062  */
30063 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30064
30065 /**
30066  * Parameters which apply to our counterparty. See individual fields for more information.
30067  */
30068 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30069
30070 /**
30071  * Parameters which apply to our counterparty. See individual fields for more information.
30072  */
30073 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
30074
30075 /**
30076  * The Channel's funding transaction output, if we've negotiated the funding transaction with
30077  * our counterparty already.
30078  *
30079  * Note that, if this has been set, `channel_id` will be equivalent to
30080  * `funding_txo.unwrap().to_channel_id()`.
30081  *
30082  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30083  */
30084 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30085
30086 /**
30087  * The Channel's funding transaction output, if we've negotiated the funding transaction with
30088  * our counterparty already.
30089  *
30090  * Note that, if this has been set, `channel_id` will be equivalent to
30091  * `funding_txo.unwrap().to_channel_id()`.
30092  *
30093  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30094  */
30095 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
30096
30097 /**
30098  * The features which this channel operates with. See individual features for more info.
30099  *
30100  * `None` until negotiation completes and the channel type is finalized.
30101  *
30102  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30103  */
30104 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30105
30106 /**
30107  * The features which this channel operates with. See individual features for more info.
30108  *
30109  * `None` until negotiation completes and the channel type is finalized.
30110  *
30111  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30112  */
30113 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
30114
30115 /**
30116  * The position of the funding transaction in the chain. None if the funding transaction has
30117  * not yet been confirmed and the channel fully opened.
30118  *
30119  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
30120  * payments instead of this. See [`get_inbound_payment_scid`].
30121  *
30122  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
30123  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
30124  *
30125  * [`inbound_scid_alias`]: Self::inbound_scid_alias
30126  * [`outbound_scid_alias`]: Self::outbound_scid_alias
30127  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
30128  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
30129  * [`confirmations_required`]: Self::confirmations_required
30130  */
30131 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30132
30133 /**
30134  * The position of the funding transaction in the chain. None if the funding transaction has
30135  * not yet been confirmed and the channel fully opened.
30136  *
30137  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
30138  * payments instead of this. See [`get_inbound_payment_scid`].
30139  *
30140  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
30141  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
30142  *
30143  * [`inbound_scid_alias`]: Self::inbound_scid_alias
30144  * [`outbound_scid_alias`]: Self::outbound_scid_alias
30145  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
30146  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
30147  * [`confirmations_required`]: Self::confirmations_required
30148  */
30149 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30150
30151 /**
30152  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
30153  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
30154  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
30155  * `Some(0)`).
30156  *
30157  * This will be `None` as long as the channel is not available for routing outbound payments.
30158  *
30159  * [`short_channel_id`]: Self::short_channel_id
30160  * [`confirmations_required`]: Self::confirmations_required
30161  */
30162 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30163
30164 /**
30165  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
30166  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
30167  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
30168  * `Some(0)`).
30169  *
30170  * This will be `None` as long as the channel is not available for routing outbound payments.
30171  *
30172  * [`short_channel_id`]: Self::short_channel_id
30173  * [`confirmations_required`]: Self::confirmations_required
30174  */
30175 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30176
30177 /**
30178  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
30179  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
30180  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
30181  * when they see a payment to be routed to us.
30182  *
30183  * Our counterparty may choose to rotate this value at any time, though will always recognize
30184  * previous values for inbound payment forwarding.
30185  *
30186  * [`short_channel_id`]: Self::short_channel_id
30187  */
30188 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30189
30190 /**
30191  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
30192  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
30193  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
30194  * when they see a payment to be routed to us.
30195  *
30196  * Our counterparty may choose to rotate this value at any time, though will always recognize
30197  * previous values for inbound payment forwarding.
30198  *
30199  * [`short_channel_id`]: Self::short_channel_id
30200  */
30201 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30202
30203 /**
30204  * The value, in satoshis, of this channel as appears in the funding output
30205  */
30206 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30207
30208 /**
30209  * The value, in satoshis, of this channel as appears in the funding output
30210  */
30211 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30212
30213 /**
30214  * The value, in satoshis, that must always be held in the channel for us. This value ensures
30215  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
30216  * this value on chain.
30217  *
30218  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
30219  *
30220  * This value will be `None` for outbound channels until the counterparty accepts the channel.
30221  *
30222  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
30223  */
30224 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30225
30226 /**
30227  * The value, in satoshis, that must always be held in the channel for us. This value ensures
30228  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
30229  * this value on chain.
30230  *
30231  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
30232  *
30233  * This value will be `None` for outbound channels until the counterparty accepts the channel.
30234  *
30235  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
30236  */
30237 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30238
30239 /**
30240  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
30241  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
30242  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
30243  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
30244  * serialized with LDK versions prior to 0.0.113.
30245  *
30246  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
30247  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
30248  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
30249  */
30250 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30251
30252 /**
30253  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
30254  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
30255  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
30256  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
30257  * serialized with LDK versions prior to 0.0.113.
30258  *
30259  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
30260  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
30261  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
30262  */
30263 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
30264
30265 /**
30266  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
30267  * which is applied to commitment and HTLC transactions.
30268  *
30269  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
30270  */
30271 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30272
30273 /**
30274  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
30275  * which is applied to commitment and HTLC transactions.
30276  *
30277  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
30278  */
30279 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30280
30281 /**
30282  * Our total balance.  This is the amount we would get if we close the channel.
30283  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
30284  * amount is not likely to be recoverable on close.
30285  *
30286  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
30287  * balance is not available for inclusion in new outbound HTLCs). This further does not include
30288  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
30289  * This does not consider any on-chain fees.
30290  *
30291  * See also [`ChannelDetails::outbound_capacity_msat`]
30292  */
30293 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30294
30295 /**
30296  * Our total balance.  This is the amount we would get if we close the channel.
30297  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
30298  * amount is not likely to be recoverable on close.
30299  *
30300  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
30301  * balance is not available for inclusion in new outbound HTLCs). This further does not include
30302  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
30303  * This does not consider any on-chain fees.
30304  *
30305  * See also [`ChannelDetails::outbound_capacity_msat`]
30306  */
30307 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30308
30309 /**
30310  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
30311  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
30312  * available for inclusion in new outbound HTLCs). This further does not include any pending
30313  * outgoing HTLCs which are awaiting some other resolution to be sent.
30314  *
30315  * See also [`ChannelDetails::balance_msat`]
30316  *
30317  * This value is not exact. Due to various in-flight changes, feerate changes, and our
30318  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
30319  * should be able to spend nearly this amount.
30320  */
30321 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30322
30323 /**
30324  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
30325  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
30326  * available for inclusion in new outbound HTLCs). This further does not include any pending
30327  * outgoing HTLCs which are awaiting some other resolution to be sent.
30328  *
30329  * See also [`ChannelDetails::balance_msat`]
30330  *
30331  * This value is not exact. Due to various in-flight changes, feerate changes, and our
30332  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
30333  * should be able to spend nearly this amount.
30334  */
30335 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30336
30337 /**
30338  * The available outbound capacity for sending a single HTLC to the remote peer. This is
30339  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
30340  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
30341  * to use a limit as close as possible to the HTLC limit we can currently send.
30342  *
30343  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
30344  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
30345  */
30346 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30347
30348 /**
30349  * The available outbound capacity for sending a single HTLC to the remote peer. This is
30350  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
30351  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
30352  * to use a limit as close as possible to the HTLC limit we can currently send.
30353  *
30354  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
30355  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
30356  */
30357 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30358
30359 /**
30360  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
30361  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
30362  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
30363  * route which is valid.
30364  */
30365 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30366
30367 /**
30368  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
30369  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
30370  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
30371  * route which is valid.
30372  */
30373 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30374
30375 /**
30376  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
30377  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
30378  * available for inclusion in new inbound HTLCs).
30379  * Note that there are some corner cases not fully handled here, so the actual available
30380  * inbound capacity may be slightly higher than this.
30381  *
30382  * This value is not exact. Due to various in-flight changes, feerate changes, and our
30383  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
30384  * However, our counterparty should be able to spend nearly this amount.
30385  */
30386 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30387
30388 /**
30389  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
30390  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
30391  * available for inclusion in new inbound HTLCs).
30392  * Note that there are some corner cases not fully handled here, so the actual available
30393  * inbound capacity may be slightly higher than this.
30394  *
30395  * This value is not exact. Due to various in-flight changes, feerate changes, and our
30396  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
30397  * However, our counterparty should be able to spend nearly this amount.
30398  */
30399 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30400
30401 /**
30402  * The number of required confirmations on the funding transaction before the funding will be
30403  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
30404  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
30405  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
30406  * [`ChannelHandshakeLimits::max_minimum_depth`].
30407  *
30408  * This value will be `None` for outbound channels until the counterparty accepts the channel.
30409  *
30410  * [`is_outbound`]: ChannelDetails::is_outbound
30411  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
30412  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
30413  */
30414 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30415
30416 /**
30417  * The number of required confirmations on the funding transaction before the funding will be
30418  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
30419  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
30420  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
30421  * [`ChannelHandshakeLimits::max_minimum_depth`].
30422  *
30423  * This value will be `None` for outbound channels until the counterparty accepts the channel.
30424  *
30425  * [`is_outbound`]: ChannelDetails::is_outbound
30426  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
30427  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
30428  */
30429 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30430
30431 /**
30432  * The current number of confirmations on the funding transaction.
30433  *
30434  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
30435  */
30436 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30437
30438 /**
30439  * The current number of confirmations on the funding transaction.
30440  *
30441  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
30442  */
30443 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30444
30445 /**
30446  * The number of blocks (after our commitment transaction confirms) that we will need to wait
30447  * until we can claim our funds after we force-close the channel. During this time our
30448  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
30449  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
30450  * time to claim our non-HTLC-encumbered funds.
30451  *
30452  * This value will be `None` for outbound channels until the counterparty accepts the channel.
30453  */
30454 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30455
30456 /**
30457  * The number of blocks (after our commitment transaction confirms) that we will need to wait
30458  * until we can claim our funds after we force-close the channel. During this time our
30459  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
30460  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
30461  * time to claim our non-HTLC-encumbered funds.
30462  *
30463  * This value will be `None` for outbound channels until the counterparty accepts the channel.
30464  */
30465 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
30466
30467 /**
30468  * True if the channel was initiated (and thus funded) by us.
30469  */
30470 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30471
30472 /**
30473  * True if the channel was initiated (and thus funded) by us.
30474  */
30475 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30476
30477 /**
30478  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
30479  * channel is not currently being shut down. `channel_ready` message exchange implies the
30480  * required confirmation count has been reached (and we were connected to the peer at some
30481  * point after the funding transaction received enough confirmations). The required
30482  * confirmation count is provided in [`confirmations_required`].
30483  *
30484  * [`confirmations_required`]: ChannelDetails::confirmations_required
30485  */
30486 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30487
30488 /**
30489  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
30490  * channel is not currently being shut down. `channel_ready` message exchange implies the
30491  * required confirmation count has been reached (and we were connected to the peer at some
30492  * point after the funding transaction received enough confirmations). The required
30493  * confirmation count is provided in [`confirmations_required`].
30494  *
30495  * [`confirmations_required`]: ChannelDetails::confirmations_required
30496  */
30497 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30498
30499 /**
30500  * The stage of the channel's shutdown.
30501  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
30502  *
30503  * Returns a copy of the field.
30504  */
30505 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30506
30507 /**
30508  * The stage of the channel's shutdown.
30509  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
30510  */
30511 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
30512
30513 /**
30514  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
30515  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
30516  *
30517  * This is a strict superset of `is_channel_ready`.
30518  */
30519 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30520
30521 /**
30522  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
30523  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
30524  *
30525  * This is a strict superset of `is_channel_ready`.
30526  */
30527 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30528
30529 /**
30530  * True if this channel is (or will be) publicly-announced.
30531  */
30532 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30533
30534 /**
30535  * True if this channel is (or will be) publicly-announced.
30536  */
30537 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30538
30539 /**
30540  * The smallest value HTLC (in msat) we will accept, for this channel. This field
30541  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
30542  */
30543 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30544
30545 /**
30546  * The smallest value HTLC (in msat) we will accept, for this channel. This field
30547  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
30548  */
30549 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30550
30551 /**
30552  * The largest value HTLC (in msat) we currently will accept, for this channel.
30553  */
30554 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30555
30556 /**
30557  * The largest value HTLC (in msat) we currently will accept, for this channel.
30558  */
30559 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30560
30561 /**
30562  * Set of configurable parameters that affect channel operation.
30563  *
30564  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
30565  *
30566  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30567  */
30568 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30569
30570 /**
30571  * Set of configurable parameters that affect channel operation.
30572  *
30573  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
30574  *
30575  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30576  */
30577 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
30578
30579 /**
30580  * Constructs a new ChannelDetails given each field
30581  *
30582  * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30583  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30584  * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30585  */
30586 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg);
30587
30588 /**
30589  * Creates a copy of the ChannelDetails
30590  */
30591 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
30592
30593 /**
30594  * Gets the current SCID which should be used to identify this channel for inbound payments.
30595  * This should be used for providing invoice hints or in any other context where our
30596  * counterparty will forward a payment to us.
30597  *
30598  * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
30599  * [`ChannelDetails::short_channel_id`]. See those for more information.
30600  */
30601 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
30602
30603 /**
30604  * Gets the current SCID which should be used to identify this channel for outbound payments.
30605  * This should be used in [`Route`]s to describe the first hop or in other contexts where
30606  * we're sending or forwarding a payment outbound over this channel.
30607  *
30608  * This is either the [`ChannelDetails::short_channel_id`], if set, or the
30609  * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
30610  */
30611 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
30612
30613 /**
30614  * Creates a copy of the ChannelShutdownState
30615  */
30616 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
30617
30618 /**
30619  * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
30620  */
30621 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
30622
30623 /**
30624  * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
30625  */
30626 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
30627
30628 /**
30629  * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
30630  */
30631 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
30632
30633 /**
30634  * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
30635  */
30636 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
30637
30638 /**
30639  * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
30640  */
30641 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
30642
30643 /**
30644  * Checks if two ChannelShutdownStates contain equal inner contents.
30645  * This ignores pointers and is_owned flags and looks at the values in fields.
30646  */
30647 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
30648
30649 /**
30650  * Frees any resources used by the RecentPaymentDetails
30651  */
30652 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
30653
30654 /**
30655  * Creates a copy of the RecentPaymentDetails
30656  */
30657 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
30658
30659 /**
30660  * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
30661  */
30662 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
30663
30664 /**
30665  * Utility method to constructs a new Pending-variant RecentPaymentDetails
30666  */
30667 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
30668
30669 /**
30670  * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
30671  */
30672 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
30673
30674 /**
30675  * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
30676  */
30677 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
30678
30679 /**
30680  * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
30681  */
30682 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
30683
30684 /**
30685  * The list of channels to be included in the invoice route hints.
30686  */
30687 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30688
30689 /**
30690  * The list of channels to be included in the invoice route hints.
30691  */
30692 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
30693
30694 /**
30695  * A fake scid used for representing the phantom node's fake channel in generating the invoice
30696  * route hints.
30697  */
30698 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30699
30700 /**
30701  * A fake scid used for representing the phantom node's fake channel in generating the invoice
30702  * route hints.
30703  */
30704 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
30705
30706 /**
30707  * The pubkey of the real backing node that would ultimately receive the payment.
30708  */
30709 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30710
30711 /**
30712  * The pubkey of the real backing node that would ultimately receive the payment.
30713  */
30714 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30715
30716 /**
30717  * Constructs a new PhantomRouteHints given each field
30718  */
30719 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
30720
30721 /**
30722  * Creates a copy of the PhantomRouteHints
30723  */
30724 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
30725
30726 /**
30727  * Constructs a new `ChannelManager` to hold several channels and route between them.
30728  *
30729  * The current time or latest block header time can be provided as the `current_timestamp`.
30730  *
30731  * This is the main \"logic hub\" for all channel-related actions, and implements
30732  * [`ChannelMessageHandler`].
30733  *
30734  * Non-proportional fees are fixed according to our risk using the provided fee estimator.
30735  *
30736  * Users need to notify the new `ChannelManager` when a new block is connected or
30737  * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
30738  * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
30739  * more details.
30740  *
30741  * [`block_connected`]: chain::Listen::block_connected
30742  * [`block_disconnected`]: chain::Listen::block_disconnected
30743  * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
30744  */
30745 MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params, uint32_t current_timestamp);
30746
30747 /**
30748  * Gets the current configuration applied to all new channels.
30749  */
30750 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
30751
30752 /**
30753  * Creates a new outbound channel to the given remote node and with the given value.
30754  *
30755  * `user_channel_id` will be provided back as in
30756  * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
30757  * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
30758  * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
30759  * is simply copied to events and otherwise ignored.
30760  *
30761  * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
30762  * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
30763  *
30764  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
30765  * generate a shutdown scriptpubkey or destination script set by
30766  * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
30767  *
30768  * Note that we do not check if you are currently connected to the given peer. If no
30769  * connection is available, the outbound `open_channel` message may fail to send, resulting in
30770  * the channel eventually being silently forgotten (dropped on reload).
30771  *
30772  * Returns the new Channel's temporary `channel_id`. This ID will appear as
30773  * [`Event::FundingGenerationReady::temporary_channel_id`] and in
30774  * [`ChannelDetails::channel_id`] until after
30775  * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
30776  * one derived from the funding transaction's TXID. If the counterparty rejects the channel
30777  * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
30778  *
30779  * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
30780  * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
30781  * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
30782  *
30783  * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
30784  */
30785 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKUserConfig override_config);
30786
30787 /**
30788  * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
30789  * more information.
30790  */
30791 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
30792
30793 /**
30794  * Gets the list of usable channels, in random order. Useful as an argument to
30795  * [`Router::find_route`] to ensure non-announced channels are used.
30796  *
30797  * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
30798  * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
30799  * are.
30800  */
30801 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
30802
30803 /**
30804  * Gets the list of channels we have with a given counterparty, in random order.
30805  */
30806 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
30807
30808 /**
30809  * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
30810  * successful path, or have unresolved HTLCs.
30811  *
30812  * This can be useful for payments that may have been prepared, but ultimately not sent, as a
30813  * result of a crash. If such a payment exists, is not listed here, and an
30814  * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
30815  *
30816  * [`Event::PaymentSent`]: events::Event::PaymentSent
30817  */
30818 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
30819
30820 /**
30821  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
30822  * will be accepted on the given channel, and after additional timeout/the closing of all
30823  * pending HTLCs, the channel will be closed on chain.
30824  *
30825  *  * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
30826  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
30827  *    fee estimate.
30828  *  * If our counterparty is the channel initiator, we will require a channel closing
30829  *    transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
30830  *    would appear on a force-closure transaction, whichever is lower. We will allow our
30831  *    counterparty to pay as much fee as they'd like, however.
30832  *
30833  * May generate a [`SendShutdown`] message event on success, which should be relayed.
30834  *
30835  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
30836  * generate a shutdown scriptpubkey or destination script set by
30837  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
30838  * channel.
30839  *
30840  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
30841  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
30842  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
30843  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
30844  */
30845 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30846
30847 /**
30848  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
30849  * will be accepted on the given channel, and after additional timeout/the closing of all
30850  * pending HTLCs, the channel will be closed on chain.
30851  *
30852  * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
30853  * the channel being closed or not:
30854  *  * If we are the channel initiator, we will pay at least this feerate on the closing
30855  *    transaction. The upper-bound is set by
30856  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
30857  *    fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
30858  *  * If our counterparty is the channel initiator, we will refuse to accept a channel closure
30859  *    transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
30860  *    will appear on a force-closure transaction, whichever is lower).
30861  *
30862  * The `shutdown_script` provided  will be used as the `scriptPubKey` for the closing transaction.
30863  * Will fail if a shutdown script has already been set for this channel by
30864  * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
30865  * also be compatible with our and the counterparty's features.
30866  *
30867  * May generate a [`SendShutdown`] message event on success, which should be relayed.
30868  *
30869  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
30870  * generate a shutdown scriptpubkey or destination script set by
30871  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
30872  * channel.
30873  *
30874  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
30875  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
30876  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
30877  *
30878  * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
30879  */
30880 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
30881
30882 /**
30883  * Force closes a channel, immediately broadcasting the latest local transaction(s) and
30884  * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
30885  * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
30886  * channel.
30887  */
30888 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30889
30890 /**
30891  * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
30892  * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
30893  * `counterparty_node_id` isn't the counterparty of the corresponding channel.
30894  *
30895  * You can always get the latest local transaction(s) to broadcast from
30896  * [`ChannelMonitor::get_latest_holder_commitment_txn`].
30897  */
30898 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30899
30900 /**
30901  * Force close all channels, immediately broadcasting the latest local commitment transaction
30902  * for each to the chain and rejecting new HTLCs on each.
30903  */
30904 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
30905
30906 /**
30907  * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
30908  * local transaction(s).
30909  */
30910 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
30911
30912 /**
30913  * Sends a payment along a given route.
30914  *
30915  * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
30916  * fields for more info.
30917  *
30918  * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
30919  * [`PeerManager::process_events`]).
30920  *
30921  * # Avoiding Duplicate Payments
30922  *
30923  * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
30924  * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
30925  * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
30926  * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
30927  * second payment with the same [`PaymentId`].
30928  *
30929  * Thus, in order to ensure duplicate payments are not sent, you should implement your own
30930  * tracking of payments, including state to indicate once a payment has completed. Because you
30931  * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
30932  * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
30933  * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
30934  *
30935  * Additionally, in the scenario where we begin the process of sending a payment, but crash
30936  * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
30937  * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
30938  * [`ChannelManager::list_recent_payments`] for more information.
30939  *
30940  * # Possible Error States on [`PaymentSendFailure`]
30941  *
30942  * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
30943  * each entry matching the corresponding-index entry in the route paths, see
30944  * [`PaymentSendFailure`] for more info.
30945  *
30946  * In general, a path may raise:
30947  *  * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
30948  *    node public key) is specified.
30949  *  * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
30950  *    closed, doesn't exist, or the peer is currently disconnected.
30951  *  * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
30952  *    relevant updates.
30953  *
30954  * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
30955  * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
30956  * different route unless you intend to pay twice!
30957  *
30958  * [`RouteHop`]: crate::routing::router::RouteHop
30959  * [`Event::PaymentSent`]: events::Event::PaymentSent
30960  * [`Event::PaymentFailed`]: events::Event::PaymentFailed
30961  * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
30962  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
30963  * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
30964  */
30965 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
30966
30967 /**
30968  * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
30969  * `route_params` and retry failed payment paths based on `retry_strategy`.
30970  */
30971 MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
30972
30973 /**
30974  * Signals that no further attempts for the given payment should occur. Useful if you have a
30975  * pending outbound payment with retries remaining, but wish to stop retrying the payment before
30976  * retries are exhausted.
30977  *
30978  * # Event Generation
30979  *
30980  * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
30981  * as there are no remaining pending HTLCs for this payment.
30982  *
30983  * Note that calling this method does *not* prevent a payment from succeeding. You must still
30984  * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
30985  * determine the ultimate status of a payment.
30986  *
30987  * # Requested Invoices
30988  *
30989  * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
30990  * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
30991  * and prevent any attempts at paying it once received. The other events may only be generated
30992  * once the invoice has been received.
30993  *
30994  * # Restart Behavior
30995  *
30996  * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
30997  * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
30998  * [`Event::InvoiceRequestFailed`].
30999  *
31000  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
31001  */
31002 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
31003
31004 /**
31005  * Send a spontaneous payment, which is a payment that does not require the recipient to have
31006  * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
31007  * the preimage, it must be a cryptographically secure random value that no intermediate node
31008  * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
31009  * never reach the recipient.
31010  *
31011  * See [`send_payment`] documentation for more details on the return value of this function
31012  * and idempotency guarantees provided by the [`PaymentId`] key.
31013  *
31014  * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
31015  * [`send_payment`] for more information about the risks of duplicate preimage usage.
31016  *
31017  * [`send_payment`]: Self::send_payment
31018  */
31019 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
31020
31021 /**
31022  * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
31023  * based on `route_params` and retry failed payment paths based on `retry_strategy`.
31024  *
31025  * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
31026  * payments.
31027  *
31028  * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
31029  */
31030 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
31031
31032 /**
31033  * Send a payment that is probing the given route for liquidity. We calculate the
31034  * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
31035  * us to easily discern them from real payments.
31036  */
31037 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
31038
31039 /**
31040  * Sends payment probes over all paths of a route that would be used to pay the given
31041  * amount to the given `node_id`.
31042  *
31043  * See [`ChannelManager::send_preflight_probes`] for more information.
31044  */
31045 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_spontaneous_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, uint64_t amount_msat, uint32_t final_cltv_expiry_delta, struct LDKCOption_u64Z liquidity_limit_multiplier);
31046
31047 /**
31048  * Sends payment probes over all paths of a route that would be used to pay a route found
31049  * according to the given [`RouteParameters`].
31050  *
31051  * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
31052  * the actual payment. Note this is only useful if there likely is sufficient time for the
31053  * probe to settle before sending out the actual payment, e.g., when waiting for user
31054  * confirmation in a wallet UI.
31055  *
31056  * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
31057  * actual payment. Users should therefore be cautious and might avoid sending probes if
31058  * liquidity is scarce and/or they don't expect the probe to return before they send the
31059  * payment. To mitigate this issue, channels with available liquidity less than the required
31060  * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
31061  * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
31062  */
31063 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRouteParameters route_params, struct LDKCOption_u64Z liquidity_limit_multiplier);
31064
31065 /**
31066  * Call this upon creation of a funding transaction for the given channel.
31067  *
31068  * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
31069  * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
31070  *
31071  * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
31072  * across the p2p network.
31073  *
31074  * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
31075  * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
31076  *
31077  * May panic if the output found in the funding transaction is duplicative with some other
31078  * channel (note that this should be trivially prevented by using unique funding transaction
31079  * keys per-channel).
31080  *
31081  * Do NOT broadcast the funding transaction yourself. When we have safely received our
31082  * counterparty's signature the funding transaction will automatically be broadcast via the
31083  * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
31084  *
31085  * Note that this includes RBF or similar transaction replacement strategies - lightning does
31086  * not currently support replacing a funding transaction on an existing channel. Instead,
31087  * create a new channel with a conflicting funding transaction.
31088  *
31089  * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
31090  * the wallet software generating the funding transaction to apply anti-fee sniping as
31091  * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
31092  * for more details.
31093  *
31094  * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
31095  * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
31096  */
31097 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
31098
31099 /**
31100  * Call this upon creation of a batch funding transaction for the given channels.
31101  *
31102  * Return values are identical to [`Self::funding_transaction_generated`], respective to
31103  * each individual channel and transaction output.
31104  *
31105  * Do NOT broadcast the funding transaction yourself. This batch funding transcaction
31106  * will only be broadcast when we have safely received and persisted the counterparty's
31107  * signature for each channel.
31108  *
31109  * If there is an error, all channels in the batch are to be considered closed.
31110  */
31111 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
31112
31113 /**
31114  * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
31115  *
31116  * Once the updates are applied, each eligible channel (advertised with a known short channel
31117  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
31118  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
31119  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
31120  *
31121  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
31122  * `counterparty_node_id` is provided.
31123  *
31124  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
31125  * below [`MIN_CLTV_EXPIRY_DELTA`].
31126  *
31127  * If an error is returned, none of the updates should be considered applied.
31128  *
31129  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
31130  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
31131  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
31132  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
31133  * [`ChannelUpdate`]: msgs::ChannelUpdate
31134  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
31135  * [`APIMisuseError`]: APIError::APIMisuseError
31136  */
31137 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
31138
31139 /**
31140  * Atomically updates the [`ChannelConfig`] for the given channels.
31141  *
31142  * Once the updates are applied, each eligible channel (advertised with a known short channel
31143  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
31144  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
31145  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
31146  *
31147  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
31148  * `counterparty_node_id` is provided.
31149  *
31150  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
31151  * below [`MIN_CLTV_EXPIRY_DELTA`].
31152  *
31153  * If an error is returned, none of the updates should be considered applied.
31154  *
31155  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
31156  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
31157  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
31158  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
31159  * [`ChannelUpdate`]: msgs::ChannelUpdate
31160  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
31161  * [`APIMisuseError`]: APIError::APIMisuseError
31162  */
31163 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
31164
31165 /**
31166  * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
31167  * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
31168  *
31169  * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
31170  * channel to a receiving node if the node lacks sufficient inbound liquidity.
31171  *
31172  * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
31173  * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
31174  * receiver's invoice route hints. These route hints will signal to LDK to generate an
31175  * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
31176  * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
31177  *
31178  * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
31179  * you from forwarding more than you received. See
31180  * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
31181  * than expected.
31182  *
31183  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
31184  * backwards.
31185  *
31186  * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
31187  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
31188  * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
31189  */
31190 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const uint8_t (*next_hop_channel_id)[32], struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
31191
31192 /**
31193  * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
31194  * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
31195  *
31196  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
31197  * backwards.
31198  *
31199  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
31200  */
31201 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
31202
31203 /**
31204  * Processes HTLCs which are pending waiting on random forward delay.
31205  *
31206  * Should only really ever be called in response to a PendingHTLCsForwardable event.
31207  * Will likely generate further events.
31208  */
31209 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
31210
31211 /**
31212  * Performs actions which should happen on startup and roughly once per minute thereafter.
31213  *
31214  * This currently includes:
31215  *  * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
31216  *  * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
31217  *    than a minute, informing the network that they should no longer attempt to route over
31218  *    the channel.
31219  *  * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
31220  *    with the current [`ChannelConfig`].
31221  *  * Removing peers which have disconnected but and no longer have any channels.
31222  *  * Force-closing and removing channels which have not completed establishment in a timely manner.
31223  *  * Forgetting about stale outbound payments, either those that have already been fulfilled
31224  *    or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
31225  *    The latter is determined using the system clock in `std` and the highest seen block time
31226  *    minus two hours in `no-std`.
31227  *
31228  * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
31229  * estimate fetches.
31230  *
31231  * [`ChannelUpdate`]: msgs::ChannelUpdate
31232  * [`ChannelConfig`]: crate::util::config::ChannelConfig
31233  */
31234 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
31235
31236 /**
31237  * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
31238  * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
31239  * along the path (including in our own channel on which we received it).
31240  *
31241  * Note that in some cases around unclean shutdown, it is possible the payment may have
31242  * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
31243  * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
31244  * may have already been failed automatically by LDK if it was nearing its expiration time.
31245  *
31246  * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
31247  * [`ChannelManager::claim_funds`]), you should still monitor for
31248  * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
31249  * startup during which time claims that were in-progress at shutdown may be replayed.
31250  */
31251 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
31252
31253 /**
31254  * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
31255  * reason for the failure.
31256  *
31257  * See [`FailureCode`] for valid failure codes.
31258  */
31259 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
31260
31261 /**
31262  * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
31263  * [`MessageSendEvent`]s needed to claim the payment.
31264  *
31265  * This method is guaranteed to ensure the payment has been claimed but only if the current
31266  * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
31267  * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
31268  * successful. It will generally be available in the next [`process_pending_events`] call.
31269  *
31270  * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
31271  * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
31272  * event matches your expectation. If you fail to do so and call this method, you may provide
31273  * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
31274  *
31275  * This function will fail the payment if it has custom TLVs with even type numbers, as we
31276  * will assume they are unknown. If you intend to accept even custom TLVs, you should use
31277  * [`claim_funds_with_known_custom_tlvs`].
31278  *
31279  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
31280  * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
31281  * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
31282  * [`process_pending_events`]: EventsProvider::process_pending_events
31283  * [`create_inbound_payment`]: Self::create_inbound_payment
31284  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
31285  * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
31286  */
31287 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
31288
31289 /**
31290  * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
31291  * even type numbers.
31292  *
31293  * # Note
31294  *
31295  * You MUST check you've understood all even TLVs before using this to
31296  * claim, otherwise you may unintentionally agree to some protocol you do not understand.
31297  *
31298  * [`claim_funds`]: Self::claim_funds
31299  */
31300 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
31301
31302 /**
31303  * Gets the node_id held by this ChannelManager
31304  */
31305 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
31306
31307 /**
31308  * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
31309  *
31310  * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
31311  * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
31312  * the channel.
31313  *
31314  * The `user_channel_id` parameter will be provided back in
31315  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
31316  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
31317  *
31318  * Note that this method will return an error and reject the channel, if it requires support
31319  * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
31320  * used to accept such channels.
31321  *
31322  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
31323  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
31324  */
31325 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
31326
31327 /**
31328  * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
31329  * it as confirmed immediately.
31330  *
31331  * The `user_channel_id` parameter will be provided back in
31332  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
31333  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
31334  *
31335  * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
31336  * and (if the counterparty agrees), enables forwarding of payments immediately.
31337  *
31338  * This fully trusts that the counterparty has honestly and correctly constructed the funding
31339  * transaction and blindly assumes that it will eventually confirm.
31340  *
31341  * If it does not confirm before we decide to close the channel, or if the funding transaction
31342  * does not pay to the correct script the correct amount, *you will lose funds*.
31343  *
31344  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
31345  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
31346  */
31347 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
31348
31349 /**
31350  * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
31351  * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
31352  * [`Bolt12Invoice`] once it is received.
31353  *
31354  * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
31355  * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
31356  * The optional parameters are used in the builder, if `Some`:
31357  * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
31358  *   [`Offer::expects_quantity`] is `true`.
31359  * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
31360  * - `payer_note` for [`InvoiceRequest::payer_note`].
31361  *
31362  * If `max_total_routing_fee_msat` is not specified, The default from
31363  * [`RouteParameters::from_payment_params_and_value`] is applied.
31364  *
31365  * # Payment
31366  *
31367  * The provided `payment_id` is used to ensure that only one invoice is paid for the request
31368  * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
31369  * been sent.
31370  *
31371  * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
31372  * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
31373  * payment will fail with an [`Event::InvoiceRequestFailed`].
31374  *
31375  * # Privacy
31376  *
31377  * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
31378  * as the introduction node and a derived payer id for payer privacy. As such, currently, the
31379  * node must be announced. Otherwise, there is no way to find a path to the introduction node
31380  * in order to send the [`Bolt12Invoice`].
31381  *
31382  * # Limitations
31383  *
31384  * Requires a direct connection to an introduction node in [`Offer::paths`] or to
31385  * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
31386  * [`Bolt12Invoice::payment_paths`].
31387  *
31388  * # Errors
31389  *
31390  * Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link
31391  * or if the provided parameters are invalid for the offer.
31392  *
31393  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
31394  * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
31395  * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
31396  * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
31397  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
31398  * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
31399  * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
31400  */
31401 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_pay_for_offer(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOffer *NONNULL_PTR offer, struct LDKCOption_u64Z quantity, struct LDKCOption_u64Z amount_msats, struct LDKCOption_StrZ payer_note, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
31402
31403 /**
31404  * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
31405  * message.
31406  *
31407  * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
31408  * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
31409  * [`PaymentPreimage`].
31410  *
31411  * # Limitations
31412  *
31413  * Requires a direct connection to an introduction node in [`Refund::paths`] or to
31414  * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
31415  * node meeting the aforementioned criteria, but there's no guarantee that they will be
31416  * received and no retries will be made.
31417  *
31418  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
31419  */
31420 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
31421
31422 /**
31423  * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
31424  * to pay us.
31425  *
31426  * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
31427  * [`PaymentHash`] and [`PaymentPreimage`] for you.
31428  *
31429  * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
31430  * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
31431  * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
31432  * passed directly to [`claim_funds`].
31433  *
31434  * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
31435  *
31436  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
31437  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
31438  *
31439  * # Note
31440  *
31441  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
31442  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
31443  *
31444  * Errors if `min_value_msat` is greater than total bitcoin supply.
31445  *
31446  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31447  * on versions of LDK prior to 0.0.114.
31448  *
31449  * [`claim_funds`]: Self::claim_funds
31450  * [`PaymentClaimable`]: events::Event::PaymentClaimable
31451  * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
31452  * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
31453  * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
31454  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
31455  */
31456 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
31457
31458 /**
31459  * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
31460  * stored external to LDK.
31461  *
31462  * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
31463  * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
31464  * the `min_value_msat` provided here, if one is provided.
31465  *
31466  * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
31467  * note that LDK will not stop you from registering duplicate payment hashes for inbound
31468  * payments.
31469  *
31470  * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
31471  * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
31472  * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
31473  * sender \"proof-of-payment\" unless they have paid the required amount.
31474  *
31475  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
31476  * in excess of the current time. This should roughly match the expiry time set in the invoice.
31477  * After this many seconds, we will remove the inbound payment, resulting in any attempts to
31478  * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
31479  * invoices when no timeout is set.
31480  *
31481  * Note that we use block header time to time-out pending inbound payments (with some margin
31482  * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
31483  * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
31484  * If you need exact expiry semantics, you should enforce them upon receipt of
31485  * [`PaymentClaimable`].
31486  *
31487  * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
31488  * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
31489  *
31490  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
31491  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
31492  *
31493  * # Note
31494  *
31495  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
31496  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
31497  *
31498  * Errors if `min_value_msat` is greater than total bitcoin supply.
31499  *
31500  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31501  * on versions of LDK prior to 0.0.114.
31502  *
31503  * [`create_inbound_payment`]: Self::create_inbound_payment
31504  * [`PaymentClaimable`]: events::Event::PaymentClaimable
31505  */
31506 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry);
31507
31508 /**
31509  * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
31510  * previously returned from [`create_inbound_payment`].
31511  *
31512  * [`create_inbound_payment`]: Self::create_inbound_payment
31513  */
31514 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
31515
31516 /**
31517  * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
31518  * are used when constructing the phantom invoice's route hints.
31519  *
31520  * [phantom node payments]: crate::sign::PhantomKeysManager
31521  */
31522 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
31523
31524 /**
31525  * Gets route hints for use in receiving [phantom node payments].
31526  *
31527  * [phantom node payments]: crate::sign::PhantomKeysManager
31528  */
31529 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
31530
31531 /**
31532  * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
31533  * used when constructing the route hints for HTLCs intended to be intercepted. See
31534  * [`ChannelManager::forward_intercepted_htlc`].
31535  *
31536  * Note that this method is not guaranteed to return unique values, you may need to call it a few
31537  * times to get a unique scid.
31538  */
31539 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
31540
31541 /**
31542  * Gets inflight HTLC information by processing pending outbound payments that are in
31543  * our channels. May be used during pathfinding to account for in-use channel liquidity.
31544  */
31545 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
31546
31547 /**
31548  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
31549  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
31550  */
31551 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
31552
31553 /**
31554  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
31555  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
31556  */
31557 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
31558
31559 /**
31560  * Constructs a new Listen which calls the relevant methods on this_arg.
31561  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
31562  */
31563 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
31564
31565 /**
31566  * Constructs a new Confirm which calls the relevant methods on this_arg.
31567  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
31568  */
31569 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
31570
31571 /**
31572  * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
31573  * may have events that need processing.
31574  *
31575  * In order to check if this [`ChannelManager`] needs persisting, call
31576  * [`Self::get_and_clear_needs_persistence`].
31577  *
31578  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
31579  * [`ChannelManager`] and should instead register actions to be taken later.
31580  */
31581 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
31582
31583 /**
31584  * Returns true if this [`ChannelManager`] needs to be persisted.
31585  */
31586 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
31587
31588 /**
31589  * Gets the latest best block which was connected either via the [`chain::Listen`] or
31590  * [`chain::Confirm`] interfaces.
31591  */
31592 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
31593
31594 /**
31595  * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
31596  * [`ChannelManager`].
31597  */
31598 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31599
31600 /**
31601  * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
31602  * [`ChannelManager`].
31603  */
31604 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31605
31606 /**
31607  * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
31608  * [`ChannelManager`].
31609  */
31610 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31611
31612 /**
31613  * Fetches the set of [`InitFeatures`] flags that are provided by or required by
31614  * [`ChannelManager`].
31615  */
31616 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31617
31618 /**
31619  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
31620  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
31621  */
31622 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
31623
31624 /**
31625  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
31626  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
31627  */
31628 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
31629
31630 /**
31631  * Fetches the set of [`InitFeatures`] flags that are provided by or required by
31632  * [`ChannelManager`].
31633  */
31634 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
31635
31636 /**
31637  * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
31638  */
31639 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
31640
31641 /**
31642  * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
31643  */
31644 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
31645
31646 /**
31647  * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
31648  */
31649 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
31650
31651 /**
31652  * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
31653  */
31654 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
31655
31656 /**
31657  * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
31658  */
31659 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
31660
31661 /**
31662  * Read a ChannelDetails from a byte array, created by ChannelDetails_write
31663  */
31664 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
31665
31666 /**
31667  * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
31668  */
31669 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
31670
31671 /**
31672  * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
31673  */
31674 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
31675
31676 /**
31677  * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
31678  */
31679 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
31680
31681 /**
31682  * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
31683  */
31684 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
31685
31686 /**
31687  * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
31688  */
31689 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
31690
31691 /**
31692  * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
31693  */
31694 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
31695
31696 /**
31697  * A cryptographically secure source of entropy.
31698  */
31699 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31700
31701 /**
31702  * A cryptographically secure source of entropy.
31703  */
31704 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
31705
31706 /**
31707  * A signer that is able to perform node-scoped cryptographic operations.
31708  */
31709 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31710
31711 /**
31712  * A signer that is able to perform node-scoped cryptographic operations.
31713  */
31714 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
31715
31716 /**
31717  * The keys provider which will give us relevant keys. Some keys will be loaded during
31718  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
31719  * signing data.
31720  */
31721 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31722
31723 /**
31724  * The keys provider which will give us relevant keys. Some keys will be loaded during
31725  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
31726  * signing data.
31727  */
31728 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
31729
31730 /**
31731  * The fee_estimator for use in the ChannelManager in the future.
31732  *
31733  * No calls to the FeeEstimator will be made during deserialization.
31734  */
31735 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31736
31737 /**
31738  * The fee_estimator for use in the ChannelManager in the future.
31739  *
31740  * No calls to the FeeEstimator will be made during deserialization.
31741  */
31742 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
31743
31744 /**
31745  * The chain::Watch for use in the ChannelManager in the future.
31746  *
31747  * No calls to the chain::Watch will be made during deserialization. It is assumed that
31748  * you have deserialized ChannelMonitors separately and will add them to your
31749  * chain::Watch after deserializing this ChannelManager.
31750  */
31751 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31752
31753 /**
31754  * The chain::Watch for use in the ChannelManager in the future.
31755  *
31756  * No calls to the chain::Watch will be made during deserialization. It is assumed that
31757  * you have deserialized ChannelMonitors separately and will add them to your
31758  * chain::Watch after deserializing this ChannelManager.
31759  */
31760 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
31761
31762 /**
31763  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
31764  * used to broadcast the latest local commitment transactions of channels which must be
31765  * force-closed during deserialization.
31766  */
31767 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31768
31769 /**
31770  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
31771  * used to broadcast the latest local commitment transactions of channels which must be
31772  * force-closed during deserialization.
31773  */
31774 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
31775
31776 /**
31777  * The router which will be used in the ChannelManager in the future for finding routes
31778  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
31779  *
31780  * No calls to the router will be made during deserialization.
31781  */
31782 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31783
31784 /**
31785  * The router which will be used in the ChannelManager in the future for finding routes
31786  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
31787  *
31788  * No calls to the router will be made during deserialization.
31789  */
31790 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
31791
31792 /**
31793  * The Logger for use in the ChannelManager and which may be used to log information during
31794  * deserialization.
31795  */
31796 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31797
31798 /**
31799  * The Logger for use in the ChannelManager and which may be used to log information during
31800  * deserialization.
31801  */
31802 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
31803
31804 /**
31805  * Default settings used for new channels. Any existing channels will continue to use the
31806  * runtime settings which were stored when the ChannelManager was serialized.
31807  */
31808 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31809
31810 /**
31811  * Default settings used for new channels. Any existing channels will continue to use the
31812  * runtime settings which were stored when the ChannelManager was serialized.
31813  */
31814 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
31815
31816 /**
31817  * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
31818  * HashMap for you. This is primarily useful for C bindings where it is not practical to
31819  * populate a HashMap directly from C.
31820  */
31821 MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
31822
31823 /**
31824  * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
31825  */
31826 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
31827
31828 /**
31829  * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
31830  */
31831 void ExpandedKey_free(struct LDKExpandedKey this_obj);
31832
31833 /**
31834  * Create a  new [`ExpandedKey`] for generating an inbound payment hash and secret.
31835  *
31836  * It is recommended to cache this value and not regenerate it for each new inbound payment.
31837  */
31838 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
31839
31840 /**
31841  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
31842  * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
31843  * a `ChannelManager`.
31844  *
31845  * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
31846  * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
31847  * regenerate it for each new inbound payment.
31848  *
31849  * `current_time` is a Unix timestamp representing the current time.
31850  *
31851  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31852  * on versions of LDK prior to 0.0.114.
31853  *
31854  * [phantom node payments]: crate::sign::PhantomKeysManager
31855  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
31856  */
31857 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKEntropySource *NONNULL_PTR entropy_source, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
31858
31859 /**
31860  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
31861  * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
31862  * without a `ChannelManager`.
31863  *
31864  * See [`create`] for information on the `keys` and `current_time` parameters.
31865  *
31866  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31867  * on versions of LDK prior to 0.0.114.
31868  *
31869  * [phantom node payments]: crate::sign::PhantomKeysManager
31870  */
31871 struct LDKCResult_ThirtyTwoBytesNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
31872
31873 /**
31874  * Frees any resources used by the DecodeError
31875  */
31876 void DecodeError_free(struct LDKDecodeError this_ptr);
31877
31878 /**
31879  * Creates a copy of the DecodeError
31880  */
31881 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
31882
31883 /**
31884  * Utility method to constructs a new UnknownVersion-variant DecodeError
31885  */
31886 struct LDKDecodeError DecodeError_unknown_version(void);
31887
31888 /**
31889  * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
31890  */
31891 struct LDKDecodeError DecodeError_unknown_required_feature(void);
31892
31893 /**
31894  * Utility method to constructs a new InvalidValue-variant DecodeError
31895  */
31896 struct LDKDecodeError DecodeError_invalid_value(void);
31897
31898 /**
31899  * Utility method to constructs a new ShortRead-variant DecodeError
31900  */
31901 struct LDKDecodeError DecodeError_short_read(void);
31902
31903 /**
31904  * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
31905  */
31906 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
31907
31908 /**
31909  * Utility method to constructs a new Io-variant DecodeError
31910  */
31911 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
31912
31913 /**
31914  * Utility method to constructs a new UnsupportedCompression-variant DecodeError
31915  */
31916 struct LDKDecodeError DecodeError_unsupported_compression(void);
31917
31918 /**
31919  * Checks if two DecodeErrors contain equal inner contents.
31920  * This ignores pointers and is_owned flags and looks at the values in fields.
31921  */
31922 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
31923
31924 /**
31925  * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
31926  */
31927 void Init_free(struct LDKInit this_obj);
31928
31929 /**
31930  * The relevant features which the sender supports.
31931  */
31932 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
31933
31934 /**
31935  * The relevant features which the sender supports.
31936  */
31937 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
31938
31939 /**
31940  * Indicates chains the sender is interested in.
31941  *
31942  * If there are no common chains, the connection will be closed.
31943  *
31944  * Returns a copy of the field.
31945  */
31946 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
31947
31948 /**
31949  * Indicates chains the sender is interested in.
31950  *
31951  * If there are no common chains, the connection will be closed.
31952  */
31953 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
31954
31955 /**
31956  * The receipient's network address.
31957  *
31958  * This adds the option to report a remote IP address back to a connecting peer using the init
31959  * message. A node can decide to use that information to discover a potential update to its
31960  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
31961  * the new address.
31962  */
31963 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
31964
31965 /**
31966  * The receipient's network address.
31967  *
31968  * This adds the option to report a remote IP address back to a connecting peer using the init
31969  * message. A node can decide to use that information to discover a potential update to its
31970  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
31971  * the new address.
31972  */
31973 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
31974
31975 /**
31976  * Constructs a new Init given each field
31977  */
31978 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
31979
31980 /**
31981  * Creates a copy of the Init
31982  */
31983 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
31984
31985 /**
31986  * Checks if two Inits contain equal inner contents.
31987  * This ignores pointers and is_owned flags and looks at the values in fields.
31988  * Two objects with NULL inner values will be considered "equal" here.
31989  */
31990 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
31991
31992 /**
31993  * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
31994  */
31995 void ErrorMessage_free(struct LDKErrorMessage this_obj);
31996
31997 /**
31998  * The channel ID involved in the error.
31999  *
32000  * All-0s indicates a general error unrelated to a specific channel, after which all channels
32001  * with the sending peer should be closed.
32002  */
32003 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
32004
32005 /**
32006  * The channel ID involved in the error.
32007  *
32008  * All-0s indicates a general error unrelated to a specific channel, after which all channels
32009  * with the sending peer should be closed.
32010  */
32011 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32012
32013 /**
32014  * A possibly human-readable error description.
32015  *
32016  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
32017  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
32018  * the terminal emulator or the logging subsystem.
32019  */
32020 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
32021
32022 /**
32023  * A possibly human-readable error description.
32024  *
32025  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
32026  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
32027  * the terminal emulator or the logging subsystem.
32028  */
32029 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
32030
32031 /**
32032  * Constructs a new ErrorMessage given each field
32033  */
32034 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
32035
32036 /**
32037  * Creates a copy of the ErrorMessage
32038  */
32039 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
32040
32041 /**
32042  * Checks if two ErrorMessages contain equal inner contents.
32043  * This ignores pointers and is_owned flags and looks at the values in fields.
32044  * Two objects with NULL inner values will be considered "equal" here.
32045  */
32046 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
32047
32048 /**
32049  * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
32050  */
32051 void WarningMessage_free(struct LDKWarningMessage this_obj);
32052
32053 /**
32054  * The channel ID involved in the warning.
32055  *
32056  * All-0s indicates a warning unrelated to a specific channel.
32057  */
32058 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
32059
32060 /**
32061  * The channel ID involved in the warning.
32062  *
32063  * All-0s indicates a warning unrelated to a specific channel.
32064  */
32065 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32066
32067 /**
32068  * A possibly human-readable warning description.
32069  *
32070  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
32071  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
32072  * the terminal emulator or the logging subsystem.
32073  */
32074 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
32075
32076 /**
32077  * A possibly human-readable warning description.
32078  *
32079  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
32080  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
32081  * the terminal emulator or the logging subsystem.
32082  */
32083 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
32084
32085 /**
32086  * Constructs a new WarningMessage given each field
32087  */
32088 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
32089
32090 /**
32091  * Creates a copy of the WarningMessage
32092  */
32093 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
32094
32095 /**
32096  * Checks if two WarningMessages contain equal inner contents.
32097  * This ignores pointers and is_owned flags and looks at the values in fields.
32098  * Two objects with NULL inner values will be considered "equal" here.
32099  */
32100 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
32101
32102 /**
32103  * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
32104  */
32105 void Ping_free(struct LDKPing this_obj);
32106
32107 /**
32108  * The desired response length.
32109  */
32110 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
32111
32112 /**
32113  * The desired response length.
32114  */
32115 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
32116
32117 /**
32118  * The ping packet size.
32119  *
32120  * This field is not sent on the wire. byteslen zeros are sent.
32121  */
32122 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
32123
32124 /**
32125  * The ping packet size.
32126  *
32127  * This field is not sent on the wire. byteslen zeros are sent.
32128  */
32129 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
32130
32131 /**
32132  * Constructs a new Ping given each field
32133  */
32134 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
32135
32136 /**
32137  * Creates a copy of the Ping
32138  */
32139 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
32140
32141 /**
32142  * Checks if two Pings contain equal inner contents.
32143  * This ignores pointers and is_owned flags and looks at the values in fields.
32144  * Two objects with NULL inner values will be considered "equal" here.
32145  */
32146 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
32147
32148 /**
32149  * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
32150  */
32151 void Pong_free(struct LDKPong this_obj);
32152
32153 /**
32154  * The pong packet size.
32155  *
32156  * This field is not sent on the wire. byteslen zeros are sent.
32157  */
32158 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
32159
32160 /**
32161  * The pong packet size.
32162  *
32163  * This field is not sent on the wire. byteslen zeros are sent.
32164  */
32165 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
32166
32167 /**
32168  * Constructs a new Pong given each field
32169  */
32170 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
32171
32172 /**
32173  * Creates a copy of the Pong
32174  */
32175 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
32176
32177 /**
32178  * Checks if two Pongs contain equal inner contents.
32179  * This ignores pointers and is_owned flags and looks at the values in fields.
32180  * Two objects with NULL inner values will be considered "equal" here.
32181  */
32182 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
32183
32184 /**
32185  * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
32186  */
32187 void OpenChannel_free(struct LDKOpenChannel this_obj);
32188
32189 /**
32190  * The genesis hash of the blockchain where the channel is to be opened
32191  */
32192 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
32193
32194 /**
32195  * The genesis hash of the blockchain where the channel is to be opened
32196  */
32197 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32198
32199 /**
32200  * A temporary channel ID, until the funding outpoint is announced
32201  */
32202 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
32203
32204 /**
32205  * A temporary channel ID, until the funding outpoint is announced
32206  */
32207 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32208
32209 /**
32210  * The channel value
32211  */
32212 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32213
32214 /**
32215  * The channel value
32216  */
32217 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32218
32219 /**
32220  * The amount to push to the counterparty as part of the open, in milli-satoshi
32221  */
32222 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32223
32224 /**
32225  * The amount to push to the counterparty as part of the open, in milli-satoshi
32226  */
32227 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32228
32229 /**
32230  * The threshold below which outputs on transactions broadcast by sender will be omitted
32231  */
32232 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32233
32234 /**
32235  * The threshold below which outputs on transactions broadcast by sender will be omitted
32236  */
32237 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32238
32239 /**
32240  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32241  */
32242 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32243
32244 /**
32245  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32246  */
32247 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32248
32249 /**
32250  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32251  */
32252 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32253
32254 /**
32255  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32256  */
32257 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32258
32259 /**
32260  * The minimum HTLC size incoming to sender, in milli-satoshi
32261  */
32262 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32263
32264 /**
32265  * The minimum HTLC size incoming to sender, in milli-satoshi
32266  */
32267 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32268
32269 /**
32270  * The feerate per 1000-weight of sender generated transactions, until updated by
32271  * [`UpdateFee`]
32272  */
32273 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32274
32275 /**
32276  * The feerate per 1000-weight of sender generated transactions, until updated by
32277  * [`UpdateFee`]
32278  */
32279 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
32280
32281 /**
32282  * The number of blocks which the counterparty will have to wait to claim on-chain funds if
32283  * they broadcast a commitment transaction
32284  */
32285 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32286
32287 /**
32288  * The number of blocks which the counterparty will have to wait to claim on-chain funds if
32289  * they broadcast a commitment transaction
32290  */
32291 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
32292
32293 /**
32294  * The maximum number of inbound HTLCs towards sender
32295  */
32296 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32297
32298 /**
32299  * The maximum number of inbound HTLCs towards sender
32300  */
32301 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
32302
32303 /**
32304  * The sender's key controlling the funding transaction
32305  */
32306 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32307
32308 /**
32309  * The sender's key controlling the funding transaction
32310  */
32311 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32312
32313 /**
32314  * Used to derive a revocation key for transactions broadcast by counterparty
32315  */
32316 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32317
32318 /**
32319  * Used to derive a revocation key for transactions broadcast by counterparty
32320  */
32321 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32322
32323 /**
32324  * A payment key to sender for transactions broadcast by counterparty
32325  */
32326 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32327
32328 /**
32329  * A payment key to sender for transactions broadcast by counterparty
32330  */
32331 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32332
32333 /**
32334  * Used to derive a payment key to sender for transactions broadcast by sender
32335  */
32336 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32337
32338 /**
32339  * Used to derive a payment key to sender for transactions broadcast by sender
32340  */
32341 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32342
32343 /**
32344  * Used to derive an HTLC payment key to sender
32345  */
32346 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32347
32348 /**
32349  * Used to derive an HTLC payment key to sender
32350  */
32351 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32352
32353 /**
32354  * The first to-be-broadcast-by-sender transaction's per commitment point
32355  */
32356 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32357
32358 /**
32359  * The first to-be-broadcast-by-sender transaction's per commitment point
32360  */
32361 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32362
32363 /**
32364  * The channel flags to be used
32365  */
32366 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32367
32368 /**
32369  * The channel flags to be used
32370  */
32371 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
32372
32373 /**
32374  * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
32375  */
32376 struct LDKCOption_CVec_u8ZZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32377
32378 /**
32379  * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
32380  */
32381 void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32382
32383 /**
32384  * The channel type that this channel will represent
32385  *
32386  * If this is `None`, we derive the channel type from the intersection of our
32387  * feature bits with our counterparty's feature bits from the [`Init`] message.
32388  *
32389  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32390  */
32391 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32392
32393 /**
32394  * The channel type that this channel will represent
32395  *
32396  * If this is `None`, we derive the channel type from the intersection of our
32397  * feature bits with our counterparty's feature bits from the [`Init`] message.
32398  *
32399  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32400  */
32401 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32402
32403 /**
32404  * Constructs a new OpenChannel given each field
32405  *
32406  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32407  */
32408 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t push_msat_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t feerate_per_kw_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
32409
32410 /**
32411  * Creates a copy of the OpenChannel
32412  */
32413 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
32414
32415 /**
32416  * Checks if two OpenChannels contain equal inner contents.
32417  * This ignores pointers and is_owned flags and looks at the values in fields.
32418  * Two objects with NULL inner values will be considered "equal" here.
32419  */
32420 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
32421
32422 /**
32423  * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
32424  */
32425 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
32426
32427 /**
32428  * The genesis hash of the blockchain where the channel is to be opened
32429  */
32430 const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
32431
32432 /**
32433  * The genesis hash of the blockchain where the channel is to be opened
32434  */
32435 void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32436
32437 /**
32438  * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
32439  */
32440 const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
32441
32442 /**
32443  * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
32444  */
32445 void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32446
32447 /**
32448  * The feerate for the funding transaction set by the channel initiator
32449  */
32450 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32451
32452 /**
32453  * The feerate for the funding transaction set by the channel initiator
32454  */
32455 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32456
32457 /**
32458  * The feerate for the commitment transaction set by the channel initiator
32459  */
32460 uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32461
32462 /**
32463  * The feerate for the commitment transaction set by the channel initiator
32464  */
32465 void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32466
32467 /**
32468  * Part of the channel value contributed by the channel initiator
32469  */
32470 uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32471
32472 /**
32473  * Part of the channel value contributed by the channel initiator
32474  */
32475 void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32476
32477 /**
32478  * The threshold below which outputs on transactions broadcast by the channel initiator will be
32479  * omitted
32480  */
32481 uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32482
32483 /**
32484  * The threshold below which outputs on transactions broadcast by the channel initiator will be
32485  * omitted
32486  */
32487 void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32488
32489 /**
32490  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
32491  */
32492 uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32493
32494 /**
32495  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
32496  */
32497 void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32498
32499 /**
32500  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
32501  */
32502 uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32503
32504 /**
32505  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
32506  */
32507 void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32508
32509 /**
32510  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32511  * broadcast a commitment transaction
32512  */
32513 uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32514
32515 /**
32516  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32517  * broadcast a commitment transaction
32518  */
32519 void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32520
32521 /**
32522  * The maximum number of inbound HTLCs towards channel initiator
32523  */
32524 uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32525
32526 /**
32527  * The maximum number of inbound HTLCs towards channel initiator
32528  */
32529 void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32530
32531 /**
32532  * The locktime for the funding transaction
32533  */
32534 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32535
32536 /**
32537  * The locktime for the funding transaction
32538  */
32539 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32540
32541 /**
32542  * The channel initiator's key controlling the funding transaction
32543  */
32544 struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32545
32546 /**
32547  * The channel initiator's key controlling the funding transaction
32548  */
32549 void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32550
32551 /**
32552  * Used to derive a revocation key for transactions broadcast by counterparty
32553  */
32554 struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32555
32556 /**
32557  * Used to derive a revocation key for transactions broadcast by counterparty
32558  */
32559 void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32560
32561 /**
32562  * A payment key to channel initiator for transactions broadcast by counterparty
32563  */
32564 struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32565
32566 /**
32567  * A payment key to channel initiator for transactions broadcast by counterparty
32568  */
32569 void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32570
32571 /**
32572  * Used to derive a payment key to channel initiator for transactions broadcast by channel
32573  * initiator
32574  */
32575 struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32576
32577 /**
32578  * Used to derive a payment key to channel initiator for transactions broadcast by channel
32579  * initiator
32580  */
32581 void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32582
32583 /**
32584  * Used to derive an HTLC payment key to channel initiator
32585  */
32586 struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32587
32588 /**
32589  * Used to derive an HTLC payment key to channel initiator
32590  */
32591 void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32592
32593 /**
32594  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
32595  */
32596 struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32597
32598 /**
32599  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
32600  */
32601 void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32602
32603 /**
32604  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
32605  */
32606 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32607
32608 /**
32609  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
32610  */
32611 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32612
32613 /**
32614  * Channel flags
32615  */
32616 uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32617
32618 /**
32619  * Channel flags
32620  */
32621 void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val);
32622
32623 /**
32624  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
32625  * collaboratively close
32626  */
32627 struct LDKCOption_CVec_u8ZZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32628
32629 /**
32630  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
32631  * collaboratively close
32632  */
32633 void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32634
32635 /**
32636  * The channel type that this channel will represent. If none is set, we derive the channel
32637  * type from the intersection of our feature bits with our counterparty's feature bits from
32638  * the Init message.
32639  *
32640  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32641  */
32642 struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32643
32644 /**
32645  * The channel type that this channel will represent. If none is set, we derive the channel
32646  * type from the intersection of our feature bits with our counterparty's feature bits from
32647  * the Init message.
32648  *
32649  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32650  */
32651 void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32652
32653 /**
32654  * Optionally, a requirement that only confirmed inputs can be added
32655  */
32656 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32657
32658 /**
32659  * Optionally, a requirement that only confirmed inputs can be added
32660  */
32661 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
32662
32663 /**
32664  * Constructs a new OpenChannelV2 given each field
32665  *
32666  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32667  */
32668 MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
32669
32670 /**
32671  * Creates a copy of the OpenChannelV2
32672  */
32673 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
32674
32675 /**
32676  * Checks if two OpenChannelV2s contain equal inner contents.
32677  * This ignores pointers and is_owned flags and looks at the values in fields.
32678  * Two objects with NULL inner values will be considered "equal" here.
32679  */
32680 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
32681
32682 /**
32683  * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
32684  */
32685 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
32686
32687 /**
32688  * A temporary channel ID, until the funding outpoint is announced
32689  */
32690 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
32691
32692 /**
32693  * A temporary channel ID, until the funding outpoint is announced
32694  */
32695 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32696
32697 /**
32698  * The threshold below which outputs on transactions broadcast by sender will be omitted
32699  */
32700 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32701
32702 /**
32703  * The threshold below which outputs on transactions broadcast by sender will be omitted
32704  */
32705 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32706
32707 /**
32708  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32709  */
32710 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32711
32712 /**
32713  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32714  */
32715 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32716
32717 /**
32718  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32719  */
32720 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32721
32722 /**
32723  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32724  */
32725 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32726
32727 /**
32728  * The minimum HTLC size incoming to sender, in milli-satoshi
32729  */
32730 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32731
32732 /**
32733  * The minimum HTLC size incoming to sender, in milli-satoshi
32734  */
32735 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32736
32737 /**
32738  * Minimum depth of the funding transaction before the channel is considered open
32739  */
32740 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32741
32742 /**
32743  * Minimum depth of the funding transaction before the channel is considered open
32744  */
32745 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
32746
32747 /**
32748  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
32749  */
32750 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32751
32752 /**
32753  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
32754  */
32755 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
32756
32757 /**
32758  * The maximum number of inbound HTLCs towards sender
32759  */
32760 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32761
32762 /**
32763  * The maximum number of inbound HTLCs towards sender
32764  */
32765 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
32766
32767 /**
32768  * The sender's key controlling the funding transaction
32769  */
32770 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32771
32772 /**
32773  * The sender's key controlling the funding transaction
32774  */
32775 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32776
32777 /**
32778  * Used to derive a revocation key for transactions broadcast by counterparty
32779  */
32780 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32781
32782 /**
32783  * Used to derive a revocation key for transactions broadcast by counterparty
32784  */
32785 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32786
32787 /**
32788  * A payment key to sender for transactions broadcast by counterparty
32789  */
32790 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32791
32792 /**
32793  * A payment key to sender for transactions broadcast by counterparty
32794  */
32795 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32796
32797 /**
32798  * Used to derive a payment key to sender for transactions broadcast by sender
32799  */
32800 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32801
32802 /**
32803  * Used to derive a payment key to sender for transactions broadcast by sender
32804  */
32805 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32806
32807 /**
32808  * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
32809  */
32810 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32811
32812 /**
32813  * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
32814  */
32815 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32816
32817 /**
32818  * The first to-be-broadcast-by-sender transaction's per commitment point
32819  */
32820 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32821
32822 /**
32823  * The first to-be-broadcast-by-sender transaction's per commitment point
32824  */
32825 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32826
32827 /**
32828  * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
32829  */
32830 struct LDKCOption_CVec_u8ZZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32831
32832 /**
32833  * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
32834  */
32835 void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32836
32837 /**
32838  * The channel type that this channel will represent.
32839  *
32840  * If this is `None`, we derive the channel type from the intersection of
32841  * our feature bits with our counterparty's feature bits from the [`Init`] message.
32842  * This is required to match the equivalent field in [`OpenChannel::channel_type`].
32843  *
32844  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32845  */
32846 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32847
32848 /**
32849  * The channel type that this channel will represent.
32850  *
32851  * If this is `None`, we derive the channel type from the intersection of
32852  * our feature bits with our counterparty's feature bits from the [`Init`] message.
32853  * This is required to match the equivalent field in [`OpenChannel::channel_type`].
32854  *
32855  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32856  */
32857 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32858
32859 /**
32860  * Constructs a new AcceptChannel given each field
32861  *
32862  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32863  */
32864 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
32865
32866 /**
32867  * Creates a copy of the AcceptChannel
32868  */
32869 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
32870
32871 /**
32872  * Checks if two AcceptChannels contain equal inner contents.
32873  * This ignores pointers and is_owned flags and looks at the values in fields.
32874  * Two objects with NULL inner values will be considered "equal" here.
32875  */
32876 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
32877
32878 /**
32879  * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
32880  */
32881 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
32882
32883 /**
32884  * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
32885  */
32886 const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32];
32887
32888 /**
32889  * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
32890  */
32891 void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32892
32893 /**
32894  * Part of the channel value contributed by the channel acceptor
32895  */
32896 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32897
32898 /**
32899  * Part of the channel value contributed by the channel acceptor
32900  */
32901 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32902
32903 /**
32904  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
32905  * omitted
32906  */
32907 uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32908
32909 /**
32910  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
32911  * omitted
32912  */
32913 void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32914
32915 /**
32916  * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
32917  */
32918 uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32919
32920 /**
32921  * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
32922  */
32923 void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32924
32925 /**
32926  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
32927  */
32928 uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32929
32930 /**
32931  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
32932  */
32933 void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32934
32935 /**
32936  * Minimum depth of the funding transaction before the channel is considered open
32937  */
32938 uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32939
32940 /**
32941  * Minimum depth of the funding transaction before the channel is considered open
32942  */
32943 void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32944
32945 /**
32946  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32947  * broadcast a commitment transaction
32948  */
32949 uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32950
32951 /**
32952  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32953  * broadcast a commitment transaction
32954  */
32955 void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32956
32957 /**
32958  * The maximum number of inbound HTLCs towards channel acceptor
32959  */
32960 uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32961
32962 /**
32963  * The maximum number of inbound HTLCs towards channel acceptor
32964  */
32965 void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32966
32967 /**
32968  * The channel acceptor's key controlling the funding transaction
32969  */
32970 struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32971
32972 /**
32973  * The channel acceptor's key controlling the funding transaction
32974  */
32975 void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32976
32977 /**
32978  * Used to derive a revocation key for transactions broadcast by counterparty
32979  */
32980 struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32981
32982 /**
32983  * Used to derive a revocation key for transactions broadcast by counterparty
32984  */
32985 void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32986
32987 /**
32988  * A payment key to channel acceptor for transactions broadcast by counterparty
32989  */
32990 struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32991
32992 /**
32993  * A payment key to channel acceptor for transactions broadcast by counterparty
32994  */
32995 void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32996
32997 /**
32998  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
32999  * acceptor
33000  */
33001 struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33002
33003 /**
33004  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
33005  * acceptor
33006  */
33007 void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33008
33009 /**
33010  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
33011  */
33012 struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33013
33014 /**
33015  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
33016  */
33017 void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33018
33019 /**
33020  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
33021  */
33022 struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33023
33024 /**
33025  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
33026  */
33027 void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33028
33029 /**
33030  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
33031  */
33032 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33033
33034 /**
33035  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
33036  */
33037 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33038
33039 /**
33040  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
33041  * collaboratively close
33042  */
33043 struct LDKCOption_CVec_u8ZZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33044
33045 /**
33046  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
33047  * collaboratively close
33048  */
33049 void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
33050
33051 /**
33052  * The channel type that this channel will represent. If none is set, we derive the channel
33053  * type from the intersection of our feature bits with our counterparty's feature bits from
33054  * the Init message.
33055  *
33056  * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
33057  *
33058  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33059  */
33060 struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33061
33062 /**
33063  * The channel type that this channel will represent. If none is set, we derive the channel
33064  * type from the intersection of our feature bits with our counterparty's feature bits from
33065  * the Init message.
33066  *
33067  * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
33068  *
33069  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33070  */
33071 void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
33072
33073 /**
33074  * Optionally, a requirement that only confirmed inputs can be added
33075  */
33076 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33077
33078 /**
33079  * Optionally, a requirement that only confirmed inputs can be added
33080  */
33081 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
33082
33083 /**
33084  * Constructs a new AcceptChannelV2 given each field
33085  *
33086  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33087  */
33088 MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
33089
33090 /**
33091  * Creates a copy of the AcceptChannelV2
33092  */
33093 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
33094
33095 /**
33096  * Checks if two AcceptChannelV2s contain equal inner contents.
33097  * This ignores pointers and is_owned flags and looks at the values in fields.
33098  * Two objects with NULL inner values will be considered "equal" here.
33099  */
33100 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
33101
33102 /**
33103  * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
33104  */
33105 void FundingCreated_free(struct LDKFundingCreated this_obj);
33106
33107 /**
33108  * A temporary channel ID, until the funding is established
33109  */
33110 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
33111
33112 /**
33113  * A temporary channel ID, until the funding is established
33114  */
33115 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33116
33117 /**
33118  * The funding transaction ID
33119  */
33120 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
33121
33122 /**
33123  * The funding transaction ID
33124  */
33125 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33126
33127 /**
33128  * The specific output index funding this channel
33129  */
33130 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
33131
33132 /**
33133  * The specific output index funding this channel
33134  */
33135 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
33136
33137 /**
33138  * The signature of the channel initiator (funder) on the initial commitment transaction
33139  */
33140 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
33141
33142 /**
33143  * The signature of the channel initiator (funder) on the initial commitment transaction
33144  */
33145 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33146
33147 /**
33148  * Constructs a new FundingCreated given each field
33149  */
33150 MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
33151
33152 /**
33153  * Creates a copy of the FundingCreated
33154  */
33155 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
33156
33157 /**
33158  * Checks if two FundingCreateds contain equal inner contents.
33159  * This ignores pointers and is_owned flags and looks at the values in fields.
33160  * Two objects with NULL inner values will be considered "equal" here.
33161  */
33162 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
33163
33164 /**
33165  * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
33166  */
33167 void FundingSigned_free(struct LDKFundingSigned this_obj);
33168
33169 /**
33170  * The channel ID
33171  */
33172 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
33173
33174 /**
33175  * The channel ID
33176  */
33177 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33178
33179 /**
33180  * The signature of the channel acceptor (fundee) on the initial commitment transaction
33181  */
33182 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
33183
33184 /**
33185  * The signature of the channel acceptor (fundee) on the initial commitment transaction
33186  */
33187 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33188
33189 /**
33190  * Constructs a new FundingSigned given each field
33191  */
33192 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg);
33193
33194 /**
33195  * Creates a copy of the FundingSigned
33196  */
33197 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
33198
33199 /**
33200  * Checks if two FundingSigneds contain equal inner contents.
33201  * This ignores pointers and is_owned flags and looks at the values in fields.
33202  * Two objects with NULL inner values will be considered "equal" here.
33203  */
33204 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
33205
33206 /**
33207  * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
33208  */
33209 void ChannelReady_free(struct LDKChannelReady this_obj);
33210
33211 /**
33212  * The channel ID
33213  */
33214 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
33215
33216 /**
33217  * The channel ID
33218  */
33219 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33220
33221 /**
33222  * The per-commitment point of the second commitment transaction
33223  */
33224 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
33225
33226 /**
33227  * The per-commitment point of the second commitment transaction
33228  */
33229 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33230
33231 /**
33232  * If set, provides a `short_channel_id` alias for this channel.
33233  *
33234  * The sender will accept payments to be forwarded over this SCID and forward them to this
33235  * messages' recipient.
33236  */
33237 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
33238
33239 /**
33240  * If set, provides a `short_channel_id` alias for this channel.
33241  *
33242  * The sender will accept payments to be forwarded over this SCID and forward them to this
33243  * messages' recipient.
33244  */
33245 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33246
33247 /**
33248  * Constructs a new ChannelReady given each field
33249  */
33250 MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
33251
33252 /**
33253  * Creates a copy of the ChannelReady
33254  */
33255 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
33256
33257 /**
33258  * Checks if two ChannelReadys contain equal inner contents.
33259  * This ignores pointers and is_owned flags and looks at the values in fields.
33260  * Two objects with NULL inner values will be considered "equal" here.
33261  */
33262 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
33263
33264 /**
33265  * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
33266  */
33267 void TxAddInput_free(struct LDKTxAddInput this_obj);
33268
33269 /**
33270  * The channel ID
33271  */
33272 const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32];
33273
33274 /**
33275  * The channel ID
33276  */
33277 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33278
33279 /**
33280  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
33281  * non-initiators.
33282  */
33283 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
33284
33285 /**
33286  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
33287  * non-initiators.
33288  */
33289 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
33290
33291 /**
33292  * Serialized transaction that contains the output this input spends to verify that it is non
33293  * malleable.
33294  */
33295 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
33296
33297 /**
33298  * Serialized transaction that contains the output this input spends to verify that it is non
33299  * malleable.
33300  */
33301 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
33302
33303 /**
33304  * The index of the output being spent
33305  */
33306 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
33307
33308 /**
33309  * The index of the output being spent
33310  */
33311 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
33312
33313 /**
33314  * The sequence number of this input
33315  */
33316 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
33317
33318 /**
33319  * The sequence number of this input
33320  */
33321 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
33322
33323 /**
33324  * Constructs a new TxAddInput given each field
33325  */
33326 MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg);
33327
33328 /**
33329  * Creates a copy of the TxAddInput
33330  */
33331 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
33332
33333 /**
33334  * Checks if two TxAddInputs contain equal inner contents.
33335  * This ignores pointers and is_owned flags and looks at the values in fields.
33336  * Two objects with NULL inner values will be considered "equal" here.
33337  */
33338 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
33339
33340 /**
33341  * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
33342  */
33343 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
33344
33345 /**
33346  * The channel ID
33347  */
33348 const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32];
33349
33350 /**
33351  * The channel ID
33352  */
33353 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33354
33355 /**
33356  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
33357  * non-initiators.
33358  */
33359 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
33360
33361 /**
33362  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
33363  * non-initiators.
33364  */
33365 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
33366
33367 /**
33368  * The satoshi value of the output
33369  */
33370 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
33371
33372 /**
33373  * The satoshi value of the output
33374  */
33375 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
33376
33377 /**
33378  * The scriptPubKey for the output
33379  */
33380 struct LDKu8slice TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
33381
33382 /**
33383  * The scriptPubKey for the output
33384  */
33385 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33386
33387 /**
33388  * Constructs a new TxAddOutput given each field
33389  */
33390 MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
33391
33392 /**
33393  * Creates a copy of the TxAddOutput
33394  */
33395 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
33396
33397 /**
33398  * Checks if two TxAddOutputs contain equal inner contents.
33399  * This ignores pointers and is_owned flags and looks at the values in fields.
33400  * Two objects with NULL inner values will be considered "equal" here.
33401  */
33402 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
33403
33404 /**
33405  * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
33406  */
33407 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
33408
33409 /**
33410  * The channel ID
33411  */
33412 const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32];
33413
33414 /**
33415  * The channel ID
33416  */
33417 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33418
33419 /**
33420  * The serial ID of the input to be removed
33421  */
33422 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
33423
33424 /**
33425  * The serial ID of the input to be removed
33426  */
33427 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
33428
33429 /**
33430  * Constructs a new TxRemoveInput given each field
33431  */
33432 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
33433
33434 /**
33435  * Creates a copy of the TxRemoveInput
33436  */
33437 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
33438
33439 /**
33440  * Checks if two TxRemoveInputs contain equal inner contents.
33441  * This ignores pointers and is_owned flags and looks at the values in fields.
33442  * Two objects with NULL inner values will be considered "equal" here.
33443  */
33444 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
33445
33446 /**
33447  * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
33448  */
33449 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
33450
33451 /**
33452  * The channel ID
33453  */
33454 const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32];
33455
33456 /**
33457  * The channel ID
33458  */
33459 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33460
33461 /**
33462  * The serial ID of the output to be removed
33463  */
33464 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
33465
33466 /**
33467  * The serial ID of the output to be removed
33468  */
33469 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
33470
33471 /**
33472  * Constructs a new TxRemoveOutput given each field
33473  */
33474 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
33475
33476 /**
33477  * Creates a copy of the TxRemoveOutput
33478  */
33479 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
33480
33481 /**
33482  * Checks if two TxRemoveOutputs contain equal inner contents.
33483  * This ignores pointers and is_owned flags and looks at the values in fields.
33484  * Two objects with NULL inner values will be considered "equal" here.
33485  */
33486 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
33487
33488 /**
33489  * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
33490  */
33491 void TxComplete_free(struct LDKTxComplete this_obj);
33492
33493 /**
33494  * The channel ID
33495  */
33496 const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32];
33497
33498 /**
33499  * The channel ID
33500  */
33501 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33502
33503 /**
33504  * Constructs a new TxComplete given each field
33505  */
33506 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg);
33507
33508 /**
33509  * Creates a copy of the TxComplete
33510  */
33511 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
33512
33513 /**
33514  * Checks if two TxCompletes contain equal inner contents.
33515  * This ignores pointers and is_owned flags and looks at the values in fields.
33516  * Two objects with NULL inner values will be considered "equal" here.
33517  */
33518 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
33519
33520 /**
33521  * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
33522  */
33523 void TxSignatures_free(struct LDKTxSignatures this_obj);
33524
33525 /**
33526  * The channel ID
33527  */
33528 const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
33529
33530 /**
33531  * The channel ID
33532  */
33533 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33534
33535 /**
33536  * The TXID
33537  */
33538 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
33539
33540 /**
33541  * The TXID
33542  */
33543 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33544
33545 /**
33546  * The list of witnesses
33547  *
33548  * Returns a copy of the field.
33549  */
33550 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
33551
33552 /**
33553  * The list of witnesses
33554  */
33555 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
33556
33557 /**
33558  * Constructs a new TxSignatures given each field
33559  */
33560 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg);
33561
33562 /**
33563  * Creates a copy of the TxSignatures
33564  */
33565 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
33566
33567 /**
33568  * Checks if two TxSignaturess contain equal inner contents.
33569  * This ignores pointers and is_owned flags and looks at the values in fields.
33570  * Two objects with NULL inner values will be considered "equal" here.
33571  */
33572 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
33573
33574 /**
33575  * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
33576  */
33577 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
33578
33579 /**
33580  * The channel ID
33581  */
33582 const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32];
33583
33584 /**
33585  * The channel ID
33586  */
33587 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33588
33589 /**
33590  * The locktime of the transaction
33591  */
33592 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33593
33594 /**
33595  * The locktime of the transaction
33596  */
33597 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
33598
33599 /**
33600  * The feerate of the transaction
33601  */
33602 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33603
33604 /**
33605  * The feerate of the transaction
33606  */
33607 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
33608
33609 /**
33610  * The number of satoshis the sender will contribute to or, if negative, remove from
33611  * (e.g. splice-out) the funding output of the transaction
33612  */
33613 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33614
33615 /**
33616  * The number of satoshis the sender will contribute to or, if negative, remove from
33617  * (e.g. splice-out) the funding output of the transaction
33618  */
33619 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
33620
33621 /**
33622  * Constructs a new TxInitRbf given each field
33623  */
33624 MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
33625
33626 /**
33627  * Creates a copy of the TxInitRbf
33628  */
33629 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
33630
33631 /**
33632  * Checks if two TxInitRbfs contain equal inner contents.
33633  * This ignores pointers and is_owned flags and looks at the values in fields.
33634  * Two objects with NULL inner values will be considered "equal" here.
33635  */
33636 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
33637
33638 /**
33639  * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
33640  */
33641 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
33642
33643 /**
33644  * The channel ID
33645  */
33646 const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32];
33647
33648 /**
33649  * The channel ID
33650  */
33651 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33652
33653 /**
33654  * The number of satoshis the sender will contribute to or, if negative, remove from
33655  * (e.g. splice-out) the funding output of the transaction
33656  */
33657 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
33658
33659 /**
33660  * The number of satoshis the sender will contribute to or, if negative, remove from
33661  * (e.g. splice-out) the funding output of the transaction
33662  */
33663 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
33664
33665 /**
33666  * Constructs a new TxAckRbf given each field
33667  */
33668 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
33669
33670 /**
33671  * Creates a copy of the TxAckRbf
33672  */
33673 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
33674
33675 /**
33676  * Checks if two TxAckRbfs contain equal inner contents.
33677  * This ignores pointers and is_owned flags and looks at the values in fields.
33678  * Two objects with NULL inner values will be considered "equal" here.
33679  */
33680 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
33681
33682 /**
33683  * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
33684  */
33685 void TxAbort_free(struct LDKTxAbort this_obj);
33686
33687 /**
33688  * The channel ID
33689  */
33690 const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32];
33691
33692 /**
33693  * The channel ID
33694  */
33695 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33696
33697 /**
33698  * Message data
33699  *
33700  * Returns a copy of the field.
33701  */
33702 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
33703
33704 /**
33705  * Message data
33706  */
33707 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33708
33709 /**
33710  * Constructs a new TxAbort given each field
33711  */
33712 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
33713
33714 /**
33715  * Creates a copy of the TxAbort
33716  */
33717 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
33718
33719 /**
33720  * Checks if two TxAborts contain equal inner contents.
33721  * This ignores pointers and is_owned flags and looks at the values in fields.
33722  * Two objects with NULL inner values will be considered "equal" here.
33723  */
33724 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
33725
33726 /**
33727  * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
33728  */
33729 void Shutdown_free(struct LDKShutdown this_obj);
33730
33731 /**
33732  * The channel ID
33733  */
33734 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
33735
33736 /**
33737  * The channel ID
33738  */
33739 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33740
33741 /**
33742  * The destination of this peer's funds on closing.
33743  *
33744  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
33745  */
33746 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
33747
33748 /**
33749  * The destination of this peer's funds on closing.
33750  *
33751  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
33752  */
33753 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33754
33755 /**
33756  * Constructs a new Shutdown given each field
33757  */
33758 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
33759
33760 /**
33761  * Creates a copy of the Shutdown
33762  */
33763 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
33764
33765 /**
33766  * Checks if two Shutdowns contain equal inner contents.
33767  * This ignores pointers and is_owned flags and looks at the values in fields.
33768  * Two objects with NULL inner values will be considered "equal" here.
33769  */
33770 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
33771
33772 /**
33773  * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
33774  */
33775 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
33776
33777 /**
33778  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33779  * transaction.
33780  */
33781 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
33782
33783 /**
33784  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33785  * transaction.
33786  */
33787 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
33788
33789 /**
33790  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
33791  * transaction.
33792  */
33793 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
33794
33795 /**
33796  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
33797  * transaction.
33798  */
33799 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
33800
33801 /**
33802  * Constructs a new ClosingSignedFeeRange given each field
33803  */
33804 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
33805
33806 /**
33807  * Creates a copy of the ClosingSignedFeeRange
33808  */
33809 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
33810
33811 /**
33812  * Checks if two ClosingSignedFeeRanges contain equal inner contents.
33813  * This ignores pointers and is_owned flags and looks at the values in fields.
33814  * Two objects with NULL inner values will be considered "equal" here.
33815  */
33816 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
33817
33818 /**
33819  * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
33820  */
33821 void ClosingSigned_free(struct LDKClosingSigned this_obj);
33822
33823 /**
33824  * The channel ID
33825  */
33826 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
33827
33828 /**
33829  * The channel ID
33830  */
33831 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33832
33833 /**
33834  * The proposed total fee for the closing transaction
33835  */
33836 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33837
33838 /**
33839  * The proposed total fee for the closing transaction
33840  */
33841 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
33842
33843 /**
33844  * A signature on the closing transaction
33845  */
33846 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33847
33848 /**
33849  * A signature on the closing transaction
33850  */
33851 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33852
33853 /**
33854  * The minimum and maximum fees which the sender is willing to accept, provided only by new
33855  * nodes.
33856  *
33857  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33858  */
33859 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33860
33861 /**
33862  * The minimum and maximum fees which the sender is willing to accept, provided only by new
33863  * nodes.
33864  *
33865  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33866  */
33867 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
33868
33869 /**
33870  * Constructs a new ClosingSigned given each field
33871  *
33872  * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33873  */
33874 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
33875
33876 /**
33877  * Creates a copy of the ClosingSigned
33878  */
33879 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
33880
33881 /**
33882  * Checks if two ClosingSigneds contain equal inner contents.
33883  * This ignores pointers and is_owned flags and looks at the values in fields.
33884  * Two objects with NULL inner values will be considered "equal" here.
33885  */
33886 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
33887
33888 /**
33889  * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
33890  */
33891 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
33892
33893 /**
33894  * The channel ID
33895  */
33896 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
33897
33898 /**
33899  * The channel ID
33900  */
33901 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33902
33903 /**
33904  * The HTLC ID
33905  */
33906 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33907
33908 /**
33909  * The HTLC ID
33910  */
33911 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
33912
33913 /**
33914  * The HTLC value in milli-satoshi
33915  */
33916 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33917
33918 /**
33919  * The HTLC value in milli-satoshi
33920  */
33921 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
33922
33923 /**
33924  * The payment hash, the pre-image of which controls HTLC redemption
33925  */
33926 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
33927
33928 /**
33929  * The payment hash, the pre-image of which controls HTLC redemption
33930  */
33931 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33932
33933 /**
33934  * The expiry height of the HTLC
33935  */
33936 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33937
33938 /**
33939  * The expiry height of the HTLC
33940  */
33941 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
33942
33943 /**
33944  * The extra fee skimmed by the sender of this message. See
33945  * [`ChannelConfig::accept_underpaying_htlcs`].
33946  *
33947  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
33948  */
33949 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33950
33951 /**
33952  * The extra fee skimmed by the sender of this message. See
33953  * [`ChannelConfig::accept_underpaying_htlcs`].
33954  *
33955  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
33956  */
33957 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33958
33959 /**
33960  * Creates a copy of the UpdateAddHTLC
33961  */
33962 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
33963
33964 /**
33965  * Checks if two UpdateAddHTLCs contain equal inner contents.
33966  * This ignores pointers and is_owned flags and looks at the values in fields.
33967  * Two objects with NULL inner values will be considered "equal" here.
33968  */
33969 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
33970
33971 /**
33972  * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
33973  */
33974 void OnionMessage_free(struct LDKOnionMessage this_obj);
33975
33976 /**
33977  * Used in decrypting the onion packet's payload.
33978  */
33979 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
33980
33981 /**
33982  * Used in decrypting the onion packet's payload.
33983  */
33984 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33985
33986 /**
33987  * The full onion packet including hop data, pubkey, and hmac
33988  */
33989 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
33990
33991 /**
33992  * The full onion packet including hop data, pubkey, and hmac
33993  */
33994 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
33995
33996 /**
33997  * Constructs a new OnionMessage given each field
33998  */
33999 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
34000
34001 /**
34002  * Creates a copy of the OnionMessage
34003  */
34004 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
34005
34006 /**
34007  * Checks if two OnionMessages contain equal inner contents.
34008  * This ignores pointers and is_owned flags and looks at the values in fields.
34009  * Two objects with NULL inner values will be considered "equal" here.
34010  */
34011 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
34012
34013 /**
34014  * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
34015  */
34016 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
34017
34018 /**
34019  * The channel ID
34020  */
34021 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
34022
34023 /**
34024  * The channel ID
34025  */
34026 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34027
34028 /**
34029  * The HTLC ID
34030  */
34031 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
34032
34033 /**
34034  * The HTLC ID
34035  */
34036 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
34037
34038 /**
34039  * The pre-image of the payment hash, allowing HTLC redemption
34040  */
34041 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
34042
34043 /**
34044  * The pre-image of the payment hash, allowing HTLC redemption
34045  */
34046 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34047
34048 /**
34049  * Constructs a new UpdateFulfillHTLC given each field
34050  */
34051 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
34052
34053 /**
34054  * Creates a copy of the UpdateFulfillHTLC
34055  */
34056 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
34057
34058 /**
34059  * Checks if two UpdateFulfillHTLCs contain equal inner contents.
34060  * This ignores pointers and is_owned flags and looks at the values in fields.
34061  * Two objects with NULL inner values will be considered "equal" here.
34062  */
34063 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
34064
34065 /**
34066  * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
34067  */
34068 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
34069
34070 /**
34071  * The channel ID
34072  */
34073 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
34074
34075 /**
34076  * The channel ID
34077  */
34078 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34079
34080 /**
34081  * The HTLC ID
34082  */
34083 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
34084
34085 /**
34086  * The HTLC ID
34087  */
34088 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
34089
34090 /**
34091  * Creates a copy of the UpdateFailHTLC
34092  */
34093 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
34094
34095 /**
34096  * Checks if two UpdateFailHTLCs contain equal inner contents.
34097  * This ignores pointers and is_owned flags and looks at the values in fields.
34098  * Two objects with NULL inner values will be considered "equal" here.
34099  */
34100 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
34101
34102 /**
34103  * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
34104  */
34105 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
34106
34107 /**
34108  * The channel ID
34109  */
34110 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
34111
34112 /**
34113  * The channel ID
34114  */
34115 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34116
34117 /**
34118  * The HTLC ID
34119  */
34120 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
34121
34122 /**
34123  * The HTLC ID
34124  */
34125 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
34126
34127 /**
34128  * The failure code
34129  */
34130 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
34131
34132 /**
34133  * The failure code
34134  */
34135 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
34136
34137 /**
34138  * Creates a copy of the UpdateFailMalformedHTLC
34139  */
34140 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
34141
34142 /**
34143  * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
34144  * This ignores pointers and is_owned flags and looks at the values in fields.
34145  * Two objects with NULL inner values will be considered "equal" here.
34146  */
34147 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
34148
34149 /**
34150  * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
34151  */
34152 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
34153
34154 /**
34155  * The channel ID
34156  */
34157 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
34158
34159 /**
34160  * The channel ID
34161  */
34162 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34163
34164 /**
34165  * A signature on the commitment transaction
34166  */
34167 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
34168
34169 /**
34170  * A signature on the commitment transaction
34171  */
34172 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34173
34174 /**
34175  * Signatures on the HTLC transactions
34176  *
34177  * Returns a copy of the field.
34178  */
34179 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
34180
34181 /**
34182  * Signatures on the HTLC transactions
34183  */
34184 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
34185
34186 /**
34187  * Constructs a new CommitmentSigned given each field
34188  */
34189 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
34190
34191 /**
34192  * Creates a copy of the CommitmentSigned
34193  */
34194 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
34195
34196 /**
34197  * Checks if two CommitmentSigneds contain equal inner contents.
34198  * This ignores pointers and is_owned flags and looks at the values in fields.
34199  * Two objects with NULL inner values will be considered "equal" here.
34200  */
34201 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
34202
34203 /**
34204  * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
34205  */
34206 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
34207
34208 /**
34209  * The channel ID
34210  */
34211 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
34212
34213 /**
34214  * The channel ID
34215  */
34216 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34217
34218 /**
34219  * The secret corresponding to the per-commitment point
34220  */
34221 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
34222
34223 /**
34224  * The secret corresponding to the per-commitment point
34225  */
34226 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34227
34228 /**
34229  * The next sender-broadcast commitment transaction's per-commitment point
34230  */
34231 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
34232
34233 /**
34234  * The next sender-broadcast commitment transaction's per-commitment point
34235  */
34236 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34237
34238 /**
34239  * Constructs a new RevokeAndACK given each field
34240  */
34241 MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
34242
34243 /**
34244  * Creates a copy of the RevokeAndACK
34245  */
34246 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
34247
34248 /**
34249  * Checks if two RevokeAndACKs contain equal inner contents.
34250  * This ignores pointers and is_owned flags and looks at the values in fields.
34251  * Two objects with NULL inner values will be considered "equal" here.
34252  */
34253 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
34254
34255 /**
34256  * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
34257  */
34258 void UpdateFee_free(struct LDKUpdateFee this_obj);
34259
34260 /**
34261  * The channel ID
34262  */
34263 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
34264
34265 /**
34266  * The channel ID
34267  */
34268 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34269
34270 /**
34271  * Fee rate per 1000-weight of the transaction
34272  */
34273 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
34274
34275 /**
34276  * Fee rate per 1000-weight of the transaction
34277  */
34278 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
34279
34280 /**
34281  * Constructs a new UpdateFee given each field
34282  */
34283 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
34284
34285 /**
34286  * Creates a copy of the UpdateFee
34287  */
34288 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
34289
34290 /**
34291  * Checks if two UpdateFees contain equal inner contents.
34292  * This ignores pointers and is_owned flags and looks at the values in fields.
34293  * Two objects with NULL inner values will be considered "equal" here.
34294  */
34295 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
34296
34297 /**
34298  * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
34299  */
34300 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
34301
34302 /**
34303  * The channel ID
34304  */
34305 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
34306
34307 /**
34308  * The channel ID
34309  */
34310 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34311
34312 /**
34313  * The next commitment number for the sender
34314  */
34315 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
34316
34317 /**
34318  * The next commitment number for the sender
34319  */
34320 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
34321
34322 /**
34323  * The next commitment number for the recipient
34324  */
34325 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
34326
34327 /**
34328  * The next commitment number for the recipient
34329  */
34330 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
34331
34332 /**
34333  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
34334  * belonging to the recipient
34335  */
34336 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
34337
34338 /**
34339  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
34340  * belonging to the recipient
34341  */
34342 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34343
34344 /**
34345  * The sender's per-commitment point for their current commitment transaction
34346  */
34347 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
34348
34349 /**
34350  * The sender's per-commitment point for their current commitment transaction
34351  */
34352 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34353
34354 /**
34355  * The next funding transaction ID
34356  */
34357 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
34358
34359 /**
34360  * The next funding transaction ID
34361  */
34362 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
34363
34364 /**
34365  * Constructs a new ChannelReestablish given each field
34366  */
34367 MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg);
34368
34369 /**
34370  * Creates a copy of the ChannelReestablish
34371  */
34372 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
34373
34374 /**
34375  * Checks if two ChannelReestablishs contain equal inner contents.
34376  * This ignores pointers and is_owned flags and looks at the values in fields.
34377  * Two objects with NULL inner values will be considered "equal" here.
34378  */
34379 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
34380
34381 /**
34382  * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
34383  */
34384 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
34385
34386 /**
34387  * The channel ID
34388  */
34389 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
34390
34391 /**
34392  * The channel ID
34393  */
34394 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34395
34396 /**
34397  * The short channel ID
34398  */
34399 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
34400
34401 /**
34402  * The short channel ID
34403  */
34404 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
34405
34406 /**
34407  * A signature by the node key
34408  */
34409 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
34410
34411 /**
34412  * A signature by the node key
34413  */
34414 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34415
34416 /**
34417  * A signature by the funding key
34418  */
34419 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
34420
34421 /**
34422  * A signature by the funding key
34423  */
34424 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34425
34426 /**
34427  * Constructs a new AnnouncementSignatures given each field
34428  */
34429 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
34430
34431 /**
34432  * Creates a copy of the AnnouncementSignatures
34433  */
34434 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
34435
34436 /**
34437  * Checks if two AnnouncementSignaturess contain equal inner contents.
34438  * This ignores pointers and is_owned flags and looks at the values in fields.
34439  * Two objects with NULL inner values will be considered "equal" here.
34440  */
34441 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
34442
34443 /**
34444  * Frees any resources used by the SocketAddress
34445  */
34446 void SocketAddress_free(struct LDKSocketAddress this_ptr);
34447
34448 /**
34449  * Creates a copy of the SocketAddress
34450  */
34451 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
34452
34453 /**
34454  * Utility method to constructs a new TcpIpV4-variant SocketAddress
34455  */
34456 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
34457
34458 /**
34459  * Utility method to constructs a new TcpIpV6-variant SocketAddress
34460  */
34461 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
34462
34463 /**
34464  * Utility method to constructs a new OnionV2-variant SocketAddress
34465  */
34466 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
34467
34468 /**
34469  * Utility method to constructs a new OnionV3-variant SocketAddress
34470  */
34471 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
34472
34473 /**
34474  * Utility method to constructs a new Hostname-variant SocketAddress
34475  */
34476 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
34477
34478 /**
34479  * Checks if two SocketAddresss contain equal inner contents.
34480  * This ignores pointers and is_owned flags and looks at the values in fields.
34481  */
34482 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
34483
34484 /**
34485  * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
34486  */
34487 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
34488
34489 /**
34490  * Read a SocketAddress from a byte array, created by SocketAddress_write
34491  */
34492 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
34493
34494 /**
34495  * Creates a copy of the SocketAddressParseError
34496  */
34497 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
34498
34499 /**
34500  * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
34501  */
34502 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
34503
34504 /**
34505  * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
34506  */
34507 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
34508
34509 /**
34510  * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
34511  */
34512 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
34513
34514 /**
34515  * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
34516  */
34517 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
34518
34519 /**
34520  * Checks if two SocketAddressParseErrors contain equal inner contents.
34521  * This ignores pointers and is_owned flags and looks at the values in fields.
34522  */
34523 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
34524
34525 /**
34526  * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
34527  *
34528  * The host part must end with \".onion\".
34529  */
34530 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
34531
34532 /**
34533  * Get the string representation of a SocketAddress object
34534  */
34535 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
34536
34537 /**
34538  * Read a SocketAddress object from a string
34539  */
34540 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
34541
34542 /**
34543  * Frees any resources used by the UnsignedGossipMessage
34544  */
34545 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
34546
34547 /**
34548  * Creates a copy of the UnsignedGossipMessage
34549  */
34550 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
34551
34552 /**
34553  * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
34554  */
34555 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
34556
34557 /**
34558  * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
34559  */
34560 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
34561
34562 /**
34563  * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
34564  */
34565 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
34566
34567 /**
34568  * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
34569  */
34570 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
34571
34572 /**
34573  * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
34574  */
34575 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
34576
34577 /**
34578  * The advertised features
34579  */
34580 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34581
34582 /**
34583  * The advertised features
34584  */
34585 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
34586
34587 /**
34588  * A strictly monotonic announcement counter, with gaps allowed
34589  */
34590 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34591
34592 /**
34593  * A strictly monotonic announcement counter, with gaps allowed
34594  */
34595 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
34596
34597 /**
34598  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
34599  * to this node).
34600  */
34601 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34602
34603 /**
34604  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
34605  * to this node).
34606  */
34607 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34608
34609 /**
34610  * An RGB color for UI purposes
34611  */
34612 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
34613
34614 /**
34615  * An RGB color for UI purposes
34616  */
34617 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
34618
34619 /**
34620  * An alias, for UI purposes.
34621  *
34622  * This should be sanitized before use. There is no guarantee of uniqueness.
34623  */
34624 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34625
34626 /**
34627  * An alias, for UI purposes.
34628  *
34629  * This should be sanitized before use. There is no guarantee of uniqueness.
34630  */
34631 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
34632
34633 /**
34634  * List of addresses on which this node is reachable
34635  *
34636  * Returns a copy of the field.
34637  */
34638 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34639
34640 /**
34641  * List of addresses on which this node is reachable
34642  */
34643 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
34644
34645 /**
34646  * Creates a copy of the UnsignedNodeAnnouncement
34647  */
34648 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
34649
34650 /**
34651  * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
34652  * This ignores pointers and is_owned flags and looks at the values in fields.
34653  * Two objects with NULL inner values will be considered "equal" here.
34654  */
34655 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
34656
34657 /**
34658  * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
34659  */
34660 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
34661
34662 /**
34663  * The signature by the node key
34664  */
34665 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
34666
34667 /**
34668  * The signature by the node key
34669  */
34670 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34671
34672 /**
34673  * The actual content of the announcement
34674  */
34675 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
34676
34677 /**
34678  * The actual content of the announcement
34679  */
34680 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
34681
34682 /**
34683  * Constructs a new NodeAnnouncement given each field
34684  */
34685 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
34686
34687 /**
34688  * Creates a copy of the NodeAnnouncement
34689  */
34690 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
34691
34692 /**
34693  * Checks if two NodeAnnouncements contain equal inner contents.
34694  * This ignores pointers and is_owned flags and looks at the values in fields.
34695  * Two objects with NULL inner values will be considered "equal" here.
34696  */
34697 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
34698
34699 /**
34700  * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
34701  */
34702 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
34703
34704 /**
34705  * The advertised channel features
34706  */
34707 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34708
34709 /**
34710  * The advertised channel features
34711  */
34712 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
34713
34714 /**
34715  * The genesis hash of the blockchain where the channel is to be opened
34716  */
34717 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
34718
34719 /**
34720  * The genesis hash of the blockchain where the channel is to be opened
34721  */
34722 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34723
34724 /**
34725  * The short channel ID
34726  */
34727 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34728
34729 /**
34730  * The short channel ID
34731  */
34732 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
34733
34734 /**
34735  * One of the two `node_id`s which are endpoints of this channel
34736  */
34737 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34738
34739 /**
34740  * One of the two `node_id`s which are endpoints of this channel
34741  */
34742 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34743
34744 /**
34745  * The other of the two `node_id`s which are endpoints of this channel
34746  */
34747 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34748
34749 /**
34750  * The other of the two `node_id`s which are endpoints of this channel
34751  */
34752 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34753
34754 /**
34755  * The funding key for the first node
34756  */
34757 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34758
34759 /**
34760  * The funding key for the first node
34761  */
34762 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34763
34764 /**
34765  * The funding key for the second node
34766  */
34767 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34768
34769 /**
34770  * The funding key for the second node
34771  */
34772 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34773
34774 /**
34775  * Excess data which was signed as a part of the message which we do not (yet) understand how
34776  * to decode.
34777  *
34778  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34779  *
34780  * Returns a copy of the field.
34781  */
34782 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34783
34784 /**
34785  * Excess data which was signed as a part of the message which we do not (yet) understand how
34786  * to decode.
34787  *
34788  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34789  */
34790 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
34791
34792 /**
34793  * Constructs a new UnsignedChannelAnnouncement given each field
34794  */
34795 MUST_USE_RES struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_new(struct LDKChannelFeatures features_arg, struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, struct LDKNodeId node_id_1_arg, struct LDKNodeId node_id_2_arg, struct LDKNodeId bitcoin_key_1_arg, struct LDKNodeId bitcoin_key_2_arg, struct LDKCVec_u8Z excess_data_arg);
34796
34797 /**
34798  * Creates a copy of the UnsignedChannelAnnouncement
34799  */
34800 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
34801
34802 /**
34803  * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
34804  * This ignores pointers and is_owned flags and looks at the values in fields.
34805  * Two objects with NULL inner values will be considered "equal" here.
34806  */
34807 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
34808
34809 /**
34810  * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
34811  */
34812 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
34813
34814 /**
34815  * Authentication of the announcement by the first public node
34816  */
34817 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34818
34819 /**
34820  * Authentication of the announcement by the first public node
34821  */
34822 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34823
34824 /**
34825  * Authentication of the announcement by the second public node
34826  */
34827 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34828
34829 /**
34830  * Authentication of the announcement by the second public node
34831  */
34832 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34833
34834 /**
34835  * Proof of funding UTXO ownership by the first public node
34836  */
34837 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34838
34839 /**
34840  * Proof of funding UTXO ownership by the first public node
34841  */
34842 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34843
34844 /**
34845  * Proof of funding UTXO ownership by the second public node
34846  */
34847 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34848
34849 /**
34850  * Proof of funding UTXO ownership by the second public node
34851  */
34852 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34853
34854 /**
34855  * The actual announcement
34856  */
34857 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34858
34859 /**
34860  * The actual announcement
34861  */
34862 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
34863
34864 /**
34865  * Constructs a new ChannelAnnouncement given each field
34866  */
34867 MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKECDSASignature node_signature_1_arg, struct LDKECDSASignature node_signature_2_arg, struct LDKECDSASignature bitcoin_signature_1_arg, struct LDKECDSASignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
34868
34869 /**
34870  * Creates a copy of the ChannelAnnouncement
34871  */
34872 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
34873
34874 /**
34875  * Checks if two ChannelAnnouncements contain equal inner contents.
34876  * This ignores pointers and is_owned flags and looks at the values in fields.
34877  * Two objects with NULL inner values will be considered "equal" here.
34878  */
34879 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
34880
34881 /**
34882  * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
34883  */
34884 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
34885
34886 /**
34887  * The genesis hash of the blockchain where the channel is to be opened
34888  */
34889 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
34890
34891 /**
34892  * The genesis hash of the blockchain where the channel is to be opened
34893  */
34894 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34895
34896 /**
34897  * The short channel ID
34898  */
34899 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34900
34901 /**
34902  * The short channel ID
34903  */
34904 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34905
34906 /**
34907  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
34908  */
34909 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34910
34911 /**
34912  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
34913  */
34914 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34915
34916 /**
34917  * Channel flags
34918  */
34919 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34920
34921 /**
34922  * Channel flags
34923  */
34924 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
34925
34926 /**
34927  * The number of blocks such that if:
34928  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
34929  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
34930  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
34931  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
34932  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
34933  * forwarding. Note that the HTLC sender is the one who originally sets this value when
34934  * constructing the route.
34935  */
34936 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34937
34938 /**
34939  * The number of blocks such that if:
34940  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
34941  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
34942  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
34943  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
34944  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
34945  * forwarding. Note that the HTLC sender is the one who originally sets this value when
34946  * constructing the route.
34947  */
34948 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
34949
34950 /**
34951  * The minimum HTLC size incoming to sender, in milli-satoshi
34952  */
34953 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34954
34955 /**
34956  * The minimum HTLC size incoming to sender, in milli-satoshi
34957  */
34958 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34959
34960 /**
34961  * The maximum HTLC value incoming to sender, in milli-satoshi.
34962  *
34963  * This used to be optional.
34964  */
34965 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34966
34967 /**
34968  * The maximum HTLC value incoming to sender, in milli-satoshi.
34969  *
34970  * This used to be optional.
34971  */
34972 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34973
34974 /**
34975  * The base HTLC fee charged by sender, in milli-satoshi
34976  */
34977 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34978
34979 /**
34980  * The base HTLC fee charged by sender, in milli-satoshi
34981  */
34982 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34983
34984 /**
34985  * The amount to fee multiplier, in micro-satoshi
34986  */
34987 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34988
34989 /**
34990  * The amount to fee multiplier, in micro-satoshi
34991  */
34992 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34993
34994 /**
34995  * Excess data which was signed as a part of the message which we do not (yet) understand how
34996  * to decode.
34997  *
34998  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34999  *
35000  * Returns a copy of the field.
35001  */
35002 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
35003
35004 /**
35005  * Excess data which was signed as a part of the message which we do not (yet) understand how
35006  * to decode.
35007  *
35008  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
35009  */
35010 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
35011
35012 /**
35013  * Constructs a new UnsignedChannelUpdate given each field
35014  */
35015 MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg);
35016
35017 /**
35018  * Creates a copy of the UnsignedChannelUpdate
35019  */
35020 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
35021
35022 /**
35023  * Checks if two UnsignedChannelUpdates contain equal inner contents.
35024  * This ignores pointers and is_owned flags and looks at the values in fields.
35025  * Two objects with NULL inner values will be considered "equal" here.
35026  */
35027 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
35028
35029 /**
35030  * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
35031  */
35032 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
35033
35034 /**
35035  * A signature of the channel update
35036  */
35037 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
35038
35039 /**
35040  * A signature of the channel update
35041  */
35042 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
35043
35044 /**
35045  * The actual channel update
35046  */
35047 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
35048
35049 /**
35050  * The actual channel update
35051  */
35052 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
35053
35054 /**
35055  * Constructs a new ChannelUpdate given each field
35056  */
35057 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
35058
35059 /**
35060  * Creates a copy of the ChannelUpdate
35061  */
35062 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
35063
35064 /**
35065  * Checks if two ChannelUpdates contain equal inner contents.
35066  * This ignores pointers and is_owned flags and looks at the values in fields.
35067  * Two objects with NULL inner values will be considered "equal" here.
35068  */
35069 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
35070
35071 /**
35072  * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
35073  */
35074 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
35075
35076 /**
35077  * The genesis hash of the blockchain being queried
35078  */
35079 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
35080
35081 /**
35082  * The genesis hash of the blockchain being queried
35083  */
35084 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35085
35086 /**
35087  * The height of the first block for the channel UTXOs being queried
35088  */
35089 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
35090
35091 /**
35092  * The height of the first block for the channel UTXOs being queried
35093  */
35094 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
35095
35096 /**
35097  * The number of blocks to include in the query results
35098  */
35099 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
35100
35101 /**
35102  * The number of blocks to include in the query results
35103  */
35104 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
35105
35106 /**
35107  * Constructs a new QueryChannelRange given each field
35108  */
35109 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
35110
35111 /**
35112  * Creates a copy of the QueryChannelRange
35113  */
35114 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
35115
35116 /**
35117  * Checks if two QueryChannelRanges contain equal inner contents.
35118  * This ignores pointers and is_owned flags and looks at the values in fields.
35119  * Two objects with NULL inner values will be considered "equal" here.
35120  */
35121 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
35122
35123 /**
35124  * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
35125  */
35126 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
35127
35128 /**
35129  * The genesis hash of the blockchain being queried
35130  */
35131 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
35132
35133 /**
35134  * The genesis hash of the blockchain being queried
35135  */
35136 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35137
35138 /**
35139  * The height of the first block in the range of the reply
35140  */
35141 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
35142
35143 /**
35144  * The height of the first block in the range of the reply
35145  */
35146 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
35147
35148 /**
35149  * The number of blocks included in the range of the reply
35150  */
35151 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
35152
35153 /**
35154  * The number of blocks included in the range of the reply
35155  */
35156 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
35157
35158 /**
35159  * True when this is the final reply for a query
35160  */
35161 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
35162
35163 /**
35164  * True when this is the final reply for a query
35165  */
35166 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
35167
35168 /**
35169  * The `short_channel_id`s in the channel range
35170  *
35171  * Returns a copy of the field.
35172  */
35173 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
35174
35175 /**
35176  * The `short_channel_id`s in the channel range
35177  */
35178 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
35179
35180 /**
35181  * Constructs a new ReplyChannelRange given each field
35182  */
35183 MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg);
35184
35185 /**
35186  * Creates a copy of the ReplyChannelRange
35187  */
35188 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
35189
35190 /**
35191  * Checks if two ReplyChannelRanges contain equal inner contents.
35192  * This ignores pointers and is_owned flags and looks at the values in fields.
35193  * Two objects with NULL inner values will be considered "equal" here.
35194  */
35195 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
35196
35197 /**
35198  * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
35199  */
35200 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
35201
35202 /**
35203  * The genesis hash of the blockchain being queried
35204  */
35205 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
35206
35207 /**
35208  * The genesis hash of the blockchain being queried
35209  */
35210 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35211
35212 /**
35213  * The short_channel_ids that are being queried
35214  *
35215  * Returns a copy of the field.
35216  */
35217 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
35218
35219 /**
35220  * The short_channel_ids that are being queried
35221  */
35222 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
35223
35224 /**
35225  * Constructs a new QueryShortChannelIds given each field
35226  */
35227 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
35228
35229 /**
35230  * Creates a copy of the QueryShortChannelIds
35231  */
35232 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
35233
35234 /**
35235  * Checks if two QueryShortChannelIdss contain equal inner contents.
35236  * This ignores pointers and is_owned flags and looks at the values in fields.
35237  * Two objects with NULL inner values will be considered "equal" here.
35238  */
35239 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
35240
35241 /**
35242  * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
35243  */
35244 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
35245
35246 /**
35247  * The genesis hash of the blockchain that was queried
35248  */
35249 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
35250
35251 /**
35252  * The genesis hash of the blockchain that was queried
35253  */
35254 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35255
35256 /**
35257  * Indicates if the query recipient maintains up-to-date channel
35258  * information for the `chain_hash`
35259  */
35260 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
35261
35262 /**
35263  * Indicates if the query recipient maintains up-to-date channel
35264  * information for the `chain_hash`
35265  */
35266 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
35267
35268 /**
35269  * Constructs a new ReplyShortChannelIdsEnd given each field
35270  */
35271 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
35272
35273 /**
35274  * Creates a copy of the ReplyShortChannelIdsEnd
35275  */
35276 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
35277
35278 /**
35279  * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
35280  * This ignores pointers and is_owned flags and looks at the values in fields.
35281  * Two objects with NULL inner values will be considered "equal" here.
35282  */
35283 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
35284
35285 /**
35286  * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
35287  */
35288 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
35289
35290 /**
35291  * The genesis hash of the blockchain for channel and node information
35292  */
35293 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
35294
35295 /**
35296  * The genesis hash of the blockchain for channel and node information
35297  */
35298 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35299
35300 /**
35301  * The starting unix timestamp
35302  */
35303 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
35304
35305 /**
35306  * The starting unix timestamp
35307  */
35308 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
35309
35310 /**
35311  * The range of information in seconds
35312  */
35313 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
35314
35315 /**
35316  * The range of information in seconds
35317  */
35318 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
35319
35320 /**
35321  * Constructs a new GossipTimestampFilter given each field
35322  */
35323 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
35324
35325 /**
35326  * Creates a copy of the GossipTimestampFilter
35327  */
35328 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
35329
35330 /**
35331  * Checks if two GossipTimestampFilters contain equal inner contents.
35332  * This ignores pointers and is_owned flags and looks at the values in fields.
35333  * Two objects with NULL inner values will be considered "equal" here.
35334  */
35335 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
35336
35337 /**
35338  * Frees any resources used by the ErrorAction
35339  */
35340 void ErrorAction_free(struct LDKErrorAction this_ptr);
35341
35342 /**
35343  * Creates a copy of the ErrorAction
35344  */
35345 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
35346
35347 /**
35348  * Utility method to constructs a new DisconnectPeer-variant ErrorAction
35349  */
35350 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
35351
35352 /**
35353  * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
35354  */
35355 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
35356
35357 /**
35358  * Utility method to constructs a new IgnoreError-variant ErrorAction
35359  */
35360 struct LDKErrorAction ErrorAction_ignore_error(void);
35361
35362 /**
35363  * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
35364  */
35365 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
35366
35367 /**
35368  * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
35369  */
35370 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
35371
35372 /**
35373  * Utility method to constructs a new SendErrorMessage-variant ErrorAction
35374  */
35375 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
35376
35377 /**
35378  * Utility method to constructs a new SendWarningMessage-variant ErrorAction
35379  */
35380 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
35381
35382 /**
35383  * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
35384  */
35385 void LightningError_free(struct LDKLightningError this_obj);
35386
35387 /**
35388  * A human-readable message describing the error
35389  */
35390 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
35391
35392 /**
35393  * A human-readable message describing the error
35394  */
35395 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
35396
35397 /**
35398  * The action which should be taken against the offending peer.
35399  */
35400 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
35401
35402 /**
35403  * The action which should be taken against the offending peer.
35404  */
35405 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
35406
35407 /**
35408  * Constructs a new LightningError given each field
35409  */
35410 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
35411
35412 /**
35413  * Creates a copy of the LightningError
35414  */
35415 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
35416
35417 /**
35418  * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
35419  */
35420 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
35421
35422 /**
35423  * `update_add_htlc` messages which should be sent
35424  */
35425 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35426
35427 /**
35428  * `update_add_htlc` messages which should be sent
35429  */
35430 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
35431
35432 /**
35433  * `update_fulfill_htlc` messages which should be sent
35434  */
35435 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35436
35437 /**
35438  * `update_fulfill_htlc` messages which should be sent
35439  */
35440 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
35441
35442 /**
35443  * `update_fail_htlc` messages which should be sent
35444  */
35445 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35446
35447 /**
35448  * `update_fail_htlc` messages which should be sent
35449  */
35450 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
35451
35452 /**
35453  * `update_fail_malformed_htlc` messages which should be sent
35454  */
35455 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35456
35457 /**
35458  * `update_fail_malformed_htlc` messages which should be sent
35459  */
35460 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
35461
35462 /**
35463  * An `update_fee` message which should be sent
35464  *
35465  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35466  */
35467 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35468
35469 /**
35470  * An `update_fee` message which should be sent
35471  *
35472  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35473  */
35474 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
35475
35476 /**
35477  * A `commitment_signed` message which should be sent
35478  */
35479 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35480
35481 /**
35482  * A `commitment_signed` message which should be sent
35483  */
35484 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
35485
35486 /**
35487  * Constructs a new CommitmentUpdate given each field
35488  *
35489  * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35490  */
35491 MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg);
35492
35493 /**
35494  * Creates a copy of the CommitmentUpdate
35495  */
35496 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
35497
35498 /**
35499  * Checks if two CommitmentUpdates contain equal inner contents.
35500  * This ignores pointers and is_owned flags and looks at the values in fields.
35501  * Two objects with NULL inner values will be considered "equal" here.
35502  */
35503 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
35504
35505 /**
35506  * Calls the free function if one is set
35507  */
35508 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
35509
35510 /**
35511  * Calls the free function if one is set
35512  */
35513 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
35514
35515 /**
35516  * Calls the free function if one is set
35517  */
35518 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
35519
35520 /**
35521  * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
35522  */
35523 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
35524
35525 /**
35526  * Read a AcceptChannel from a byte array, created by AcceptChannel_write
35527  */
35528 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
35529
35530 /**
35531  * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
35532  */
35533 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
35534
35535 /**
35536  * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
35537  */
35538 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
35539
35540 /**
35541  * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
35542  */
35543 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
35544
35545 /**
35546  * Read a TxAddInput from a byte array, created by TxAddInput_write
35547  */
35548 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
35549
35550 /**
35551  * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
35552  */
35553 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
35554
35555 /**
35556  * Read a TxAddOutput from a byte array, created by TxAddOutput_write
35557  */
35558 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
35559
35560 /**
35561  * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
35562  */
35563 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
35564
35565 /**
35566  * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
35567  */
35568 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
35569
35570 /**
35571  * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
35572  */
35573 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
35574
35575 /**
35576  * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
35577  */
35578 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
35579
35580 /**
35581  * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
35582  */
35583 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
35584
35585 /**
35586  * Read a TxComplete from a byte array, created by TxComplete_write
35587  */
35588 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
35589
35590 /**
35591  * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
35592  */
35593 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
35594
35595 /**
35596  * Read a TxSignatures from a byte array, created by TxSignatures_write
35597  */
35598 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
35599
35600 /**
35601  * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
35602  */
35603 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
35604
35605 /**
35606  * Read a TxInitRbf from a byte array, created by TxInitRbf_write
35607  */
35608 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
35609
35610 /**
35611  * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
35612  */
35613 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
35614
35615 /**
35616  * Read a TxAckRbf from a byte array, created by TxAckRbf_write
35617  */
35618 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
35619
35620 /**
35621  * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
35622  */
35623 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
35624
35625 /**
35626  * Read a TxAbort from a byte array, created by TxAbort_write
35627  */
35628 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
35629
35630 /**
35631  * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
35632  */
35633 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
35634
35635 /**
35636  * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
35637  */
35638 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
35639
35640 /**
35641  * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
35642  */
35643 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
35644
35645 /**
35646  * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
35647  */
35648 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
35649
35650 /**
35651  * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
35652  */
35653 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
35654
35655 /**
35656  * Read a ClosingSigned from a byte array, created by ClosingSigned_write
35657  */
35658 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
35659
35660 /**
35661  * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
35662  */
35663 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
35664
35665 /**
35666  * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
35667  */
35668 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
35669
35670 /**
35671  * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
35672  */
35673 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
35674
35675 /**
35676  * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
35677  */
35678 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
35679
35680 /**
35681  * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
35682  */
35683 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
35684
35685 /**
35686  * Read a FundingCreated from a byte array, created by FundingCreated_write
35687  */
35688 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
35689
35690 /**
35691  * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
35692  */
35693 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
35694
35695 /**
35696  * Read a FundingSigned from a byte array, created by FundingSigned_write
35697  */
35698 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
35699
35700 /**
35701  * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
35702  */
35703 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
35704
35705 /**
35706  * Read a ChannelReady from a byte array, created by ChannelReady_write
35707  */
35708 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
35709
35710 /**
35711  * Serialize the Init object into a byte array which can be read by Init_read
35712  */
35713 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
35714
35715 /**
35716  * Read a Init from a byte array, created by Init_write
35717  */
35718 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
35719
35720 /**
35721  * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
35722  */
35723 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
35724
35725 /**
35726  * Read a OpenChannel from a byte array, created by OpenChannel_write
35727  */
35728 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
35729
35730 /**
35731  * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
35732  */
35733 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
35734
35735 /**
35736  * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
35737  */
35738 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
35739
35740 /**
35741  * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
35742  */
35743 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
35744
35745 /**
35746  * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
35747  */
35748 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
35749
35750 /**
35751  * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
35752  */
35753 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
35754
35755 /**
35756  * Read a Shutdown from a byte array, created by Shutdown_write
35757  */
35758 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
35759
35760 /**
35761  * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
35762  */
35763 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
35764
35765 /**
35766  * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
35767  */
35768 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
35769
35770 /**
35771  * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
35772  */
35773 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
35774
35775 /**
35776  * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
35777  */
35778 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
35779
35780 /**
35781  * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
35782  */
35783 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
35784
35785 /**
35786  * Read a UpdateFee from a byte array, created by UpdateFee_write
35787  */
35788 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
35789
35790 /**
35791  * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
35792  */
35793 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
35794
35795 /**
35796  * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
35797  */
35798 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
35799
35800 /**
35801  * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
35802  */
35803 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
35804
35805 /**
35806  * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
35807  */
35808 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
35809
35810 /**
35811  * Read a OnionMessage from a byte array, created by OnionMessage_write
35812  */
35813 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
35814
35815 /**
35816  * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
35817  */
35818 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
35819
35820 /**
35821  * Serialize the Ping object into a byte array which can be read by Ping_read
35822  */
35823 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
35824
35825 /**
35826  * Read a Ping from a byte array, created by Ping_write
35827  */
35828 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
35829
35830 /**
35831  * Serialize the Pong object into a byte array which can be read by Pong_read
35832  */
35833 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
35834
35835 /**
35836  * Read a Pong from a byte array, created by Pong_write
35837  */
35838 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
35839
35840 /**
35841  * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
35842  */
35843 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
35844
35845 /**
35846  * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
35847  */
35848 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
35849
35850 /**
35851  * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
35852  */
35853 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
35854
35855 /**
35856  * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
35857  */
35858 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
35859
35860 /**
35861  * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
35862  */
35863 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
35864
35865 /**
35866  * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
35867  */
35868 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
35869
35870 /**
35871  * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
35872  */
35873 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
35874
35875 /**
35876  * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
35877  */
35878 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
35879
35880 /**
35881  * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
35882  */
35883 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
35884
35885 /**
35886  * Read a ErrorMessage from a byte array, created by ErrorMessage_write
35887  */
35888 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
35889
35890 /**
35891  * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
35892  */
35893 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
35894
35895 /**
35896  * Read a WarningMessage from a byte array, created by WarningMessage_write
35897  */
35898 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
35899
35900 /**
35901  * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
35902  */
35903 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
35904
35905 /**
35906  * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
35907  */
35908 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
35909
35910 /**
35911  * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
35912  */
35913 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
35914
35915 /**
35916  * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
35917  */
35918 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
35919
35920 /**
35921  * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
35922  */
35923 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
35924
35925 /**
35926  * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
35927  */
35928 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
35929
35930 /**
35931  * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
35932  */
35933 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
35934
35935 /**
35936  * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
35937  */
35938 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
35939
35940 /**
35941  * Calculates the overflow safe ending block height for the query.
35942  *
35943  * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
35944  */
35945 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
35946
35947 /**
35948  * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
35949  */
35950 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
35951
35952 /**
35953  * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
35954  */
35955 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
35956
35957 /**
35958  * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
35959  */
35960 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
35961
35962 /**
35963  * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
35964  */
35965 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
35966
35967 /**
35968  * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
35969  */
35970 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
35971
35972 /**
35973  * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
35974  */
35975 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
35976
35977 /**
35978  * Calls the free function if one is set
35979  */
35980 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
35981
35982 /**
35983  * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
35984  */
35985 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
35986
35987 /**
35988  * Constructs a new IgnoringMessageHandler given each field
35989  */
35990 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
35991
35992 /**
35993  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
35994  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
35995  */
35996 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35997
35998 /**
35999  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
36000  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
36001  */
36002 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36003
36004 /**
36005  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
36006  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
36007  */
36008 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36009
36010 /**
36011  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
36012  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
36013  */
36014 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36015
36016 /**
36017  * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
36018  * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
36019  */
36020 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36021
36022 /**
36023  * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
36024  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
36025  */
36026 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36027
36028 /**
36029  * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
36030  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
36031  */
36032 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36033
36034 /**
36035  * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
36036  */
36037 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
36038
36039 /**
36040  * Constructs a new ErroringMessageHandler
36041  */
36042 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
36043
36044 /**
36045  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
36046  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
36047  */
36048 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
36049
36050 /**
36051  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
36052  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
36053  */
36054 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
36055
36056 /**
36057  * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
36058  */
36059 void MessageHandler_free(struct LDKMessageHandler this_obj);
36060
36061 /**
36062  * A message handler which handles messages specific to channels. Usually this is just a
36063  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
36064  *
36065  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
36066  */
36067 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
36068
36069 /**
36070  * A message handler which handles messages specific to channels. Usually this is just a
36071  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
36072  *
36073  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
36074  */
36075 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
36076
36077 /**
36078  * A message handler which handles messages updating our knowledge of the network channel
36079  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
36080  *
36081  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
36082  */
36083 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
36084
36085 /**
36086  * A message handler which handles messages updating our knowledge of the network channel
36087  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
36088  *
36089  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
36090  */
36091 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
36092
36093 /**
36094  * A message handler which handles onion messages. This should generally be an
36095  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
36096  *
36097  * [`OnionMessenger`]: crate::onion_message::OnionMessenger
36098  */
36099 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
36100
36101 /**
36102  * A message handler which handles onion messages. This should generally be an
36103  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
36104  *
36105  * [`OnionMessenger`]: crate::onion_message::OnionMessenger
36106  */
36107 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
36108
36109 /**
36110  * A message handler which handles custom messages. The only LDK-provided implementation is
36111  * [`IgnoringMessageHandler`].
36112  */
36113 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
36114
36115 /**
36116  * A message handler which handles custom messages. The only LDK-provided implementation is
36117  * [`IgnoringMessageHandler`].
36118  */
36119 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
36120
36121 /**
36122  * Constructs a new MessageHandler given each field
36123  */
36124 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg, struct LDKCustomMessageHandler custom_message_handler_arg);
36125
36126 /**
36127  * Creates a copy of a SocketDescriptor
36128  */
36129 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
36130
36131 /**
36132  * Calls the free function if one is set
36133  */
36134 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
36135
36136 /**
36137  * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
36138  */
36139 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
36140
36141 /**
36142  * Constructs a new PeerHandleError given each field
36143  */
36144 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
36145
36146 /**
36147  * Creates a copy of the PeerHandleError
36148  */
36149 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
36150
36151 /**
36152  * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
36153  */
36154 void PeerManager_free(struct LDKPeerManager this_obj);
36155
36156 /**
36157  * Constructs a new `PeerManager` with the given message handlers.
36158  *
36159  * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
36160  * cryptographically secure random bytes.
36161  *
36162  * `current_time` is used as an always-increasing counter that survives across restarts and is
36163  * incremented irregularly internally. In general it is best to simply use the current UNIX
36164  * timestamp, however if it is not available a persistent counter that increases once per
36165  * minute should suffice.
36166  */
36167 MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKNodeSigner node_signer);
36168
36169 /**
36170  * Get a list of tuples mapping from node id to network addresses for peers which have
36171  * completed the initial handshake.
36172  *
36173  * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
36174  * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
36175  * handshake has completed and we are sure the remote peer has the private key for the given
36176  * [`PublicKey`].
36177  *
36178  * The returned `Option`s will only be `Some` if an address had been previously given via
36179  * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
36180  */
36181 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
36182
36183 /**
36184  * Indicates a new outbound connection has been established to a node with the given `node_id`
36185  * and an optional remote network address.
36186  *
36187  * The remote network address adds the option to report a remote IP address back to a connecting
36188  * peer using the init message.
36189  * The user should pass the remote network address of the host they are connected to.
36190  *
36191  * If an `Err` is returned here you must disconnect the connection immediately.
36192  *
36193  * Returns a small number of bytes to send to the remote node (currently always 50).
36194  *
36195  * Panics if descriptor is duplicative with some other descriptor which has not yet been
36196  * [`socket_disconnected`].
36197  *
36198  * [`socket_disconnected`]: PeerManager::socket_disconnected
36199  */
36200 MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
36201
36202 /**
36203  * Indicates a new inbound connection has been established to a node with an optional remote
36204  * network address.
36205  *
36206  * The remote network address adds the option to report a remote IP address back to a connecting
36207  * peer using the init message.
36208  * The user should pass the remote network address of the host they are connected to.
36209  *
36210  * May refuse the connection by returning an Err, but will never write bytes to the remote end
36211  * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
36212  * the connection immediately.
36213  *
36214  * Panics if descriptor is duplicative with some other descriptor which has not yet been
36215  * [`socket_disconnected`].
36216  *
36217  * [`socket_disconnected`]: PeerManager::socket_disconnected
36218  */
36219 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
36220
36221 /**
36222  * Indicates that there is room to write data to the given socket descriptor.
36223  *
36224  * May return an Err to indicate that the connection should be closed.
36225  *
36226  * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
36227  * returning. Thus, be very careful with reentrancy issues! The invariants around calling
36228  * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
36229  * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
36230  * sufficient!
36231  *
36232  * [`send_data`]: SocketDescriptor::send_data
36233  * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
36234  */
36235 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
36236
36237 /**
36238  * Indicates that data was read from the given socket descriptor.
36239  *
36240  * May return an Err to indicate that the connection should be closed.
36241  *
36242  * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
36243  * Thus, however, you should call [`process_events`] after any `read_event` to generate
36244  * [`send_data`] calls to handle responses.
36245  *
36246  * If `Ok(true)` is returned, further read_events should not be triggered until a
36247  * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
36248  * send buffer).
36249  *
36250  * In order to avoid processing too many messages at once per peer, `data` should be on the
36251  * order of 4KiB.
36252  *
36253  * [`send_data`]: SocketDescriptor::send_data
36254  * [`process_events`]: PeerManager::process_events
36255  */
36256 MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR peer_descriptor, struct LDKu8slice data);
36257
36258 /**
36259  * Checks for any events generated by our handlers and processes them. Includes sending most
36260  * response messages as well as messages generated by calls to handler functions directly (eg
36261  * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
36262  *
36263  * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
36264  * issues!
36265  *
36266  * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
36267  * or one of the other clients provided in our language bindings.
36268  *
36269  * Note that if there are any other calls to this function waiting on lock(s) this may return
36270  * without doing any work. All available events that need handling will be handled before the
36271  * other calls return.
36272  *
36273  * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
36274  * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
36275  * [`send_data`]: SocketDescriptor::send_data
36276  */
36277 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
36278
36279 /**
36280  * Indicates that the given socket descriptor's connection is now closed.
36281  */
36282 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
36283
36284 /**
36285  * Disconnect a peer given its node id.
36286  *
36287  * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
36288  * peer. Thus, be very careful about reentrancy issues.
36289  *
36290  * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
36291  */
36292 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
36293
36294 /**
36295  * Disconnects all currently-connected peers. This is useful on platforms where there may be
36296  * an indication that TCP sockets have stalled even if we weren't around to time them out
36297  * using regular ping/pongs.
36298  */
36299 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
36300
36301 /**
36302  * Send pings to each peer and disconnect those which did not respond to the last round of
36303  * pings.
36304  *
36305  * This may be called on any timescale you want, however, roughly once every ten seconds is
36306  * preferred. The call rate determines both how often we send a ping to our peers and how much
36307  * time they have to respond before we disconnect them.
36308  *
36309  * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
36310  * issues!
36311  *
36312  * [`send_data`]: SocketDescriptor::send_data
36313  */
36314 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
36315
36316 /**
36317  * Generates a signed node_announcement from the given arguments, sending it to all connected
36318  * peers. Note that peers will likely ignore this message unless we have at least one public
36319  * channel which has at least six confirmations on-chain.
36320  *
36321  * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
36322  * node to humans. They carry no in-protocol meaning.
36323  *
36324  * `addresses` represent the set (possibly empty) of socket addresses on which this node
36325  * accepts incoming connections. These will be included in the node_announcement, publicly
36326  * tying these addresses together and to this node. If you wish to preserve user privacy,
36327  * addresses should likely contain only Tor Onion addresses.
36328  *
36329  * Panics if `addresses` is absurdly large (more than 100).
36330  *
36331  * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
36332  */
36333 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
36334
36335 /**
36336  * Gets the weight for an HTLC-Success transaction.
36337  */
36338 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
36339
36340 /**
36341  * Gets the weight for an HTLC-Timeout transaction.
36342  */
36343 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
36344
36345 /**
36346  * Creates a copy of the HTLCClaim
36347  */
36348 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
36349
36350 /**
36351  * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
36352  */
36353 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
36354
36355 /**
36356  * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
36357  */
36358 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
36359
36360 /**
36361  * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
36362  */
36363 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
36364
36365 /**
36366  * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
36367  */
36368 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
36369
36370 /**
36371  * Utility method to constructs a new Revocation-variant HTLCClaim
36372  */
36373 enum LDKHTLCClaim HTLCClaim_revocation(void);
36374
36375 /**
36376  * Checks if two HTLCClaims contain equal inner contents.
36377  * This ignores pointers and is_owned flags and looks at the values in fields.
36378  */
36379 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
36380
36381 /**
36382  * Check if a given input witness attempts to claim a HTLC.
36383  */
36384 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
36385
36386 /**
36387  * Build the commitment secret from the seed and the commitment number
36388  */
36389 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
36390
36391 /**
36392  * Build a closing transaction
36393  */
36394 struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
36395
36396 /**
36397  * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
36398  */
36399 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
36400
36401 /**
36402  * Creates a copy of the CounterpartyCommitmentSecrets
36403  */
36404 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
36405
36406 /**
36407  * Creates a new empty `CounterpartyCommitmentSecrets` structure.
36408  */
36409 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
36410
36411 /**
36412  * Returns the minimum index of all stored secrets. Note that indexes start
36413  * at 1 << 48 and get decremented by one for each new secret.
36414  */
36415 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
36416
36417 /**
36418  * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
36419  * was generated in accordance with BOLT 3 and is consistent with previous secrets.
36420  */
36421 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
36422
36423 /**
36424  * Returns the secret at `idx`.
36425  * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
36426  *
36427  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36428  */
36429 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
36430
36431 /**
36432  * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
36433  */
36434 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
36435
36436 /**
36437  * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
36438  */
36439 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
36440
36441 /**
36442  * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
36443  * from the base secret and the per_commitment_point.
36444  */
36445 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
36446
36447 /**
36448  * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
36449  * from the base point and the per_commitment_key. This is the public equivalent of
36450  * derive_private_key - using only public keys to derive a public key instead of private keys.
36451  */
36452 struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
36453
36454 /**
36455  * Derives a per-commitment-transaction revocation key from its constituent parts.
36456  *
36457  * Only the cheating participant owns a valid witness to propagate a revoked
36458  * commitment transaction, thus per_commitment_secret always come from cheater
36459  * and revocation_base_secret always come from punisher, which is the broadcaster
36460  * of the transaction spending with this key knowledge.
36461  */
36462 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
36463
36464 /**
36465  * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
36466  * the public equivalend of derive_private_revocation_key - using only public keys to derive a
36467  * public key instead of private keys.
36468  *
36469  * Only the cheating participant owns a valid witness to propagate a revoked
36470  * commitment transaction, thus per_commitment_point always come from cheater
36471  * and revocation_base_point always come from punisher, which is the broadcaster
36472  * of the transaction spending with this key knowledge.
36473  *
36474  * Note that this is infallible iff we trust that at least one of the two input keys are randomly
36475  * generated (ie our own).
36476  */
36477 struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
36478
36479 /**
36480  * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
36481  */
36482 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
36483
36484 /**
36485  * The broadcaster's per-commitment public key which was used to derive the other keys.
36486  */
36487 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36488
36489 /**
36490  * The broadcaster's per-commitment public key which was used to derive the other keys.
36491  */
36492 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36493
36494 /**
36495  * The revocation key which is used to allow the broadcaster of the commitment
36496  * transaction to provide their counterparty the ability to punish them if they broadcast
36497  * an old state.
36498  */
36499 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36500
36501 /**
36502  * The revocation key which is used to allow the broadcaster of the commitment
36503  * transaction to provide their counterparty the ability to punish them if they broadcast
36504  * an old state.
36505  */
36506 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36507
36508 /**
36509  * Broadcaster's HTLC Key
36510  */
36511 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36512
36513 /**
36514  * Broadcaster's HTLC Key
36515  */
36516 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36517
36518 /**
36519  * Countersignatory's HTLC Key
36520  */
36521 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36522
36523 /**
36524  * Countersignatory's HTLC Key
36525  */
36526 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36527
36528 /**
36529  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
36530  */
36531 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36532
36533 /**
36534  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
36535  */
36536 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36537
36538 /**
36539  * Constructs a new TxCreationKeys given each field
36540  */
36541 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg);
36542
36543 /**
36544  * Checks if two TxCreationKeyss contain equal inner contents.
36545  * This ignores pointers and is_owned flags and looks at the values in fields.
36546  * Two objects with NULL inner values will be considered "equal" here.
36547  */
36548 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
36549
36550 /**
36551  * Creates a copy of the TxCreationKeys
36552  */
36553 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
36554
36555 /**
36556  * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
36557  */
36558 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
36559
36560 /**
36561  * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
36562  */
36563 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
36564
36565 /**
36566  * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
36567  */
36568 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
36569
36570 /**
36571  * The public key which is used to sign all commitment transactions, as it appears in the
36572  * on-chain channel lock-in 2-of-2 multisig output.
36573  */
36574 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36575
36576 /**
36577  * The public key which is used to sign all commitment transactions, as it appears in the
36578  * on-chain channel lock-in 2-of-2 multisig output.
36579  */
36580 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36581
36582 /**
36583  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
36584  * revocation keys. This is combined with the per-commitment-secret generated by the
36585  * counterparty to create a secret which the counterparty can reveal to revoke previous
36586  * states.
36587  */
36588 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36589
36590 /**
36591  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
36592  * revocation keys. This is combined with the per-commitment-secret generated by the
36593  * counterparty to create a secret which the counterparty can reveal to revoke previous
36594  * states.
36595  */
36596 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36597
36598 /**
36599  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
36600  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
36601  * static across every commitment transaction.
36602  */
36603 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36604
36605 /**
36606  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
36607  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
36608  * static across every commitment transaction.
36609  */
36610 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36611
36612 /**
36613  * The base point which is used (with derive_public_key) to derive a per-commitment payment
36614  * public key which receives non-HTLC-encumbered funds which are only available for spending
36615  * after some delay (or can be claimed via the revocation path).
36616  */
36617 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36618
36619 /**
36620  * The base point which is used (with derive_public_key) to derive a per-commitment payment
36621  * public key which receives non-HTLC-encumbered funds which are only available for spending
36622  * after some delay (or can be claimed via the revocation path).
36623  */
36624 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36625
36626 /**
36627  * The base point which is used (with derive_public_key) to derive a per-commitment public key
36628  * which is used to encumber HTLC-in-flight outputs.
36629  */
36630 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36631
36632 /**
36633  * The base point which is used (with derive_public_key) to derive a per-commitment public key
36634  * which is used to encumber HTLC-in-flight outputs.
36635  */
36636 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36637
36638 /**
36639  * Constructs a new ChannelPublicKeys given each field
36640  */
36641 MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg);
36642
36643 /**
36644  * Creates a copy of the ChannelPublicKeys
36645  */
36646 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
36647
36648 /**
36649  * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
36650  */
36651 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
36652
36653 /**
36654  * Checks if two ChannelPublicKeyss contain equal inner contents.
36655  * This ignores pointers and is_owned flags and looks at the values in fields.
36656  * Two objects with NULL inner values will be considered "equal" here.
36657  */
36658 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
36659
36660 /**
36661  * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
36662  */
36663 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
36664
36665 /**
36666  * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
36667  */
36668 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
36669
36670 /**
36671  * Create per-state keys from channel base points and the per-commitment point.
36672  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
36673  */
36674 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base);
36675
36676 /**
36677  * Generate per-state keys from channel static keys.
36678  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
36679  */
36680 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
36681
36682 /**
36683  * A script either spendable by the revocation
36684  * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
36685  * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
36686  */
36687 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
36688
36689 /**
36690  * Returns the script for the counterparty's output on a holder's commitment transaction based on
36691  * the channel type.
36692  */
36693 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
36694
36695 /**
36696  * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
36697  */
36698 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
36699
36700 /**
36701  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
36702  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
36703  * need to compare this value to whether the commitment transaction in question is that of
36704  * the counterparty or our own.
36705  */
36706 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36707
36708 /**
36709  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
36710  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
36711  * need to compare this value to whether the commitment transaction in question is that of
36712  * the counterparty or our own.
36713  */
36714 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
36715
36716 /**
36717  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
36718  * this divided by 1000.
36719  */
36720 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36721
36722 /**
36723  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
36724  * this divided by 1000.
36725  */
36726 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
36727
36728 /**
36729  * The CLTV lock-time at which this HTLC expires.
36730  */
36731 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36732
36733 /**
36734  * The CLTV lock-time at which this HTLC expires.
36735  */
36736 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
36737
36738 /**
36739  * The hash of the preimage which unlocks this HTLC.
36740  */
36741 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
36742
36743 /**
36744  * The hash of the preimage which unlocks this HTLC.
36745  */
36746 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36747
36748 /**
36749  * The position within the commitment transactions' outputs. This may be None if the value is
36750  * below the dust limit (in which case no output appears in the commitment transaction and the
36751  * value is spent to additional transaction fees).
36752  */
36753 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36754
36755 /**
36756  * The position within the commitment transactions' outputs. This may be None if the value is
36757  * below the dust limit (in which case no output appears in the commitment transaction and the
36758  * value is spent to additional transaction fees).
36759  */
36760 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36761
36762 /**
36763  * Constructs a new HTLCOutputInCommitment given each field
36764  */
36765 MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg);
36766
36767 /**
36768  * Creates a copy of the HTLCOutputInCommitment
36769  */
36770 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
36771
36772 /**
36773  * Checks if two HTLCOutputInCommitments contain equal inner contents.
36774  * This ignores pointers and is_owned flags and looks at the values in fields.
36775  * Two objects with NULL inner values will be considered "equal" here.
36776  */
36777 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
36778
36779 /**
36780  * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
36781  */
36782 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
36783
36784 /**
36785  * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
36786  */
36787 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
36788
36789 /**
36790  * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
36791  * does not need to have its previous_output_index filled.
36792  */
36793 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKTxCreationKeys *NONNULL_PTR keys);
36794
36795 /**
36796  * Gets the redeemscript for a funding output from the two funding public keys.
36797  * Note that the order of funding public keys does not matter.
36798  */
36799 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
36800
36801 /**
36802  * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
36803  * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
36804  * transaction which needs signing, and can be used to construct an HTLC transaction which is
36805  * broadcastable given a counterparty HTLC signature.
36806  *
36807  * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
36808  * commitment transaction).
36809  */
36810 struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
36811
36812 /**
36813  * Returns the witness required to satisfy and spend a HTLC input.
36814  */
36815 struct LDKWitness build_htlc_input_witness(struct LDKECDSASignature local_sig, struct LDKECDSASignature remote_sig, struct LDKCOption_ThirtyTwoBytesZ preimage, struct LDKu8slice redeem_script, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
36816
36817 /**
36818  * Gets the witnessScript for the to_remote output when anchors are enabled.
36819  */
36820 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
36821
36822 /**
36823  * Gets the witnessScript for an anchor output from the funding public key.
36824  * The witness in the spending input must be:
36825  * <BIP 143 funding_signature>
36826  * After 16 blocks of confirmation, an alternative satisfying witness could be:
36827  * <>
36828  * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
36829  */
36830 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
36831
36832 /**
36833  * Returns the witness required to satisfy and spend an anchor input.
36834  */
36835 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
36836
36837 /**
36838  * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36839  */
36840 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
36841
36842 /**
36843  * Holder public keys
36844  */
36845 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36846
36847 /**
36848  * Holder public keys
36849  */
36850 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
36851
36852 /**
36853  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
36854  */
36855 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36856
36857 /**
36858  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
36859  */
36860 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
36861
36862 /**
36863  * Whether the holder is the initiator of this channel.
36864  * This is an input to the commitment number obscure factor computation.
36865  */
36866 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36867
36868 /**
36869  * Whether the holder is the initiator of this channel.
36870  * This is an input to the commitment number obscure factor computation.
36871  */
36872 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
36873
36874 /**
36875  * The late-bound counterparty channel transaction parameters.
36876  * These parameters are populated at the point in the protocol where the counterparty provides them.
36877  *
36878  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36879  */
36880 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36881
36882 /**
36883  * The late-bound counterparty channel transaction parameters.
36884  * These parameters are populated at the point in the protocol where the counterparty provides them.
36885  *
36886  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36887  */
36888 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
36889
36890 /**
36891  * The late-bound funding outpoint
36892  *
36893  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36894  */
36895 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36896
36897 /**
36898  * The late-bound funding outpoint
36899  *
36900  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36901  */
36902 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
36903
36904 /**
36905  * This channel's type, as negotiated during channel open. For old objects where this field
36906  * wasn't serialized, it will default to static_remote_key at deserialization.
36907  */
36908 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36909
36910 /**
36911  * This channel's type, as negotiated during channel open. For old objects where this field
36912  * wasn't serialized, it will default to static_remote_key at deserialization.
36913  */
36914 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
36915
36916 /**
36917  * Constructs a new ChannelTransactionParameters given each field
36918  *
36919  * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36920  * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36921  */
36922 MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, struct LDKChannelTypeFeatures channel_type_features_arg);
36923
36924 /**
36925  * Creates a copy of the ChannelTransactionParameters
36926  */
36927 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
36928
36929 /**
36930  * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
36931  */
36932 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
36933
36934 /**
36935  * Checks if two ChannelTransactionParameterss contain equal inner contents.
36936  * This ignores pointers and is_owned flags and looks at the values in fields.
36937  * Two objects with NULL inner values will be considered "equal" here.
36938  */
36939 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
36940
36941 /**
36942  * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36943  */
36944 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
36945
36946 /**
36947  * Counter-party public keys
36948  */
36949 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
36950
36951 /**
36952  * Counter-party public keys
36953  */
36954 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
36955
36956 /**
36957  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
36958  */
36959 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
36960
36961 /**
36962  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
36963  */
36964 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
36965
36966 /**
36967  * Constructs a new CounterpartyChannelTransactionParameters given each field
36968  */
36969 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
36970
36971 /**
36972  * Creates a copy of the CounterpartyChannelTransactionParameters
36973  */
36974 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
36975
36976 /**
36977  * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
36978  */
36979 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
36980
36981 /**
36982  * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
36983  * This ignores pointers and is_owned flags and looks at the values in fields.
36984  * Two objects with NULL inner values will be considered "equal" here.
36985  */
36986 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
36987
36988 /**
36989  * Whether the late bound parameters are populated.
36990  */
36991 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
36992
36993 /**
36994  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
36995  * given that the holder is the broadcaster.
36996  *
36997  * self.is_populated() must be true before calling this function.
36998  */
36999 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
37000
37001 /**
37002  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
37003  * given that the counterparty is the broadcaster.
37004  *
37005  * self.is_populated() must be true before calling this function.
37006  */
37007 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
37008
37009 /**
37010  * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
37011  */
37012 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
37013
37014 /**
37015  * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
37016  */
37017 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
37018
37019 /**
37020  * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
37021  */
37022 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
37023
37024 /**
37025  * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
37026  */
37027 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
37028
37029 /**
37030  * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
37031  */
37032 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
37033
37034 /**
37035  * Get the channel pubkeys for the broadcaster
37036  */
37037 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37038
37039 /**
37040  * Get the channel pubkeys for the countersignatory
37041  */
37042 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37043
37044 /**
37045  * Get the contest delay applicable to the transactions.
37046  * Note that the contest delay was selected by the countersignatory.
37047  */
37048 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37049
37050 /**
37051  * Whether the channel is outbound from the broadcaster.
37052  *
37053  * The boolean representing the side that initiated the channel is
37054  * an input to the commitment number obscure factor computation.
37055  */
37056 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37057
37058 /**
37059  * The funding outpoint
37060  */
37061 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37062
37063 /**
37064  * Whether to use anchors for this channel
37065  */
37066 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37067
37068 /**
37069  * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
37070  */
37071 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
37072
37073 /**
37074  * Our counterparty's signature for the transaction
37075  */
37076 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
37077
37078 /**
37079  * Our counterparty's signature for the transaction
37080  */
37081 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37082
37083 /**
37084  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
37085  *
37086  * Returns a copy of the field.
37087  */
37088 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
37089
37090 /**
37091  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
37092  */
37093 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
37094
37095 /**
37096  * Creates a copy of the HolderCommitmentTransaction
37097  */
37098 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
37099
37100 /**
37101  * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
37102  */
37103 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
37104
37105 /**
37106  * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
37107  */
37108 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
37109
37110 /**
37111  * Create a new holder transaction with the given counterparty signatures.
37112  * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
37113  */
37114 MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKECDSASignature counterparty_sig, struct LDKCVec_ECDSASignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
37115
37116 /**
37117  * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
37118  */
37119 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
37120
37121 /**
37122  * The commitment transaction
37123  */
37124 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
37125
37126 /**
37127  * The commitment transaction
37128  */
37129 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
37130
37131 /**
37132  * The txid for the commitment transaction.
37133  *
37134  * This is provided as a performance optimization, instead of calling transaction.txid()
37135  * multiple times.
37136  */
37137 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
37138
37139 /**
37140  * The txid for the commitment transaction.
37141  *
37142  * This is provided as a performance optimization, instead of calling transaction.txid()
37143  * multiple times.
37144  */
37145 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37146
37147 /**
37148  * Constructs a new BuiltCommitmentTransaction given each field
37149  */
37150 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
37151
37152 /**
37153  * Creates a copy of the BuiltCommitmentTransaction
37154  */
37155 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
37156
37157 /**
37158  * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
37159  */
37160 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
37161
37162 /**
37163  * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
37164  */
37165 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
37166
37167 /**
37168  * Get the SIGHASH_ALL sighash value of the transaction.
37169  *
37170  * This can be used to verify a signature.
37171  */
37172 MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
37173
37174 /**
37175  * Signs the counterparty's commitment transaction.
37176  */
37177 MUST_USE_RES struct LDKECDSASignature BuiltCommitmentTransaction_sign_counterparty_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
37178
37179 /**
37180  * Signs the holder commitment transaction because we are about to broadcast it.
37181  */
37182 MUST_USE_RES struct LDKECDSASignature BuiltCommitmentTransaction_sign_holder_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis, const struct LDKEntropySource *NONNULL_PTR entropy_source);
37183
37184 /**
37185  * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
37186  */
37187 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
37188
37189 /**
37190  * Creates a copy of the ClosingTransaction
37191  */
37192 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
37193
37194 /**
37195  * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
37196  */
37197 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
37198
37199 /**
37200  * Checks if two ClosingTransactions contain equal inner contents.
37201  * This ignores pointers and is_owned flags and looks at the values in fields.
37202  * Two objects with NULL inner values will be considered "equal" here.
37203  */
37204 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
37205
37206 /**
37207  * Construct an object of the class
37208  */
37209 MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
37210
37211 /**
37212  * Trust our pre-built transaction.
37213  *
37214  * Applies a wrapper which allows access to the transaction.
37215  *
37216  * This should only be used if you fully trust the builder of this object. It should not
37217  * be used by an external signer - instead use the verify function.
37218  */
37219 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37220
37221 /**
37222  * Verify our pre-built transaction.
37223  *
37224  * Applies a wrapper which allows access to the transaction.
37225  *
37226  * An external validating signer must call this method before signing
37227  * or using the built transaction.
37228  */
37229 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
37230
37231 /**
37232  * The value to be sent to the holder, or zero if the output will be omitted
37233  */
37234 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37235
37236 /**
37237  * The value to be sent to the counterparty, or zero if the output will be omitted
37238  */
37239 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37240
37241 /**
37242  * The destination of the holder's output
37243  */
37244 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37245
37246 /**
37247  * The destination of the counterparty's output
37248  */
37249 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37250
37251 /**
37252  * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
37253  */
37254 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
37255
37256 /**
37257  * The pre-built Bitcoin commitment transaction
37258  */
37259 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
37260
37261 /**
37262  * Get the SIGHASH_ALL sighash value of the transaction.
37263  *
37264  * This can be used to verify a signature.
37265  */
37266 MUST_USE_RES struct LDKThirtyTwoBytes TrustedClosingTransaction_get_sighash_all(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
37267
37268 /**
37269  * Sign a transaction, either because we are counter-signing the counterparty's transaction or
37270  * because we are about to broadcast a holder transaction.
37271  */
37272 MUST_USE_RES struct LDKECDSASignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
37273
37274 /**
37275  * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
37276  */
37277 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
37278
37279 /**
37280  * Creates a copy of the CommitmentTransaction
37281  */
37282 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
37283
37284 /**
37285  * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
37286  */
37287 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
37288
37289 /**
37290  * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
37291  */
37292 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
37293
37294 /**
37295  * The backwards-counting commitment number
37296  */
37297 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37298
37299 /**
37300  * The per commitment point used by the broadcaster.
37301  */
37302 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37303
37304 /**
37305  * The value to be sent to the broadcaster
37306  */
37307 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37308
37309 /**
37310  * The value to be sent to the counterparty
37311  */
37312 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37313
37314 /**
37315  * The feerate paid per 1000-weight-unit in this commitment transaction.
37316  */
37317 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37318
37319 /**
37320  * Trust our pre-built transaction and derived transaction creation public keys.
37321  *
37322  * Applies a wrapper which allows access to these fields.
37323  *
37324  * This should only be used if you fully trust the builder of this object.  It should not
37325  * be used by an external signer - instead use the verify function.
37326  */
37327 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37328
37329 /**
37330  * Verify our pre-built transaction and derived transaction creation public keys.
37331  *
37332  * Applies a wrapper which allows access to these fields.
37333  *
37334  * An external validating signer must call this method before signing
37335  * or using the built transaction.
37336  */
37337 MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
37338
37339 /**
37340  * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
37341  */
37342 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
37343
37344 /**
37345  * The transaction ID of the built Bitcoin transaction
37346  */
37347 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37348
37349 /**
37350  * The pre-built Bitcoin commitment transaction
37351  */
37352 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37353
37354 /**
37355  * The pre-calculated transaction creation public keys.
37356  */
37357 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37358
37359 /**
37360  * Should anchors be used.
37361  */
37362 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37363
37364 /**
37365  * Get a signature for each HTLC which was included in the commitment transaction (ie for
37366  * which HTLCOutputInCommitment::transaction_output_index.is_some()).
37367  *
37368  * The returned Vec has one entry for each HTLC, and in the same order.
37369  *
37370  * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
37371  */
37372 MUST_USE_RES struct LDKCResult_CVec_ECDSASignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKEntropySource *NONNULL_PTR entropy_source);
37373
37374 /**
37375  * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
37376  * the broadcaster, in the built transaction, if any exists.
37377  *
37378  * There are two cases where this may return `None`:
37379  * - The balance of the revokeable output is below the dust limit (only found on commitments
37380  * early in the channel's lifetime, i.e. before the channel reserve is met).
37381  * - This commitment was created before LDK 0.0.117. In this case, the
37382  * commitment transaction previously didn't contain enough information to locate the
37383  * revokeable output.
37384  */
37385 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37386
37387 /**
37388  * Helper method to build an unsigned justice transaction spending the revokeable
37389  * `to_local` output to a destination script. Fee estimation accounts for the expected
37390  * revocation witness data that will be added when signed.
37391  *
37392  * This method will error if the given fee rate results in a fee greater than the value
37393  * of the output being spent, or if there exists no revokeable `to_local` output on this
37394  * commitment transaction. See [`Self::revokeable_output_index`] for more details.
37395  *
37396  * The built transaction will allow fee bumping with RBF, and this method takes
37397  * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
37398  * fee rates may be built.
37399  */
37400 MUST_USE_RES struct LDKCResult_TransactionNoneZ TrustedCommitmentTransaction_build_to_local_justice_tx(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, uint64_t feerate_per_kw, struct LDKCVec_u8Z destination_script);
37401
37402 /**
37403  * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
37404  * shared secret first. This prevents on-chain observers from discovering how many commitment
37405  * transactions occurred in a channel before it was closed.
37406  *
37407  * This function gets the shared secret from relevant channel public keys and can be used to
37408  * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
37409  */
37410 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
37411
37412 /**
37413  * Checks if two InitFeaturess contain equal inner contents.
37414  * This ignores pointers and is_owned flags and looks at the values in fields.
37415  * Two objects with NULL inner values will be considered "equal" here.
37416  */
37417 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
37418
37419 /**
37420  * Checks if two NodeFeaturess contain equal inner contents.
37421  * This ignores pointers and is_owned flags and looks at the values in fields.
37422  * Two objects with NULL inner values will be considered "equal" here.
37423  */
37424 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
37425
37426 /**
37427  * Checks if two ChannelFeaturess contain equal inner contents.
37428  * This ignores pointers and is_owned flags and looks at the values in fields.
37429  * Two objects with NULL inner values will be considered "equal" here.
37430  */
37431 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
37432
37433 /**
37434  * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
37435  * This ignores pointers and is_owned flags and looks at the values in fields.
37436  * Two objects with NULL inner values will be considered "equal" here.
37437  */
37438 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
37439
37440 /**
37441  * Checks if two OfferFeaturess contain equal inner contents.
37442  * This ignores pointers and is_owned flags and looks at the values in fields.
37443  * Two objects with NULL inner values will be considered "equal" here.
37444  */
37445 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
37446
37447 /**
37448  * Checks if two InvoiceRequestFeaturess contain equal inner contents.
37449  * This ignores pointers and is_owned flags and looks at the values in fields.
37450  * Two objects with NULL inner values will be considered "equal" here.
37451  */
37452 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
37453
37454 /**
37455  * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
37456  * This ignores pointers and is_owned flags and looks at the values in fields.
37457  * Two objects with NULL inner values will be considered "equal" here.
37458  */
37459 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
37460
37461 /**
37462  * Checks if two BlindedHopFeaturess contain equal inner contents.
37463  * This ignores pointers and is_owned flags and looks at the values in fields.
37464  * Two objects with NULL inner values will be considered "equal" here.
37465  */
37466 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
37467
37468 /**
37469  * Checks if two ChannelTypeFeaturess contain equal inner contents.
37470  * This ignores pointers and is_owned flags and looks at the values in fields.
37471  * Two objects with NULL inner values will be considered "equal" here.
37472  */
37473 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
37474
37475 /**
37476  * Creates a copy of the InitFeatures
37477  */
37478 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
37479
37480 /**
37481  * Creates a copy of the NodeFeatures
37482  */
37483 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
37484
37485 /**
37486  * Creates a copy of the ChannelFeatures
37487  */
37488 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
37489
37490 /**
37491  * Creates a copy of the Bolt11InvoiceFeatures
37492  */
37493 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
37494
37495 /**
37496  * Creates a copy of the OfferFeatures
37497  */
37498 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
37499
37500 /**
37501  * Creates a copy of the InvoiceRequestFeatures
37502  */
37503 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
37504
37505 /**
37506  * Creates a copy of the Bolt12InvoiceFeatures
37507  */
37508 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
37509
37510 /**
37511  * Creates a copy of the BlindedHopFeatures
37512  */
37513 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
37514
37515 /**
37516  * Creates a copy of the ChannelTypeFeatures
37517  */
37518 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
37519
37520 /**
37521  * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
37522  */
37523 void InitFeatures_free(struct LDKInitFeatures this_obj);
37524
37525 /**
37526  * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
37527  */
37528 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
37529
37530 /**
37531  * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
37532  */
37533 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
37534
37535 /**
37536  * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
37537  */
37538 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
37539
37540 /**
37541  * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
37542  */
37543 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
37544
37545 /**
37546  * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
37547  */
37548 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
37549
37550 /**
37551  * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
37552  */
37553 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
37554
37555 /**
37556  * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
37557  */
37558 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
37559
37560 /**
37561  * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
37562  */
37563 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
37564
37565 /**
37566  * Create a blank Features with no features set
37567  */
37568 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
37569
37570 /**
37571  * Returns true if this `Features` object contains required features unknown by `other`.
37572  */
37573 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
37574
37575 /**
37576  * Returns true if this `Features` object contains unknown feature flags which are set as
37577  * \"required\".
37578  */
37579 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37580
37581 /**
37582  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37583  * by [BOLT 9].
37584  *
37585  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37586  * be set instead (i.e., `bit - 1`).
37587  *
37588  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37589  */
37590 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37591
37592 /**
37593  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37594  * by [BOLT 9].
37595  *
37596  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37597  * set instead (i.e., `bit + 1`).
37598  *
37599  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37600  */
37601 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37602
37603 /**
37604  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37605  * by [bLIP 2] or if it is a known `T` feature.
37606  *
37607  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37608  * be set instead (i.e., `bit - 1`).
37609  *
37610  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37611  */
37612 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37613
37614 /**
37615  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37616  * by [bLIP 2] or if it is a known `T` feature.
37617  *
37618  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37619  * set instead (i.e., `bit + 1`).
37620  *
37621  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37622  */
37623 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37624
37625 /**
37626  * Create a blank Features with no features set
37627  */
37628 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
37629
37630 /**
37631  * Returns true if this `Features` object contains required features unknown by `other`.
37632  */
37633 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
37634
37635 /**
37636  * Returns true if this `Features` object contains unknown feature flags which are set as
37637  * \"required\".
37638  */
37639 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37640
37641 /**
37642  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37643  * by [BOLT 9].
37644  *
37645  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37646  * be set instead (i.e., `bit - 1`).
37647  *
37648  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37649  */
37650 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37651
37652 /**
37653  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37654  * by [BOLT 9].
37655  *
37656  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37657  * set instead (i.e., `bit + 1`).
37658  *
37659  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37660  */
37661 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37662
37663 /**
37664  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37665  * by [bLIP 2] or if it is a known `T` feature.
37666  *
37667  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37668  * be set instead (i.e., `bit - 1`).
37669  *
37670  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37671  */
37672 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37673
37674 /**
37675  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37676  * by [bLIP 2] or if it is a known `T` feature.
37677  *
37678  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37679  * set instead (i.e., `bit + 1`).
37680  *
37681  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37682  */
37683 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37684
37685 /**
37686  * Create a blank Features with no features set
37687  */
37688 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
37689
37690 /**
37691  * Returns true if this `Features` object contains required features unknown by `other`.
37692  */
37693 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
37694
37695 /**
37696  * Returns true if this `Features` object contains unknown feature flags which are set as
37697  * \"required\".
37698  */
37699 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
37700
37701 /**
37702  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37703  * by [BOLT 9].
37704  *
37705  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37706  * be set instead (i.e., `bit - 1`).
37707  *
37708  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37709  */
37710 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37711
37712 /**
37713  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37714  * by [BOLT 9].
37715  *
37716  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37717  * set instead (i.e., `bit + 1`).
37718  *
37719  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37720  */
37721 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37722
37723 /**
37724  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37725  * by [bLIP 2] or if it is a known `T` feature.
37726  *
37727  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37728  * be set instead (i.e., `bit - 1`).
37729  *
37730  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37731  */
37732 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37733
37734 /**
37735  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37736  * by [bLIP 2] or if it is a known `T` feature.
37737  *
37738  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37739  * set instead (i.e., `bit + 1`).
37740  *
37741  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37742  */
37743 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37744
37745 /**
37746  * Create a blank Features with no features set
37747  */
37748 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
37749
37750 /**
37751  * Returns true if this `Features` object contains required features unknown by `other`.
37752  */
37753 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
37754
37755 /**
37756  * Returns true if this `Features` object contains unknown feature flags which are set as
37757  * \"required\".
37758  */
37759 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37760
37761 /**
37762  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37763  * by [BOLT 9].
37764  *
37765  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37766  * be set instead (i.e., `bit - 1`).
37767  *
37768  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37769  */
37770 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37771
37772 /**
37773  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37774  * by [BOLT 9].
37775  *
37776  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37777  * set instead (i.e., `bit + 1`).
37778  *
37779  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37780  */
37781 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37782
37783 /**
37784  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37785  * by [bLIP 2] or if it is a known `T` feature.
37786  *
37787  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37788  * be set instead (i.e., `bit - 1`).
37789  *
37790  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37791  */
37792 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37793
37794 /**
37795  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37796  * by [bLIP 2] or if it is a known `T` feature.
37797  *
37798  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37799  * set instead (i.e., `bit + 1`).
37800  *
37801  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37802  */
37803 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37804
37805 /**
37806  * Create a blank Features with no features set
37807  */
37808 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
37809
37810 /**
37811  * Returns true if this `Features` object contains required features unknown by `other`.
37812  */
37813 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
37814
37815 /**
37816  * Returns true if this `Features` object contains unknown feature flags which are set as
37817  * \"required\".
37818  */
37819 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
37820
37821 /**
37822  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37823  * by [BOLT 9].
37824  *
37825  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37826  * be set instead (i.e., `bit - 1`).
37827  *
37828  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37829  */
37830 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37831
37832 /**
37833  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37834  * by [BOLT 9].
37835  *
37836  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37837  * set instead (i.e., `bit + 1`).
37838  *
37839  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37840  */
37841 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37842
37843 /**
37844  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37845  * by [bLIP 2] or if it is a known `T` feature.
37846  *
37847  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37848  * be set instead (i.e., `bit - 1`).
37849  *
37850  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37851  */
37852 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37853
37854 /**
37855  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37856  * by [bLIP 2] or if it is a known `T` feature.
37857  *
37858  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37859  * set instead (i.e., `bit + 1`).
37860  *
37861  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37862  */
37863 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37864
37865 /**
37866  * Create a blank Features with no features set
37867  */
37868 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
37869
37870 /**
37871  * Returns true if this `Features` object contains required features unknown by `other`.
37872  */
37873 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
37874
37875 /**
37876  * Returns true if this `Features` object contains unknown feature flags which are set as
37877  * \"required\".
37878  */
37879 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
37880
37881 /**
37882  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37883  * by [BOLT 9].
37884  *
37885  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37886  * be set instead (i.e., `bit - 1`).
37887  *
37888  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37889  */
37890 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37891
37892 /**
37893  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37894  * by [BOLT 9].
37895  *
37896  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37897  * set instead (i.e., `bit + 1`).
37898  *
37899  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37900  */
37901 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37902
37903 /**
37904  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37905  * by [bLIP 2] or if it is a known `T` feature.
37906  *
37907  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37908  * be set instead (i.e., `bit - 1`).
37909  *
37910  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37911  */
37912 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37913
37914 /**
37915  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37916  * by [bLIP 2] or if it is a known `T` feature.
37917  *
37918  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37919  * set instead (i.e., `bit + 1`).
37920  *
37921  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37922  */
37923 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37924
37925 /**
37926  * Create a blank Features with no features set
37927  */
37928 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
37929
37930 /**
37931  * Returns true if this `Features` object contains required features unknown by `other`.
37932  */
37933 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
37934
37935 /**
37936  * Returns true if this `Features` object contains unknown feature flags which are set as
37937  * \"required\".
37938  */
37939 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
37940
37941 /**
37942  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37943  * by [BOLT 9].
37944  *
37945  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37946  * be set instead (i.e., `bit - 1`).
37947  *
37948  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37949  */
37950 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37951
37952 /**
37953  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37954  * by [BOLT 9].
37955  *
37956  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37957  * set instead (i.e., `bit + 1`).
37958  *
37959  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37960  */
37961 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37962
37963 /**
37964  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37965  * by [bLIP 2] or if it is a known `T` feature.
37966  *
37967  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37968  * be set instead (i.e., `bit - 1`).
37969  *
37970  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37971  */
37972 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37973
37974 /**
37975  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37976  * by [bLIP 2] or if it is a known `T` feature.
37977  *
37978  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37979  * set instead (i.e., `bit + 1`).
37980  *
37981  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37982  */
37983 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37984
37985 /**
37986  * Create a blank Features with no features set
37987  */
37988 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
37989
37990 /**
37991  * Returns true if this `Features` object contains required features unknown by `other`.
37992  */
37993 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
37994
37995 /**
37996  * Returns true if this `Features` object contains unknown feature flags which are set as
37997  * \"required\".
37998  */
37999 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
38000
38001 /**
38002  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
38003  * by [BOLT 9].
38004  *
38005  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
38006  * be set instead (i.e., `bit - 1`).
38007  *
38008  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
38009  */
38010 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38011
38012 /**
38013  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
38014  * by [BOLT 9].
38015  *
38016  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
38017  * set instead (i.e., `bit + 1`).
38018  *
38019  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
38020  */
38021 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38022
38023 /**
38024  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
38025  * by [bLIP 2] or if it is a known `T` feature.
38026  *
38027  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
38028  * be set instead (i.e., `bit - 1`).
38029  *
38030  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
38031  */
38032 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38033
38034 /**
38035  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
38036  * by [bLIP 2] or if it is a known `T` feature.
38037  *
38038  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
38039  * set instead (i.e., `bit + 1`).
38040  *
38041  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
38042  */
38043 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38044
38045 /**
38046  * Create a blank Features with no features set
38047  */
38048 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
38049
38050 /**
38051  * Returns true if this `Features` object contains required features unknown by `other`.
38052  */
38053 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
38054
38055 /**
38056  * Returns true if this `Features` object contains unknown feature flags which are set as
38057  * \"required\".
38058  */
38059 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38060
38061 /**
38062  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
38063  * by [BOLT 9].
38064  *
38065  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
38066  * be set instead (i.e., `bit - 1`).
38067  *
38068  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
38069  */
38070 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38071
38072 /**
38073  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
38074  * by [BOLT 9].
38075  *
38076  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
38077  * set instead (i.e., `bit + 1`).
38078  *
38079  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
38080  */
38081 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38082
38083 /**
38084  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
38085  * by [bLIP 2] or if it is a known `T` feature.
38086  *
38087  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
38088  * be set instead (i.e., `bit - 1`).
38089  *
38090  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
38091  */
38092 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38093
38094 /**
38095  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
38096  * by [bLIP 2] or if it is a known `T` feature.
38097  *
38098  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
38099  * set instead (i.e., `bit + 1`).
38100  *
38101  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
38102  */
38103 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38104
38105 /**
38106  * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
38107  */
38108 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
38109
38110 /**
38111  * Read a InitFeatures from a byte array, created by InitFeatures_write
38112  */
38113 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
38114
38115 /**
38116  * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
38117  */
38118 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
38119
38120 /**
38121  * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
38122  */
38123 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
38124
38125 /**
38126  * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
38127  */
38128 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
38129
38130 /**
38131  * Read a NodeFeatures from a byte array, created by NodeFeatures_write
38132  */
38133 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
38134
38135 /**
38136  * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
38137  */
38138 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
38139
38140 /**
38141  * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
38142  */
38143 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
38144
38145 /**
38146  * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
38147  */
38148 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
38149
38150 /**
38151  * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
38152  */
38153 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
38154
38155 /**
38156  * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
38157  */
38158 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
38159
38160 /**
38161  * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
38162  */
38163 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
38164
38165 /**
38166  * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
38167  */
38168 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
38169
38170 /**
38171  * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
38172  */
38173 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
38174
38175 /**
38176  * Set this feature as optional.
38177  */
38178 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38179
38180 /**
38181  * Set this feature as required.
38182  */
38183 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38184
38185 /**
38186  * Checks if this feature is supported.
38187  */
38188 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38189
38190 /**
38191  * Set this feature as optional.
38192  */
38193 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38194
38195 /**
38196  * Set this feature as required.
38197  */
38198 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38199
38200 /**
38201  * Checks if this feature is supported.
38202  */
38203 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38204
38205 /**
38206  * Checks if this feature is required.
38207  */
38208 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38209
38210 /**
38211  * Checks if this feature is required.
38212  */
38213 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38214
38215 /**
38216  * Set this feature as optional.
38217  */
38218 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38219
38220 /**
38221  * Set this feature as required.
38222  */
38223 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38224
38225 /**
38226  * Checks if this feature is supported.
38227  */
38228 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38229
38230 /**
38231  * Set this feature as optional.
38232  */
38233 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38234
38235 /**
38236  * Set this feature as required.
38237  */
38238 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38239
38240 /**
38241  * Checks if this feature is supported.
38242  */
38243 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38244
38245 /**
38246  * Set this feature as optional.
38247  */
38248 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38249
38250 /**
38251  * Set this feature as required.
38252  */
38253 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38254
38255 /**
38256  * Checks if this feature is supported.
38257  */
38258 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38259
38260 /**
38261  * Checks if this feature is required.
38262  */
38263 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38264
38265 /**
38266  * Checks if this feature is required.
38267  */
38268 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38269
38270 /**
38271  * Set this feature as optional.
38272  */
38273 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38274
38275 /**
38276  * Set this feature as required.
38277  */
38278 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38279
38280 /**
38281  * Checks if this feature is supported.
38282  */
38283 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38284
38285 /**
38286  * Set this feature as optional.
38287  */
38288 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38289
38290 /**
38291  * Set this feature as required.
38292  */
38293 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38294
38295 /**
38296  * Checks if this feature is supported.
38297  */
38298 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38299
38300 /**
38301  * Checks if this feature is required.
38302  */
38303 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38304
38305 /**
38306  * Checks if this feature is required.
38307  */
38308 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38309
38310 /**
38311  * Set this feature as optional.
38312  */
38313 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38314
38315 /**
38316  * Set this feature as required.
38317  */
38318 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38319
38320 /**
38321  * Checks if this feature is supported.
38322  */
38323 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38324
38325 /**
38326  * Set this feature as optional.
38327  */
38328 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38329
38330 /**
38331  * Set this feature as required.
38332  */
38333 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38334
38335 /**
38336  * Checks if this feature is supported.
38337  */
38338 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38339
38340 /**
38341  * Set this feature as optional.
38342  */
38343 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38344
38345 /**
38346  * Set this feature as required.
38347  */
38348 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38349
38350 /**
38351  * Checks if this feature is supported.
38352  */
38353 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38354
38355 /**
38356  * Checks if this feature is required.
38357  */
38358 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38359
38360 /**
38361  * Checks if this feature is required.
38362  */
38363 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38364
38365 /**
38366  * Checks if this feature is required.
38367  */
38368 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38369
38370 /**
38371  * Set this feature as optional.
38372  */
38373 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38374
38375 /**
38376  * Set this feature as required.
38377  */
38378 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38379
38380 /**
38381  * Checks if this feature is supported.
38382  */
38383 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38384
38385 /**
38386  * Set this feature as optional.
38387  */
38388 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38389
38390 /**
38391  * Set this feature as required.
38392  */
38393 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38394
38395 /**
38396  * Checks if this feature is supported.
38397  */
38398 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38399
38400 /**
38401  * Set this feature as optional.
38402  */
38403 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38404
38405 /**
38406  * Set this feature as required.
38407  */
38408 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38409
38410 /**
38411  * Checks if this feature is supported.
38412  */
38413 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38414
38415 /**
38416  * Checks if this feature is required.
38417  */
38418 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38419
38420 /**
38421  * Checks if this feature is required.
38422  */
38423 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38424
38425 /**
38426  * Checks if this feature is required.
38427  */
38428 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38429
38430 /**
38431  * Set this feature as optional.
38432  */
38433 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38434
38435 /**
38436  * Set this feature as required.
38437  */
38438 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38439
38440 /**
38441  * Checks if this feature is supported.
38442  */
38443 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38444
38445 /**
38446  * Set this feature as optional.
38447  */
38448 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38449
38450 /**
38451  * Set this feature as required.
38452  */
38453 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38454
38455 /**
38456  * Checks if this feature is supported.
38457  */
38458 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38459
38460 /**
38461  * Set this feature as optional.
38462  */
38463 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38464
38465 /**
38466  * Set this feature as required.
38467  */
38468 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38469
38470 /**
38471  * Checks if this feature is supported.
38472  */
38473 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38474
38475 /**
38476  * Checks if this feature is required.
38477  */
38478 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38479
38480 /**
38481  * Checks if this feature is required.
38482  */
38483 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38484
38485 /**
38486  * Checks if this feature is required.
38487  */
38488 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38489
38490 /**
38491  * Set this feature as optional.
38492  */
38493 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38494
38495 /**
38496  * Set this feature as required.
38497  */
38498 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38499
38500 /**
38501  * Checks if this feature is supported.
38502  */
38503 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38504
38505 /**
38506  * Set this feature as optional.
38507  */
38508 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38509
38510 /**
38511  * Set this feature as required.
38512  */
38513 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38514
38515 /**
38516  * Checks if this feature is supported.
38517  */
38518 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38519
38520 /**
38521  * Set this feature as optional.
38522  */
38523 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38524
38525 /**
38526  * Set this feature as required.
38527  */
38528 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38529
38530 /**
38531  * Checks if this feature is supported.
38532  */
38533 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38534
38535 /**
38536  * Set this feature as optional.
38537  */
38538 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38539
38540 /**
38541  * Set this feature as required.
38542  */
38543 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38544
38545 /**
38546  * Checks if this feature is supported.
38547  */
38548 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38549
38550 /**
38551  * Checks if this feature is required.
38552  */
38553 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38554
38555 /**
38556  * Checks if this feature is required.
38557  */
38558 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38559
38560 /**
38561  * Checks if this feature is required.
38562  */
38563 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38564
38565 /**
38566  * Checks if this feature is required.
38567  */
38568 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38569
38570 /**
38571  * Set this feature as optional.
38572  */
38573 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38574
38575 /**
38576  * Set this feature as required.
38577  */
38578 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38579
38580 /**
38581  * Checks if this feature is supported.
38582  */
38583 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38584
38585 /**
38586  * Set this feature as optional.
38587  */
38588 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38589
38590 /**
38591  * Set this feature as required.
38592  */
38593 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38594
38595 /**
38596  * Checks if this feature is supported.
38597  */
38598 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38599
38600 /**
38601  * Checks if this feature is required.
38602  */
38603 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38604
38605 /**
38606  * Checks if this feature is required.
38607  */
38608 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38609
38610 /**
38611  * Set this feature as optional.
38612  */
38613 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38614
38615 /**
38616  * Set this feature as required.
38617  */
38618 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38619
38620 /**
38621  * Checks if this feature is supported.
38622  */
38623 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38624
38625 /**
38626  * Set this feature as optional.
38627  */
38628 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38629
38630 /**
38631  * Set this feature as required.
38632  */
38633 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38634
38635 /**
38636  * Checks if this feature is supported.
38637  */
38638 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38639
38640 /**
38641  * Set this feature as optional.
38642  */
38643 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38644
38645 /**
38646  * Set this feature as required.
38647  */
38648 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38649
38650 /**
38651  * Checks if this feature is supported.
38652  */
38653 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38654
38655 /**
38656  * Checks if this feature is required.
38657  */
38658 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38659
38660 /**
38661  * Checks if this feature is required.
38662  */
38663 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38664
38665 /**
38666  * Checks if this feature is required.
38667  */
38668 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38669
38670 /**
38671  * Set this feature as optional.
38672  */
38673 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38674
38675 /**
38676  * Set this feature as required.
38677  */
38678 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38679
38680 /**
38681  * Checks if this feature is supported.
38682  */
38683 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38684
38685 /**
38686  * Set this feature as optional.
38687  */
38688 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38689
38690 /**
38691  * Set this feature as required.
38692  */
38693 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38694
38695 /**
38696  * Checks if this feature is supported.
38697  */
38698 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38699
38700 /**
38701  * Set this feature as optional.
38702  */
38703 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38704
38705 /**
38706  * Set this feature as required.
38707  */
38708 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38709
38710 /**
38711  * Checks if this feature is supported.
38712  */
38713 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38714
38715 /**
38716  * Checks if this feature is required.
38717  */
38718 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38719
38720 /**
38721  * Checks if this feature is required.
38722  */
38723 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38724
38725 /**
38726  * Checks if this feature is required.
38727  */
38728 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38729
38730 /**
38731  * Set this feature as optional.
38732  */
38733 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38734
38735 /**
38736  * Set this feature as required.
38737  */
38738 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38739
38740 /**
38741  * Checks if this feature is supported.
38742  */
38743 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38744
38745 /**
38746  * Set this feature as optional.
38747  */
38748 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38749
38750 /**
38751  * Set this feature as required.
38752  */
38753 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38754
38755 /**
38756  * Checks if this feature is supported.
38757  */
38758 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38759
38760 /**
38761  * Checks if this feature is required.
38762  */
38763 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38764
38765 /**
38766  * Checks if this feature is required.
38767  */
38768 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38769
38770 /**
38771  * Set this feature as optional.
38772  */
38773 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38774
38775 /**
38776  * Set this feature as required.
38777  */
38778 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38779
38780 /**
38781  * Checks if this feature is supported.
38782  */
38783 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38784
38785 /**
38786  * Set this feature as optional.
38787  */
38788 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38789
38790 /**
38791  * Set this feature as required.
38792  */
38793 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38794
38795 /**
38796  * Checks if this feature is supported.
38797  */
38798 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38799
38800 /**
38801  * Set this feature as optional.
38802  */
38803 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38804
38805 /**
38806  * Set this feature as required.
38807  */
38808 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38809
38810 /**
38811  * Checks if this feature is supported.
38812  */
38813 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38814
38815 /**
38816  * Checks if this feature is required.
38817  */
38818 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38819
38820 /**
38821  * Checks if this feature is required.
38822  */
38823 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38824
38825 /**
38826  * Checks if this feature is required.
38827  */
38828 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38829
38830 /**
38831  * Set this feature as optional.
38832  */
38833 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38834
38835 /**
38836  * Set this feature as required.
38837  */
38838 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38839
38840 /**
38841  * Checks if this feature is supported.
38842  */
38843 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38844
38845 /**
38846  * Set this feature as optional.
38847  */
38848 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38849
38850 /**
38851  * Set this feature as required.
38852  */
38853 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38854
38855 /**
38856  * Checks if this feature is supported.
38857  */
38858 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38859
38860 /**
38861  * Checks if this feature is required.
38862  */
38863 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38864
38865 /**
38866  * Checks if this feature is required.
38867  */
38868 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38869
38870 /**
38871  * Set this feature as optional.
38872  */
38873 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38874
38875 /**
38876  * Set this feature as required.
38877  */
38878 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38879
38880 /**
38881  * Checks if this feature is supported.
38882  */
38883 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38884
38885 /**
38886  * Set this feature as optional.
38887  */
38888 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38889
38890 /**
38891  * Set this feature as required.
38892  */
38893 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38894
38895 /**
38896  * Checks if this feature is supported.
38897  */
38898 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38899
38900 /**
38901  * Checks if this feature is required.
38902  */
38903 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38904
38905 /**
38906  * Checks if this feature is required.
38907  */
38908 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38909
38910 /**
38911  * Set this feature as optional.
38912  */
38913 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38914
38915 /**
38916  * Set this feature as required.
38917  */
38918 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38919
38920 /**
38921  * Checks if this feature is supported.
38922  */
38923 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38924
38925 /**
38926  * Set this feature as optional.
38927  */
38928 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38929
38930 /**
38931  * Set this feature as required.
38932  */
38933 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38934
38935 /**
38936  * Checks if this feature is supported.
38937  */
38938 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38939
38940 /**
38941  * Set this feature as optional.
38942  */
38943 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38944
38945 /**
38946  * Set this feature as required.
38947  */
38948 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38949
38950 /**
38951  * Checks if this feature is supported.
38952  */
38953 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38954
38955 /**
38956  * Checks if this feature is required.
38957  */
38958 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38959
38960 /**
38961  * Checks if this feature is required.
38962  */
38963 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38964
38965 /**
38966  * Checks if this feature is required.
38967  */
38968 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38969
38970 /**
38971  * Set this feature as optional.
38972  */
38973 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38974
38975 /**
38976  * Set this feature as required.
38977  */
38978 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38979
38980 /**
38981  * Checks if this feature is supported.
38982  */
38983 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38984
38985 /**
38986  * Checks if this feature is required.
38987  */
38988 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38989
38990 /**
38991  * Set this feature as optional.
38992  */
38993 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38994
38995 /**
38996  * Set this feature as required.
38997  */
38998 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38999
39000 /**
39001  * Checks if this feature is supported.
39002  */
39003 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
39004
39005 /**
39006  * Set this feature as optional.
39007  */
39008 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
39009
39010 /**
39011  * Set this feature as required.
39012  */
39013 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
39014
39015 /**
39016  * Checks if this feature is supported.
39017  */
39018 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
39019
39020 /**
39021  * Set this feature as optional.
39022  */
39023 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
39024
39025 /**
39026  * Set this feature as required.
39027  */
39028 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
39029
39030 /**
39031  * Checks if this feature is supported.
39032  */
39033 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
39034
39035 /**
39036  * Checks if this feature is required.
39037  */
39038 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
39039
39040 /**
39041  * Checks if this feature is required.
39042  */
39043 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
39044
39045 /**
39046  * Checks if this feature is required.
39047  */
39048 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
39049
39050 /**
39051  * Set this feature as optional.
39052  */
39053 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
39054
39055 /**
39056  * Set this feature as required.
39057  */
39058 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
39059
39060 /**
39061  * Checks if this feature is supported.
39062  */
39063 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
39064
39065 /**
39066  * Checks if this feature is required.
39067  */
39068 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
39069
39070 /**
39071  * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
39072  */
39073 void ShutdownScript_free(struct LDKShutdownScript this_obj);
39074
39075 /**
39076  * Creates a copy of the ShutdownScript
39077  */
39078 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
39079
39080 /**
39081  * Checks if two ShutdownScripts contain equal inner contents.
39082  * This ignores pointers and is_owned flags and looks at the values in fields.
39083  * Two objects with NULL inner values will be considered "equal" here.
39084  */
39085 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
39086
39087 /**
39088  * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
39089  */
39090 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
39091
39092 /**
39093  * The script that did not meet the requirements from [BOLT #2].
39094  *
39095  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
39096  */
39097 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
39098
39099 /**
39100  * The script that did not meet the requirements from [BOLT #2].
39101  *
39102  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
39103  */
39104 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
39105
39106 /**
39107  * Constructs a new InvalidShutdownScript given each field
39108  */
39109 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
39110
39111 /**
39112  * Creates a copy of the InvalidShutdownScript
39113  */
39114 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
39115
39116 /**
39117  * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
39118  */
39119 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
39120
39121 /**
39122  * Read a ShutdownScript from a byte array, created by ShutdownScript_write
39123  */
39124 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
39125
39126 /**
39127  * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
39128  */
39129 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
39130
39131 /**
39132  * Generates a P2WSH script pubkey from the given [`WScriptHash`].
39133  */
39134 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
39135
39136 /**
39137  * Generates a witness script pubkey from the given segwit version and program.
39138  *
39139  * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
39140  * [`ShutdownScript::new_p2wsh`] instead.
39141  *
39142  * # Errors
39143  *
39144  * This function may return an error if `program` is invalid for the segwit `version`.
39145  */
39146 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
39147
39148 /**
39149  * Converts the shutdown script into the underlying [`Script`].
39150  */
39151 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
39152
39153 /**
39154  * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
39155  *
39156  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39157  */
39158 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
39159
39160 /**
39161  * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
39162  *
39163  * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
39164  */
39165 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
39166
39167 /**
39168  * Frees any resources used by the Retry
39169  */
39170 void Retry_free(struct LDKRetry this_ptr);
39171
39172 /**
39173  * Creates a copy of the Retry
39174  */
39175 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
39176
39177 /**
39178  * Utility method to constructs a new Attempts-variant Retry
39179  */
39180 struct LDKRetry Retry_attempts(uint32_t a);
39181
39182 /**
39183  * Utility method to constructs a new Timeout-variant Retry
39184  */
39185 struct LDKRetry Retry_timeout(uint64_t a);
39186
39187 /**
39188  * Checks if two Retrys contain equal inner contents.
39189  * This ignores pointers and is_owned flags and looks at the values in fields.
39190  */
39191 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
39192
39193 /**
39194  * Generates a non-cryptographic 64-bit hash of the Retry.
39195  */
39196 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
39197
39198 /**
39199  * Serialize the Retry object into a byte array which can be read by Retry_read
39200  */
39201 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
39202
39203 /**
39204  * Read a Retry from a byte array, created by Retry_write
39205  */
39206 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
39207
39208 /**
39209  * Creates a copy of the RetryableSendFailure
39210  */
39211 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
39212
39213 /**
39214  * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
39215  */
39216 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
39217
39218 /**
39219  * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
39220  */
39221 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
39222
39223 /**
39224  * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
39225  */
39226 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
39227
39228 /**
39229  * Checks if two RetryableSendFailures contain equal inner contents.
39230  * This ignores pointers and is_owned flags and looks at the values in fields.
39231  */
39232 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
39233
39234 /**
39235  * Frees any resources used by the PaymentSendFailure
39236  */
39237 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
39238
39239 /**
39240  * Creates a copy of the PaymentSendFailure
39241  */
39242 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
39243
39244 /**
39245  * Utility method to constructs a new ParameterError-variant PaymentSendFailure
39246  */
39247 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
39248
39249 /**
39250  * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
39251  */
39252 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
39253
39254 /**
39255  * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
39256  */
39257 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
39258
39259 /**
39260  * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
39261  */
39262 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
39263
39264 /**
39265  * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
39266  */
39267 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
39268
39269 /**
39270  * Checks if two PaymentSendFailures contain equal inner contents.
39271  * This ignores pointers and is_owned flags and looks at the values in fields.
39272  */
39273 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
39274
39275 /**
39276  * Frees any resources used by the ProbeSendFailure
39277  */
39278 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
39279
39280 /**
39281  * Creates a copy of the ProbeSendFailure
39282  */
39283 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
39284
39285 /**
39286  * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
39287  */
39288 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
39289
39290 /**
39291  * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
39292  */
39293 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
39294
39295 /**
39296  * Checks if two ProbeSendFailures contain equal inner contents.
39297  * This ignores pointers and is_owned flags and looks at the values in fields.
39298  */
39299 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
39300
39301 /**
39302  * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
39303  */
39304 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
39305
39306 /**
39307  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
39308  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
39309  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
39310  * attacks.
39311  *
39312  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
39313  * multi-path payments require a recipient-provided secret.
39314  *
39315  * Some implementations may reject spontaneous payments with payment secrets, so you may only
39316  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
39317  * recipient will not reject it.
39318  */
39319 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
39320
39321 /**
39322  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
39323  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
39324  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
39325  * attacks.
39326  *
39327  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
39328  * multi-path payments require a recipient-provided secret.
39329  *
39330  * Some implementations may reject spontaneous payments with payment secrets, so you may only
39331  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
39332  * recipient will not reject it.
39333  */
39334 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
39335
39336 /**
39337  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
39338  * arbitrary length. This gives recipients substantially more flexibility to receive
39339  * additional data.
39340  *
39341  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
39342  * scheme to authenticate received payments against expected payments and invoices, this field
39343  * is not used in LDK for received payments, and can be used to store arbitrary data in
39344  * invoices which will be received with the payment.
39345  *
39346  * Note that this field was added to the lightning specification more recently than
39347  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
39348  * may not be supported as universally.
39349  *
39350  * Returns a copy of the field.
39351  */
39352 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
39353
39354 /**
39355  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
39356  * arbitrary length. This gives recipients substantially more flexibility to receive
39357  * additional data.
39358  *
39359  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
39360  * scheme to authenticate received payments against expected payments and invoices, this field
39361  * is not used in LDK for received payments, and can be used to store arbitrary data in
39362  * invoices which will be received with the payment.
39363  *
39364  * Note that this field was added to the lightning specification more recently than
39365  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
39366  * may not be supported as universally.
39367  */
39368 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
39369
39370 /**
39371  * Creates a copy of the RecipientOnionFields
39372  */
39373 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
39374
39375 /**
39376  * Checks if two RecipientOnionFieldss contain equal inner contents.
39377  * This ignores pointers and is_owned flags and looks at the values in fields.
39378  * Two objects with NULL inner values will be considered "equal" here.
39379  */
39380 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
39381
39382 /**
39383  * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
39384  */
39385 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
39386
39387 /**
39388  * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
39389  */
39390 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
39391
39392 /**
39393  * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
39394  * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
39395  * but do not require or provide any further data.
39396  */
39397 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
39398
39399 /**
39400  * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
39401  * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
39402  * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
39403  * a spontaneous MPP this will not work as all MPP require payment secrets; you may
39404  * instead want to use [`RecipientOnionFields::secret_only`].
39405  *
39406  * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
39407  * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
39408  */
39409 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
39410
39411 /**
39412  * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
39413  * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
39414  * respectively. TLV type numbers must be unique and within the range
39415  * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
39416  *
39417  * This method will also error for types in the experimental range which have been
39418  * standardized within the protocol, which only includes 5482373484 (keysend) for now.
39419  *
39420  * See [`Self::custom_tlvs`] for more info.
39421  */
39422 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
39423
39424 /**
39425  * Gets the custom TLVs that will be sent or have been received.
39426  *
39427  * Custom TLVs allow sending extra application-specific data with a payment. They provide
39428  * additional flexibility on top of payment metadata, as while other implementations may
39429  * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
39430  * do not have this restriction.
39431  *
39432  * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
39433  * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
39434  * This is validated when setting this field using [`Self::with_custom_tlvs`].
39435  */
39436 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
39437
39438 /**
39439  * Calls the free function if one is set
39440  */
39441 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
39442
39443 /**
39444  * Creates a copy of a Type
39445  */
39446 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
39447
39448 /**
39449  * Calls the free function if one is set
39450  */
39451 void Type_free(struct LDKType this_ptr);
39452
39453 /**
39454  * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
39455  */
39456 void Offer_free(struct LDKOffer this_obj);
39457
39458 /**
39459  * Creates a copy of the Offer
39460  */
39461 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
39462
39463 /**
39464  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
39465  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
39466  * for the selected chain.
39467  */
39468 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
39469
39470 /**
39471  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
39472  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
39473  */
39474 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
39475
39476 /**
39477  * The minimum amount required for a successful payment of a single item.
39478  *
39479  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39480  */
39481 MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
39482
39483 /**
39484  * A complete description of the purpose of the payment. Intended to be displayed to the user
39485  * but with the caveat that it has not been verified in any way.
39486  */
39487 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
39488
39489 /**
39490  * Features pertaining to the offer.
39491  */
39492 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
39493
39494 /**
39495  * Duration since the Unix epoch when an invoice should no longer be requested.
39496  *
39497  * If `None`, the offer does not expire.
39498  */
39499 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
39500
39501 /**
39502  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
39503  * displayed to the user but with the caveat that it has not been verified in any way.
39504  *
39505  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39506  */
39507 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
39508
39509 /**
39510  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
39511  * recipient privacy by obfuscating its node id.
39512  */
39513 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
39514
39515 /**
39516  * The quantity of items supported.
39517  */
39518 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
39519
39520 /**
39521  * The public key used by the recipient to sign invoices.
39522  */
39523 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
39524
39525 /**
39526  * Returns whether the given chain is supported by the offer.
39527  */
39528 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
39529
39530 /**
39531  * Whether the offer has expired.
39532  */
39533 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
39534
39535 /**
39536  * Returns whether the given quantity is valid for the offer.
39537  */
39538 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
39539
39540 /**
39541  * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
39542  *
39543  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
39544  */
39545 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
39546
39547 /**
39548  * Serialize the Offer object into a byte array which can be read by Offer_read
39549  */
39550 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
39551
39552 /**
39553  * Frees any resources used by the Amount, if is_owned is set and inner is non-NULL.
39554  */
39555 void Amount_free(struct LDKAmount this_obj);
39556
39557 /**
39558  * Creates a copy of the Amount
39559  */
39560 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
39561
39562 /**
39563  * Frees any resources used by the Quantity, if is_owned is set and inner is non-NULL.
39564  */
39565 void Quantity_free(struct LDKQuantity this_obj);
39566
39567 /**
39568  * Creates a copy of the Quantity
39569  */
39570 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
39571
39572 /**
39573  * Read a Offer object from a string
39574  */
39575 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
39576
39577 /**
39578  * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
39579  */
39580 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
39581
39582 /**
39583  * Returns the [`TaggedHash`] of the invoice to sign.
39584  */
39585 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39586
39587 /**
39588  * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
39589  */
39590 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
39591
39592 /**
39593  * Creates a copy of the Bolt12Invoice
39594  */
39595 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
39596
39597 /**
39598  * The chains that may be used when paying a requested invoice.
39599  *
39600  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
39601  *
39602  * [`Offer::chains`]: crate::offers::offer::Offer::chains
39603  */
39604 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39605
39606 /**
39607  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
39608  * invoice originated from an offer.
39609  *
39610  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
39611  *
39612  * [`offer_chains`]: Self::offer_chains
39613  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
39614  */
39615 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39616
39617 /**
39618  * Opaque bytes set by the originating [`Offer`].
39619  *
39620  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
39621  * if the [`Offer`] did not set it.
39622  *
39623  * [`Offer`]: crate::offers::offer::Offer
39624  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
39625  */
39626 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39627
39628 /**
39629  * The minimum amount required for a successful payment of a single item.
39630  *
39631  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
39632  * the [`Offer`] did not set it.
39633  *
39634  * [`Offer`]: crate::offers::offer::Offer
39635  * [`Offer::amount`]: crate::offers::offer::Offer::amount
39636  *
39637  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39638  */
39639 MUST_USE_RES struct LDKAmount UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39640
39641 /**
39642  * Features pertaining to the originating [`Offer`].
39643  *
39644  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
39645  * [`Refund`].
39646  *
39647  * [`Offer`]: crate::offers::offer::Offer
39648  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
39649  *
39650  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39651  */
39652 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39653
39654 /**
39655  * A complete description of the purpose of the originating offer or refund.
39656  *
39657  * From [`Offer::description`] or [`Refund::description`].
39658  *
39659  * [`Offer::description`]: crate::offers::offer::Offer::description
39660  */
39661 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39662
39663 /**
39664  * Duration since the Unix epoch when an invoice should no longer be requested.
39665  *
39666  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
39667  *
39668  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
39669  */
39670 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39671
39672 /**
39673  * The issuer of the offer or refund.
39674  *
39675  * From [`Offer::issuer`] or [`Refund::issuer`].
39676  *
39677  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
39678  *
39679  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39680  */
39681 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39682
39683 /**
39684  * Paths to the recipient originating from publicly reachable nodes.
39685  *
39686  * From [`Offer::paths`] or [`Refund::paths`].
39687  *
39688  * [`Offer::paths`]: crate::offers::offer::Offer::paths
39689  */
39690 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39691
39692 /**
39693  * The quantity of items supported.
39694  *
39695  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
39696  * [`Refund`].
39697  *
39698  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
39699  *
39700  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39701  */
39702 MUST_USE_RES struct LDKQuantity UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39703
39704 /**
39705  * An unpredictable series of bytes from the payer.
39706  *
39707  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
39708  */
39709 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39710
39711 /**
39712  * Features pertaining to requesting an invoice.
39713  *
39714  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
39715  */
39716 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39717
39718 /**
39719  * The quantity of items requested or refunded for.
39720  *
39721  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
39722  */
39723 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39724
39725 /**
39726  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
39727  * refund in case there are no [`message_paths`].
39728  *
39729  * [`message_paths`]: Self::message_paths
39730  */
39731 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39732
39733 /**
39734  * A payer-provided note reflected back in the invoice.
39735  *
39736  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
39737  *
39738  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39739  */
39740 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39741
39742 /**
39743  * Duration since the Unix epoch when the invoice was created.
39744  */
39745 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39746
39747 /**
39748  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
39749  * should no longer be paid.
39750  */
39751 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39752
39753 /**
39754  * Whether the invoice has expired.
39755  */
39756 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39757
39758 /**
39759  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
39760  */
39761 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39762
39763 /**
39764  * The minimum amount required for a successful payment of the invoice.
39765  */
39766 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39767
39768 /**
39769  * Features pertaining to paying an invoice.
39770  */
39771 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39772
39773 /**
39774  * The public key corresponding to the key used to sign the invoice.
39775  */
39776 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39777
39778 /**
39779  * The chains that may be used when paying a requested invoice.
39780  *
39781  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
39782  *
39783  * [`Offer::chains`]: crate::offers::offer::Offer::chains
39784  */
39785 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39786
39787 /**
39788  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
39789  * invoice originated from an offer.
39790  *
39791  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
39792  *
39793  * [`offer_chains`]: Self::offer_chains
39794  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
39795  */
39796 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39797
39798 /**
39799  * Opaque bytes set by the originating [`Offer`].
39800  *
39801  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
39802  * if the [`Offer`] did not set it.
39803  *
39804  * [`Offer`]: crate::offers::offer::Offer
39805  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
39806  */
39807 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39808
39809 /**
39810  * The minimum amount required for a successful payment of a single item.
39811  *
39812  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
39813  * the [`Offer`] did not set it.
39814  *
39815  * [`Offer`]: crate::offers::offer::Offer
39816  * [`Offer::amount`]: crate::offers::offer::Offer::amount
39817  *
39818  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39819  */
39820 MUST_USE_RES struct LDKAmount Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39821
39822 /**
39823  * Features pertaining to the originating [`Offer`].
39824  *
39825  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
39826  * [`Refund`].
39827  *
39828  * [`Offer`]: crate::offers::offer::Offer
39829  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
39830  *
39831  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39832  */
39833 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39834
39835 /**
39836  * A complete description of the purpose of the originating offer or refund.
39837  *
39838  * From [`Offer::description`] or [`Refund::description`].
39839  *
39840  * [`Offer::description`]: crate::offers::offer::Offer::description
39841  */
39842 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39843
39844 /**
39845  * Duration since the Unix epoch when an invoice should no longer be requested.
39846  *
39847  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
39848  *
39849  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
39850  */
39851 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39852
39853 /**
39854  * The issuer of the offer or refund.
39855  *
39856  * From [`Offer::issuer`] or [`Refund::issuer`].
39857  *
39858  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
39859  *
39860  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39861  */
39862 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39863
39864 /**
39865  * Paths to the recipient originating from publicly reachable nodes.
39866  *
39867  * From [`Offer::paths`] or [`Refund::paths`].
39868  *
39869  * [`Offer::paths`]: crate::offers::offer::Offer::paths
39870  */
39871 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39872
39873 /**
39874  * The quantity of items supported.
39875  *
39876  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
39877  * [`Refund`].
39878  *
39879  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
39880  *
39881  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39882  */
39883 MUST_USE_RES struct LDKQuantity Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39884
39885 /**
39886  * An unpredictable series of bytes from the payer.
39887  *
39888  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
39889  */
39890 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39891
39892 /**
39893  * Features pertaining to requesting an invoice.
39894  *
39895  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
39896  */
39897 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39898
39899 /**
39900  * The quantity of items requested or refunded for.
39901  *
39902  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
39903  */
39904 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39905
39906 /**
39907  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
39908  * refund in case there are no [`message_paths`].
39909  *
39910  * [`message_paths`]: Self::message_paths
39911  */
39912 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39913
39914 /**
39915  * A payer-provided note reflected back in the invoice.
39916  *
39917  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
39918  *
39919  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39920  */
39921 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39922
39923 /**
39924  * Duration since the Unix epoch when the invoice was created.
39925  */
39926 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39927
39928 /**
39929  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
39930  * should no longer be paid.
39931  */
39932 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39933
39934 /**
39935  * Whether the invoice has expired.
39936  */
39937 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39938
39939 /**
39940  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
39941  */
39942 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39943
39944 /**
39945  * The minimum amount required for a successful payment of the invoice.
39946  */
39947 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39948
39949 /**
39950  * Features pertaining to paying an invoice.
39951  */
39952 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39953
39954 /**
39955  * The public key corresponding to the key used to sign the invoice.
39956  */
39957 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39958
39959 /**
39960  * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
39961  */
39962 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39963
39964 /**
39965  * Hash that was used for signing the invoice.
39966  */
39967 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39968
39969 /**
39970  * Verifies that the invoice was for a request or refund created using the given key. Returns
39971  * the associated [`PaymentId`] to use when sending the payment.
39972  */
39973 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
39974
39975 /**
39976  * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
39977  */
39978 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
39979
39980 /**
39981  * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
39982  */
39983 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
39984
39985 /**
39986  * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
39987  */
39988 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
39989
39990 /**
39991  * Base fee charged (in millisatoshi) for the entire blinded path.
39992  */
39993 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39994
39995 /**
39996  * Base fee charged (in millisatoshi) for the entire blinded path.
39997  */
39998 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
39999
40000 /**
40001  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
40002  * (i.e., 10,000 is 1%).
40003  */
40004 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40005
40006 /**
40007  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
40008  * (i.e., 10,000 is 1%).
40009  */
40010 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
40011
40012 /**
40013  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
40014  * path.
40015  */
40016 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40017
40018 /**
40019  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
40020  * path.
40021  */
40022 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
40023
40024 /**
40025  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
40026  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
40027  * seen by the recipient.
40028  */
40029 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40030
40031 /**
40032  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
40033  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
40034  * seen by the recipient.
40035  */
40036 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
40037
40038 /**
40039  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
40040  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
40041  * seen by the recipient.
40042  */
40043 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40044
40045 /**
40046  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
40047  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
40048  * seen by the recipient.
40049  */
40050 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
40051
40052 /**
40053  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
40054  * onion payload.
40055  */
40056 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40057
40058 /**
40059  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
40060  * onion payload.
40061  */
40062 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
40063
40064 /**
40065  * Constructs a new BlindedPayInfo given each field
40066  */
40067 MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg);
40068
40069 /**
40070  * Creates a copy of the BlindedPayInfo
40071  */
40072 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
40073
40074 /**
40075  * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
40076  */
40077 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
40078
40079 /**
40080  * Checks if two BlindedPayInfos contain equal inner contents.
40081  * This ignores pointers and is_owned flags and looks at the values in fields.
40082  * Two objects with NULL inner values will be considered "equal" here.
40083  */
40084 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
40085
40086 /**
40087  * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
40088  */
40089 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
40090
40091 /**
40092  * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
40093  */
40094 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
40095
40096 /**
40097  * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
40098  */
40099 void InvoiceError_free(struct LDKInvoiceError this_obj);
40100
40101 /**
40102  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
40103  *
40104  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
40105  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40106  *
40107  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40108  */
40109 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
40110
40111 /**
40112  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
40113  *
40114  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
40115  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40116  *
40117  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40118  */
40119 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
40120
40121 /**
40122  * An explanation of the error.
40123  */
40124 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
40125
40126 /**
40127  * An explanation of the error.
40128  */
40129 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
40130
40131 /**
40132  * Constructs a new InvoiceError given each field
40133  *
40134  * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40135  */
40136 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
40137
40138 /**
40139  * Creates a copy of the InvoiceError
40140  */
40141 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
40142
40143 /**
40144  * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
40145  */
40146 void ErroneousField_free(struct LDKErroneousField this_obj);
40147
40148 /**
40149  * The type number of the TLV field containing the error.
40150  */
40151 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
40152
40153 /**
40154  * The type number of the TLV field containing the error.
40155  */
40156 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
40157
40158 /**
40159  * A value to use for the TLV field to avoid the error.
40160  *
40161  * Returns a copy of the field.
40162  */
40163 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
40164
40165 /**
40166  * A value to use for the TLV field to avoid the error.
40167  */
40168 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
40169
40170 /**
40171  * Constructs a new ErroneousField given each field
40172  */
40173 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
40174
40175 /**
40176  * Creates a copy of the ErroneousField
40177  */
40178 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
40179
40180 /**
40181  * Creates an [`InvoiceError`] with the given message.
40182  */
40183 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
40184
40185 /**
40186  * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
40187  */
40188 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
40189
40190 /**
40191  * Read a InvoiceError from a byte array, created by InvoiceError_write
40192  */
40193 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
40194
40195 /**
40196  * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
40197  */
40198 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
40199
40200 /**
40201  * Returns the [`TaggedHash`] of the invoice to sign.
40202  */
40203 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40204
40205 /**
40206  * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
40207  */
40208 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
40209
40210 /**
40211  * Creates a copy of the InvoiceRequest
40212  */
40213 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
40214
40215 /**
40216  * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
40217  */
40218 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
40219
40220 /**
40221  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
40222  *
40223  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
40224  * [`respond_with`].
40225  *
40226  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40227  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
40228  * [`respond_with`]: Self::respond_with
40229  */
40230 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
40231
40232 /**
40233  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
40234  *
40235  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
40236  * [`respond_with`].
40237  *
40238  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40239  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
40240  * [`respond_with`]: Self::respond_with
40241  */
40242 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
40243
40244 /**
40245  * Creates a copy of the VerifiedInvoiceRequest
40246  */
40247 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
40248
40249 /**
40250  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
40251  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
40252  * for the selected chain.
40253  */
40254 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40255
40256 /**
40257  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
40258  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
40259  */
40260 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40261
40262 /**
40263  * The minimum amount required for a successful payment of a single item.
40264  *
40265  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40266  */
40267 MUST_USE_RES struct LDKAmount UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40268
40269 /**
40270  * A complete description of the purpose of the payment. Intended to be displayed to the user
40271  * but with the caveat that it has not been verified in any way.
40272  */
40273 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40274
40275 /**
40276  * Features pertaining to the offer.
40277  */
40278 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40279
40280 /**
40281  * Duration since the Unix epoch when an invoice should no longer be requested.
40282  *
40283  * If `None`, the offer does not expire.
40284  */
40285 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40286
40287 /**
40288  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
40289  * displayed to the user but with the caveat that it has not been verified in any way.
40290  *
40291  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40292  */
40293 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40294
40295 /**
40296  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
40297  * recipient privacy by obfuscating its node id.
40298  */
40299 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40300
40301 /**
40302  * The quantity of items supported.
40303  */
40304 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40305
40306 /**
40307  * The public key used by the recipient to sign invoices.
40308  */
40309 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40310
40311 /**
40312  * An unpredictable series of bytes, typically containing information about the derivation of
40313  * [`payer_id`].
40314  *
40315  * [`payer_id`]: Self::payer_id
40316  */
40317 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40318
40319 /**
40320  * A chain from [`Offer::chains`] that the offer is valid for.
40321  */
40322 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40323
40324 /**
40325  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
40326  * must be greater than or equal to [`Offer::amount`], converted if necessary.
40327  *
40328  * [`chain`]: Self::chain
40329  */
40330 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40331
40332 /**
40333  * Features pertaining to requesting an invoice.
40334  */
40335 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40336
40337 /**
40338  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
40339  */
40340 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40341
40342 /**
40343  * A possibly transient pubkey used to sign the invoice request.
40344  */
40345 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40346
40347 /**
40348  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
40349  * response.
40350  *
40351  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40352  */
40353 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40354
40355 /**
40356  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
40357  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
40358  * for the selected chain.
40359  */
40360 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40361
40362 /**
40363  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
40364  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
40365  */
40366 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40367
40368 /**
40369  * The minimum amount required for a successful payment of a single item.
40370  *
40371  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40372  */
40373 MUST_USE_RES struct LDKAmount InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40374
40375 /**
40376  * A complete description of the purpose of the payment. Intended to be displayed to the user
40377  * but with the caveat that it has not been verified in any way.
40378  */
40379 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40380
40381 /**
40382  * Features pertaining to the offer.
40383  */
40384 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40385
40386 /**
40387  * Duration since the Unix epoch when an invoice should no longer be requested.
40388  *
40389  * If `None`, the offer does not expire.
40390  */
40391 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40392
40393 /**
40394  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
40395  * displayed to the user but with the caveat that it has not been verified in any way.
40396  *
40397  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40398  */
40399 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40400
40401 /**
40402  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
40403  * recipient privacy by obfuscating its node id.
40404  */
40405 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40406
40407 /**
40408  * The quantity of items supported.
40409  */
40410 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40411
40412 /**
40413  * The public key used by the recipient to sign invoices.
40414  */
40415 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40416
40417 /**
40418  * An unpredictable series of bytes, typically containing information about the derivation of
40419  * [`payer_id`].
40420  *
40421  * [`payer_id`]: Self::payer_id
40422  */
40423 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40424
40425 /**
40426  * A chain from [`Offer::chains`] that the offer is valid for.
40427  */
40428 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40429
40430 /**
40431  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
40432  * must be greater than or equal to [`Offer::amount`], converted if necessary.
40433  *
40434  * [`chain`]: Self::chain
40435  */
40436 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40437
40438 /**
40439  * Features pertaining to requesting an invoice.
40440  */
40441 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40442
40443 /**
40444  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
40445  */
40446 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40447
40448 /**
40449  * A possibly transient pubkey used to sign the invoice request.
40450  */
40451 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40452
40453 /**
40454  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
40455  * response.
40456  *
40457  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40458  */
40459 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40460
40461 /**
40462  * Signature of the invoice request using [`payer_id`].
40463  *
40464  * [`payer_id`]: Self::payer_id
40465  */
40466 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40467
40468 /**
40469  * Verifies that the request was for an offer created using the given key. Returns the verified
40470  * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
40471  * if they could be extracted from the metadata.
40472  *
40473  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40474  */
40475 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
40476
40477 /**
40478  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
40479  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
40480  * for the selected chain.
40481  */
40482 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40483
40484 /**
40485  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
40486  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
40487  */
40488 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40489
40490 /**
40491  * The minimum amount required for a successful payment of a single item.
40492  *
40493  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40494  */
40495 MUST_USE_RES struct LDKAmount VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40496
40497 /**
40498  * A complete description of the purpose of the payment. Intended to be displayed to the user
40499  * but with the caveat that it has not been verified in any way.
40500  */
40501 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40502
40503 /**
40504  * Features pertaining to the offer.
40505  */
40506 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40507
40508 /**
40509  * Duration since the Unix epoch when an invoice should no longer be requested.
40510  *
40511  * If `None`, the offer does not expire.
40512  */
40513 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40514
40515 /**
40516  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
40517  * displayed to the user but with the caveat that it has not been verified in any way.
40518  *
40519  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40520  */
40521 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40522
40523 /**
40524  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
40525  * recipient privacy by obfuscating its node id.
40526  */
40527 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40528
40529 /**
40530  * The quantity of items supported.
40531  */
40532 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40533
40534 /**
40535  * The public key used by the recipient to sign invoices.
40536  */
40537 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40538
40539 /**
40540  * An unpredictable series of bytes, typically containing information about the derivation of
40541  * [`payer_id`].
40542  *
40543  * [`payer_id`]: Self::payer_id
40544  */
40545 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40546
40547 /**
40548  * A chain from [`Offer::chains`] that the offer is valid for.
40549  */
40550 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40551
40552 /**
40553  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
40554  * must be greater than or equal to [`Offer::amount`], converted if necessary.
40555  *
40556  * [`chain`]: Self::chain
40557  */
40558 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40559
40560 /**
40561  * Features pertaining to requesting an invoice.
40562  */
40563 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40564
40565 /**
40566  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
40567  */
40568 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40569
40570 /**
40571  * A possibly transient pubkey used to sign the invoice request.
40572  */
40573 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40574
40575 /**
40576  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
40577  * response.
40578  *
40579  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40580  */
40581 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40582
40583 /**
40584  * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
40585  */
40586 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
40587
40588 /**
40589  * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
40590  */
40591 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
40592
40593 /**
40594  * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
40595  */
40596 void TaggedHash_free(struct LDKTaggedHash this_obj);
40597
40598 /**
40599  * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
40600  */
40601 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
40602
40603 /**
40604  * Creates a copy of the Bolt12ParseError
40605  */
40606 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
40607
40608 /**
40609  * Creates a copy of the Bolt12SemanticError
40610  */
40611 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
40612
40613 /**
40614  * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
40615  */
40616 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
40617
40618 /**
40619  * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
40620  */
40621 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
40622
40623 /**
40624  * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
40625  */
40626 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
40627
40628 /**
40629  * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
40630  */
40631 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
40632
40633 /**
40634  * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
40635  */
40636 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
40637
40638 /**
40639  * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
40640  */
40641 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
40642
40643 /**
40644  * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
40645  */
40646 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
40647
40648 /**
40649  * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
40650  */
40651 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
40652
40653 /**
40654  * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
40655  */
40656 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
40657
40658 /**
40659  * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
40660  */
40661 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
40662
40663 /**
40664  * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
40665  */
40666 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
40667
40668 /**
40669  * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
40670  */
40671 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
40672
40673 /**
40674  * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
40675  */
40676 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
40677
40678 /**
40679  * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
40680  */
40681 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
40682
40683 /**
40684  * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
40685  */
40686 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
40687
40688 /**
40689  * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
40690  */
40691 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
40692
40693 /**
40694  * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
40695  */
40696 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
40697
40698 /**
40699  * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
40700  */
40701 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
40702
40703 /**
40704  * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
40705  */
40706 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
40707
40708 /**
40709  * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
40710  */
40711 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
40712
40713 /**
40714  * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
40715  */
40716 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
40717
40718 /**
40719  * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
40720  */
40721 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
40722
40723 /**
40724  * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
40725  */
40726 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
40727
40728 /**
40729  * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
40730  */
40731 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
40732
40733 /**
40734  * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
40735  */
40736 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
40737
40738 /**
40739  * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
40740  */
40741 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
40742
40743 /**
40744  * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
40745  */
40746 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
40747
40748 /**
40749  * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
40750  */
40751 void Refund_free(struct LDKRefund this_obj);
40752
40753 /**
40754  * Creates a copy of the Refund
40755  */
40756 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
40757
40758 /**
40759  * A complete description of the purpose of the refund. Intended to be displayed to the user
40760  * but with the caveat that it has not been verified in any way.
40761  */
40762 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
40763
40764 /**
40765  * Duration since the Unix epoch when an invoice should no longer be sent.
40766  *
40767  * If `None`, the refund does not expire.
40768  */
40769 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
40770
40771 /**
40772  * Whether the refund has expired.
40773  */
40774 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
40775
40776 /**
40777  * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
40778  * displayed to the user but with the caveat that it has not been verified in any way.
40779  *
40780  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40781  */
40782 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
40783
40784 /**
40785  * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
40786  * privacy by obfuscating its node id.
40787  */
40788 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
40789
40790 /**
40791  * An unpredictable series of bytes, typically containing information about the derivation of
40792  * [`payer_id`].
40793  *
40794  * [`payer_id`]: Self::payer_id
40795  */
40796 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
40797
40798 /**
40799  * A chain that the refund is valid for.
40800  */
40801 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
40802
40803 /**
40804  * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
40805  *
40806  * [`chain`]: Self::chain
40807  */
40808 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
40809
40810 /**
40811  * Features pertaining to requesting an invoice.
40812  */
40813 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
40814
40815 /**
40816  * The quantity of an item that refund is for.
40817  */
40818 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
40819
40820 /**
40821  * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
40822  * transient pubkey.
40823  *
40824  * [`paths`]: Self::paths
40825  */
40826 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
40827
40828 /**
40829  * Payer provided note to include in the invoice.
40830  *
40831  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40832  */
40833 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
40834
40835 /**
40836  * Serialize the Refund object into a byte array which can be read by Refund_read
40837  */
40838 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
40839
40840 /**
40841  * Read a Refund object from a string
40842  */
40843 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
40844
40845 /**
40846  * Creates a copy of the UtxoLookupError
40847  */
40848 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
40849
40850 /**
40851  * Utility method to constructs a new UnknownChain-variant UtxoLookupError
40852  */
40853 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
40854
40855 /**
40856  * Utility method to constructs a new UnknownTx-variant UtxoLookupError
40857  */
40858 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
40859
40860 /**
40861  * Frees any resources used by the UtxoResult
40862  */
40863 void UtxoResult_free(struct LDKUtxoResult this_ptr);
40864
40865 /**
40866  * Creates a copy of the UtxoResult
40867  */
40868 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
40869
40870 /**
40871  * Utility method to constructs a new Sync-variant UtxoResult
40872  */
40873 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
40874
40875 /**
40876  * Utility method to constructs a new Async-variant UtxoResult
40877  */
40878 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
40879
40880 /**
40881  * Calls the free function if one is set
40882  */
40883 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
40884
40885 /**
40886  * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
40887  */
40888 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
40889
40890 /**
40891  * Creates a copy of the UtxoFuture
40892  */
40893 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
40894
40895 /**
40896  * Builds a new future for later resolution.
40897  */
40898 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
40899
40900 /**
40901  * Resolves this future against the given `graph` and with the given `result`.
40902  *
40903  * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
40904  * forwarding the validated gossip message onwards to peers.
40905  *
40906  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
40907  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
40908  * after this.
40909  *
40910  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
40911  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
40912  */
40913 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
40914
40915 /**
40916  * Resolves this future against the given `graph` and with the given `result`.
40917  *
40918  * The given `gossip` is used to broadcast any validated messages onwards to all peers which
40919  * have available buffer space.
40920  *
40921  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
40922  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
40923  * after this.
40924  *
40925  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
40926  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
40927  */
40928 void UtxoFuture_resolve(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, const struct LDKP2PGossipSync *NONNULL_PTR gossip, struct LDKCResult_TxOutUtxoLookupErrorZ result);
40929
40930 /**
40931  * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
40932  */
40933 void NodeId_free(struct LDKNodeId this_obj);
40934
40935 /**
40936  * Creates a copy of the NodeId
40937  */
40938 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
40939
40940 /**
40941  * Create a new NodeId from a public key
40942  */
40943 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
40944
40945 /**
40946  * Get the public key slice from this NodeId
40947  */
40948 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
40949
40950 /**
40951  * Get the public key from this NodeId
40952  */
40953 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
40954
40955 /**
40956  * Generates a non-cryptographic 64-bit hash of the NodeId.
40957  */
40958 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
40959
40960 /**
40961  * Serialize the NodeId object into a byte array which can be read by NodeId_read
40962  */
40963 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
40964
40965 /**
40966  * Read a NodeId from a byte array, created by NodeId_write
40967  */
40968 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
40969
40970 /**
40971  * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
40972  */
40973 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
40974
40975 /**
40976  * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
40977  */
40978 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
40979
40980 /**
40981  * Frees any resources used by the NetworkUpdate
40982  */
40983 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
40984
40985 /**
40986  * Creates a copy of the NetworkUpdate
40987  */
40988 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
40989
40990 /**
40991  * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
40992  */
40993 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
40994
40995 /**
40996  * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
40997  */
40998 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
40999
41000 /**
41001  * Utility method to constructs a new NodeFailure-variant NetworkUpdate
41002  */
41003 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
41004
41005 /**
41006  * Checks if two NetworkUpdates contain equal inner contents.
41007  * This ignores pointers and is_owned flags and looks at the values in fields.
41008  */
41009 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
41010
41011 /**
41012  * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
41013  */
41014 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
41015
41016 /**
41017  * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
41018  */
41019 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
41020
41021 /**
41022  * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
41023  */
41024 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
41025
41026 /**
41027  * Creates a new tracker of the actual state of the network of channels and nodes,
41028  * assuming an existing [`NetworkGraph`].
41029  * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
41030  * correct, and the announcement is signed with channel owners' keys.
41031  */
41032 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
41033
41034 /**
41035  * Adds a provider used to check new announcements. Does not affect
41036  * existing announcements unless they are updated.
41037  * Add, update or remove the provider would replace the current one.
41038  */
41039 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
41040
41041 /**
41042  * Handles any network updates originating from [`Event`]s.
41043  * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
41044  * leaking possibly identifying information of the sender to the public network.
41045  *
41046  * [`Event`]: crate::events::Event
41047  */
41048 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
41049
41050 /**
41051  * Gets the chain hash for this network graph.
41052  */
41053 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41054
41055 /**
41056  * Verifies the signature of a [`NodeAnnouncement`].
41057  *
41058  * Returns an error if it is invalid.
41059  */
41060 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
41061
41062 /**
41063  * Verifies all signatures included in a [`ChannelAnnouncement`].
41064  *
41065  * Returns an error if one of the signatures is invalid.
41066  */
41067 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
41068
41069 /**
41070  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
41071  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
41072  */
41073 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
41074
41075 /**
41076  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
41077  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
41078  */
41079 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
41080
41081 /**
41082  * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
41083  */
41084 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
41085
41086 /**
41087  * When the last update to the channel direction was issued.
41088  * Value is opaque, as set in the announcement.
41089  */
41090 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41091
41092 /**
41093  * When the last update to the channel direction was issued.
41094  * Value is opaque, as set in the announcement.
41095  */
41096 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
41097
41098 /**
41099  * Whether the channel can be currently used for payments (in this one direction).
41100  */
41101 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41102
41103 /**
41104  * Whether the channel can be currently used for payments (in this one direction).
41105  */
41106 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
41107
41108 /**
41109  * The difference in CLTV values that you must have when routing through this channel.
41110  */
41111 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41112
41113 /**
41114  * The difference in CLTV values that you must have when routing through this channel.
41115  */
41116 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
41117
41118 /**
41119  * The minimum value, which must be relayed to the next hop via the channel
41120  */
41121 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41122
41123 /**
41124  * The minimum value, which must be relayed to the next hop via the channel
41125  */
41126 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
41127
41128 /**
41129  * The maximum value which may be relayed to the next hop via the channel.
41130  */
41131 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41132
41133 /**
41134  * The maximum value which may be relayed to the next hop via the channel.
41135  */
41136 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
41137
41138 /**
41139  * Fees charged when the channel is used for routing
41140  */
41141 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41142
41143 /**
41144  * Fees charged when the channel is used for routing
41145  */
41146 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
41147
41148 /**
41149  * Most recent update for the channel received from the network
41150  * Mostly redundant with the data we store in fields explicitly.
41151  * Everything else is useful only for sending out for initial routing sync.
41152  * Not stored if contains excess data to prevent DoS.
41153  *
41154  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41155  */
41156 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41157
41158 /**
41159  * Most recent update for the channel received from the network
41160  * Mostly redundant with the data we store in fields explicitly.
41161  * Everything else is useful only for sending out for initial routing sync.
41162  * Not stored if contains excess data to prevent DoS.
41163  *
41164  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41165  */
41166 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
41167
41168 /**
41169  * Constructs a new ChannelUpdateInfo given each field
41170  *
41171  * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41172  */
41173 MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
41174
41175 /**
41176  * Creates a copy of the ChannelUpdateInfo
41177  */
41178 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
41179
41180 /**
41181  * Checks if two ChannelUpdateInfos contain equal inner contents.
41182  * This ignores pointers and is_owned flags and looks at the values in fields.
41183  * Two objects with NULL inner values will be considered "equal" here.
41184  */
41185 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
41186
41187 /**
41188  * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
41189  */
41190 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
41191
41192 /**
41193  * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
41194  */
41195 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
41196
41197 /**
41198  * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
41199  */
41200 void ChannelInfo_free(struct LDKChannelInfo this_obj);
41201
41202 /**
41203  * Protocol features of a channel communicated during its announcement
41204  */
41205 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41206
41207 /**
41208  * Protocol features of a channel communicated during its announcement
41209  */
41210 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41211
41212 /**
41213  * Source node of the first direction of a channel
41214  */
41215 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41216
41217 /**
41218  * Source node of the first direction of a channel
41219  */
41220 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
41221
41222 /**
41223  * Details about the first direction of a channel
41224  *
41225  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41226  */
41227 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41228
41229 /**
41230  * Details about the first direction of a channel
41231  *
41232  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41233  */
41234 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
41235
41236 /**
41237  * Source node of the second direction of a channel
41238  */
41239 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41240
41241 /**
41242  * Source node of the second direction of a channel
41243  */
41244 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
41245
41246 /**
41247  * Details about the second direction of a channel
41248  *
41249  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41250  */
41251 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41252
41253 /**
41254  * Details about the second direction of a channel
41255  *
41256  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41257  */
41258 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
41259
41260 /**
41261  * The channel capacity as seen on-chain, if chain lookup is available.
41262  */
41263 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41264
41265 /**
41266  * The channel capacity as seen on-chain, if chain lookup is available.
41267  */
41268 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
41269
41270 /**
41271  * An initial announcement of the channel
41272  * Mostly redundant with the data we store in fields explicitly.
41273  * Everything else is useful only for sending out for initial routing sync.
41274  * Not stored if contains excess data to prevent DoS.
41275  *
41276  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41277  */
41278 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41279
41280 /**
41281  * An initial announcement of the channel
41282  * Mostly redundant with the data we store in fields explicitly.
41283  * Everything else is useful only for sending out for initial routing sync.
41284  * Not stored if contains excess data to prevent DoS.
41285  *
41286  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41287  */
41288 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
41289
41290 /**
41291  * Creates a copy of the ChannelInfo
41292  */
41293 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
41294
41295 /**
41296  * Checks if two ChannelInfos contain equal inner contents.
41297  * This ignores pointers and is_owned flags and looks at the values in fields.
41298  * Two objects with NULL inner values will be considered "equal" here.
41299  */
41300 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
41301
41302 /**
41303  * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
41304  *
41305  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41306  */
41307 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
41308
41309 /**
41310  * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
41311  */
41312 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
41313
41314 /**
41315  * Read a ChannelInfo from a byte array, created by ChannelInfo_write
41316  */
41317 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
41318
41319 /**
41320  * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
41321  */
41322 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
41323
41324 /**
41325  * Creates a copy of the DirectedChannelInfo
41326  */
41327 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
41328
41329 /**
41330  * Returns information for the channel.
41331  */
41332 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
41333
41334 /**
41335  * Returns the maximum HTLC amount allowed over the channel in the direction.
41336  */
41337 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
41338
41339 /**
41340  * Returns the [`EffectiveCapacity`] of the channel in the direction.
41341  *
41342  * This is either the total capacity from the funding transaction, if known, or the
41343  * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
41344  * otherwise.
41345  */
41346 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
41347
41348 /**
41349  * Frees any resources used by the EffectiveCapacity
41350  */
41351 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
41352
41353 /**
41354  * Creates a copy of the EffectiveCapacity
41355  */
41356 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
41357
41358 /**
41359  * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
41360  */
41361 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
41362
41363 /**
41364  * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
41365  */
41366 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
41367
41368 /**
41369  * Utility method to constructs a new Total-variant EffectiveCapacity
41370  */
41371 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
41372
41373 /**
41374  * Utility method to constructs a new Infinite-variant EffectiveCapacity
41375  */
41376 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
41377
41378 /**
41379  * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
41380  */
41381 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
41382
41383 /**
41384  * Utility method to constructs a new Unknown-variant EffectiveCapacity
41385  */
41386 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
41387
41388 /**
41389  * Returns the effective capacity denominated in millisatoshi.
41390  */
41391 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
41392
41393 /**
41394  * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
41395  */
41396 void RoutingFees_free(struct LDKRoutingFees this_obj);
41397
41398 /**
41399  * Flat routing fee in millisatoshis.
41400  */
41401 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
41402
41403 /**
41404  * Flat routing fee in millisatoshis.
41405  */
41406 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
41407
41408 /**
41409  * Liquidity-based routing fee in millionths of a routed amount.
41410  * In other words, 10000 is 1%.
41411  */
41412 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
41413
41414 /**
41415  * Liquidity-based routing fee in millionths of a routed amount.
41416  * In other words, 10000 is 1%.
41417  */
41418 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
41419
41420 /**
41421  * Constructs a new RoutingFees given each field
41422  */
41423 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
41424
41425 /**
41426  * Checks if two RoutingFeess contain equal inner contents.
41427  * This ignores pointers and is_owned flags and looks at the values in fields.
41428  * Two objects with NULL inner values will be considered "equal" here.
41429  */
41430 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
41431
41432 /**
41433  * Creates a copy of the RoutingFees
41434  */
41435 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
41436
41437 /**
41438  * Generates a non-cryptographic 64-bit hash of the RoutingFees.
41439  */
41440 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
41441
41442 /**
41443  * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
41444  */
41445 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
41446
41447 /**
41448  * Read a RoutingFees from a byte array, created by RoutingFees_write
41449  */
41450 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
41451
41452 /**
41453  * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
41454  */
41455 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
41456
41457 /**
41458  * Protocol features the node announced support for
41459  */
41460 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
41461
41462 /**
41463  * Protocol features the node announced support for
41464  */
41465 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41466
41467 /**
41468  * When the last known update to the node state was issued.
41469  * Value is opaque, as set in the announcement.
41470  */
41471 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
41472
41473 /**
41474  * When the last known update to the node state was issued.
41475  * Value is opaque, as set in the announcement.
41476  */
41477 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
41478
41479 /**
41480  * Color assigned to the node
41481  */
41482 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
41483
41484 /**
41485  * Color assigned to the node
41486  */
41487 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
41488
41489 /**
41490  * Moniker assigned to the node.
41491  * May be invalid or malicious (eg control chars),
41492  * should not be exposed to the user.
41493  */
41494 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
41495
41496 /**
41497  * Moniker assigned to the node.
41498  * May be invalid or malicious (eg control chars),
41499  * should not be exposed to the user.
41500  */
41501 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
41502
41503 /**
41504  * An initial announcement of the node
41505  * Mostly redundant with the data we store in fields explicitly.
41506  * Everything else is useful only for sending out for initial routing sync.
41507  * Not stored if contains excess data to prevent DoS.
41508  *
41509  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41510  */
41511 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
41512
41513 /**
41514  * An initial announcement of the node
41515  * Mostly redundant with the data we store in fields explicitly.
41516  * Everything else is useful only for sending out for initial routing sync.
41517  * Not stored if contains excess data to prevent DoS.
41518  *
41519  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41520  */
41521 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
41522
41523 /**
41524  * Constructs a new NodeAnnouncementInfo given each field
41525  *
41526  * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41527  */
41528 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKNodeAnnouncement announcement_message_arg);
41529
41530 /**
41531  * Creates a copy of the NodeAnnouncementInfo
41532  */
41533 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
41534
41535 /**
41536  * Checks if two NodeAnnouncementInfos contain equal inner contents.
41537  * This ignores pointers and is_owned flags and looks at the values in fields.
41538  * Two objects with NULL inner values will be considered "equal" here.
41539  */
41540 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
41541
41542 /**
41543  * Internet-level addresses via which one can connect to the node
41544  */
41545 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
41546
41547 /**
41548  * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
41549  */
41550 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
41551
41552 /**
41553  * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
41554  */
41555 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
41556
41557 /**
41558  * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
41559  */
41560 void NodeAlias_free(struct LDKNodeAlias this_obj);
41561
41562 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
41563
41564 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41565
41566 /**
41567  * Constructs a new NodeAlias given each field
41568  */
41569 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
41570
41571 /**
41572  * Creates a copy of the NodeAlias
41573  */
41574 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
41575
41576 /**
41577  * Checks if two NodeAliass contain equal inner contents.
41578  * This ignores pointers and is_owned flags and looks at the values in fields.
41579  * Two objects with NULL inner values will be considered "equal" here.
41580  */
41581 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
41582
41583 /**
41584  * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
41585  */
41586 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
41587
41588 /**
41589  * Read a NodeAlias from a byte array, created by NodeAlias_write
41590  */
41591 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
41592
41593 /**
41594  * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
41595  */
41596 void NodeInfo_free(struct LDKNodeInfo this_obj);
41597
41598 /**
41599  * All valid channels a node has announced
41600  *
41601  * Returns a copy of the field.
41602  */
41603 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
41604
41605 /**
41606  * All valid channels a node has announced
41607  */
41608 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
41609
41610 /**
41611  * More information about a node from node_announcement.
41612  * Optional because we store a Node entry after learning about it from
41613  * a channel announcement, but before receiving a node announcement.
41614  *
41615  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41616  */
41617 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
41618
41619 /**
41620  * More information about a node from node_announcement.
41621  * Optional because we store a Node entry after learning about it from
41622  * a channel announcement, but before receiving a node announcement.
41623  *
41624  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41625  */
41626 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
41627
41628 /**
41629  * Constructs a new NodeInfo given each field
41630  *
41631  * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41632  */
41633 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
41634
41635 /**
41636  * Creates a copy of the NodeInfo
41637  */
41638 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
41639
41640 /**
41641  * Checks if two NodeInfos contain equal inner contents.
41642  * This ignores pointers and is_owned flags and looks at the values in fields.
41643  * Two objects with NULL inner values will be considered "equal" here.
41644  */
41645 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
41646
41647 /**
41648  * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
41649  */
41650 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
41651
41652 /**
41653  * Read a NodeInfo from a byte array, created by NodeInfo_write
41654  */
41655 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
41656
41657 /**
41658  * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
41659  */
41660 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
41661
41662 /**
41663  * Read a NetworkGraph from a byte array, created by NetworkGraph_write
41664  */
41665 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
41666
41667 /**
41668  * Creates a new, empty, network graph.
41669  */
41670 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
41671
41672 /**
41673  * Returns a read-only view of the network graph.
41674  */
41675 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41676
41677 /**
41678  * The unix timestamp provided by the most recent rapid gossip sync.
41679  * It will be set by the rapid sync process after every sync completion.
41680  */
41681 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41682
41683 /**
41684  * Update the unix timestamp provided by the most recent rapid gossip sync.
41685  * This should be done automatically by the rapid sync process after every sync completion.
41686  */
41687 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
41688
41689 /**
41690  * For an already known node (from channel announcements), update its stored properties from a
41691  * given node announcement.
41692  *
41693  * You probably don't want to call this directly, instead relying on a P2PGossipSync's
41694  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
41695  * routing messages from a source using a protocol other than the lightning P2P protocol.
41696  */
41697 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
41698
41699 /**
41700  * For an already known node (from channel announcements), update its stored properties from a
41701  * given node announcement without verifying the associated signatures. Because we aren't
41702  * given the associated signatures here we cannot relay the node announcement to any of our
41703  * peers.
41704  */
41705 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
41706
41707 /**
41708  * Store or update channel info from a channel announcement.
41709  *
41710  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41711  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41712  * routing messages from a source using a protocol other than the lightning P2P protocol.
41713  *
41714  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
41715  * the corresponding UTXO exists on chain and is correctly-formatted.
41716  */
41717 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup);
41718
41719 /**
41720  * Store or update channel info from a channel announcement.
41721  *
41722  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41723  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41724  * routing messages from a source using a protocol other than the lightning P2P protocol.
41725  *
41726  * This will skip verification of if the channel is actually on-chain.
41727  */
41728 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement_no_lookup(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
41729
41730 /**
41731  * Store or update channel info from a channel announcement without verifying the associated
41732  * signatures. Because we aren't given the associated signatures here we cannot relay the
41733  * channel announcement to any of our peers.
41734  *
41735  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
41736  * the corresponding UTXO exists on chain and is correctly-formatted.
41737  */
41738 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_UtxoLookupZ utxo_lookup);
41739
41740 /**
41741  * Update channel from partial announcement data received via rapid gossip sync
41742  *
41743  * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
41744  * rapid gossip sync server)
41745  *
41746  * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
41747  */
41748 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_add_channel_from_partial_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t timestamp, struct LDKChannelFeatures features, struct LDKPublicKey node_id_1, struct LDKPublicKey node_id_2);
41749
41750 /**
41751  * Marks a channel in the graph as failed permanently.
41752  *
41753  * The channel and any node for which this was their last channel are removed from the graph.
41754  */
41755 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
41756
41757 /**
41758  * Marks a node in the graph as permanently failed, effectively removing it and its channels
41759  * from local storage.
41760  */
41761 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
41762
41763 /**
41764  * Removes information about channels that we haven't heard any updates about in some time.
41765  * This can be used regularly to prune the network graph of channels that likely no longer
41766  * exist.
41767  *
41768  * While there is no formal requirement that nodes regularly re-broadcast their channel
41769  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
41770  * pruning occur for updates which are at least two weeks old, which we implement here.
41771  *
41772  * Note that for users of the `lightning-background-processor` crate this method may be
41773  * automatically called regularly for you.
41774  *
41775  * This method will also cause us to stop tracking removed nodes and channels if they have been
41776  * in the map for a while so that these can be resynced from gossip in the future.
41777  *
41778  * This method is only available with the `std` feature. See
41779  * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
41780  */
41781 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41782
41783 /**
41784  * Removes information about channels that we haven't heard any updates about in some time.
41785  * This can be used regularly to prune the network graph of channels that likely no longer
41786  * exist.
41787  *
41788  * While there is no formal requirement that nodes regularly re-broadcast their channel
41789  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
41790  * pruning occur for updates which are at least two weeks old, which we implement here.
41791  *
41792  * This method will also cause us to stop tracking removed nodes and channels if they have been
41793  * in the map for a while so that these can be resynced from gossip in the future.
41794  *
41795  * This function takes the current unix time as an argument. For users with the `std` feature
41796  * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
41797  */
41798 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
41799
41800 /**
41801  * For an already known (from announcement) channel, update info about one of the directions
41802  * of the channel.
41803  *
41804  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41805  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41806  * routing messages from a source using a protocol other than the lightning P2P protocol.
41807  *
41808  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41809  * materially in the future will be rejected.
41810  */
41811 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
41812
41813 /**
41814  * For an already known (from announcement) channel, update info about one of the directions
41815  * of the channel without verifying the associated signatures. Because we aren't given the
41816  * associated signatures here we cannot relay the channel update to any of our peers.
41817  *
41818  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41819  * materially in the future will be rejected.
41820  */
41821 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
41822
41823 /**
41824  * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
41825  *
41826  * This checks whether the update currently is applicable by [`Self::update_channel`].
41827  *
41828  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41829  * materially in the future will be rejected.
41830  */
41831 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
41832
41833 /**
41834  * Returns information on a channel with the given id.
41835  *
41836  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41837  */
41838 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
41839
41840 /**
41841  * Returns the list of channels in the graph
41842  */
41843 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
41844
41845 /**
41846  * Returns information on a node with the given id.
41847  *
41848  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41849  */
41850 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
41851
41852 /**
41853  * Returns the list of nodes in the graph
41854  */
41855 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
41856
41857 /**
41858  * Get network addresses by node id.
41859  * Returns None if the requested node is completely unknown,
41860  * or if node announcement for the node was never received.
41861  */
41862 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
41863
41864 /**
41865  * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
41866  */
41867 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
41868
41869 /**
41870  * Creates a new router.
41871  */
41872 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
41873
41874 /**
41875  * Constructs a new Router which calls the relevant methods on this_arg.
41876  * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
41877  */
41878 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
41879
41880 /**
41881  * Calls the free function if one is set
41882  */
41883 void Router_free(struct LDKRouter this_ptr);
41884
41885 /**
41886  * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
41887  */
41888 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
41889
41890 /**
41891  * Initialize a new `ScorerAccountingForInFlightHtlcs`.
41892  */
41893 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
41894
41895 /**
41896  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
41897  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
41898  */
41899 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
41900
41901 /**
41902  * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
41903  */
41904 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
41905
41906 /**
41907  * Creates a copy of the InFlightHtlcs
41908  */
41909 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
41910
41911 /**
41912  * Constructs an empty `InFlightHtlcs`.
41913  */
41914 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
41915
41916 /**
41917  * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
41918  */
41919 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
41920
41921 /**
41922  * Adds a known HTLC given the public key of the HTLC source, target, and short channel
41923  * id.
41924  */
41925 void InFlightHtlcs_add_inflight_htlc(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid, uint64_t used_msat);
41926
41927 /**
41928  * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
41929  * id.
41930  */
41931 MUST_USE_RES struct LDKCOption_u64Z InFlightHtlcs_used_liquidity_msat(const struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid);
41932
41933 /**
41934  * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
41935  */
41936 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
41937
41938 /**
41939  * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
41940  */
41941 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
41942
41943 /**
41944  * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
41945  */
41946 void RouteHop_free(struct LDKRouteHop this_obj);
41947
41948 /**
41949  * The node_id of the node at this hop.
41950  */
41951 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41952
41953 /**
41954  * The node_id of the node at this hop.
41955  */
41956 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41957
41958 /**
41959  * The node_announcement features of the node at this hop. For the last hop, these may be
41960  * amended to match the features present in the invoice this node generated.
41961  */
41962 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41963
41964 /**
41965  * The node_announcement features of the node at this hop. For the last hop, these may be
41966  * amended to match the features present in the invoice this node generated.
41967  */
41968 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41969
41970 /**
41971  * The channel that should be used from the previous hop to reach this node.
41972  */
41973 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41974
41975 /**
41976  * The channel that should be used from the previous hop to reach this node.
41977  */
41978 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
41979
41980 /**
41981  * The channel_announcement features of the channel that should be used from the previous hop
41982  * to reach this node.
41983  */
41984 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41985
41986 /**
41987  * The channel_announcement features of the channel that should be used from the previous hop
41988  * to reach this node.
41989  */
41990 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41991
41992 /**
41993  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
41994  * If this is the last hop in [`Path::hops`]:
41995  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
41996  * * otherwise, this is the full value of this [`Path`]'s part of the payment
41997  *
41998  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41999  */
42000 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
42001
42002 /**
42003  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
42004  * If this is the last hop in [`Path::hops`]:
42005  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
42006  * * otherwise, this is the full value of this [`Path`]'s part of the payment
42007  *
42008  * [`BlindedPath`]: crate::blinded_path::BlindedPath
42009  */
42010 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
42011
42012 /**
42013  * The CLTV delta added for this hop.
42014  * If this is the last hop in [`Path::hops`]:
42015  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
42016  * * otherwise, this is the CLTV delta expected at the destination
42017  *
42018  * [`BlindedPath`]: crate::blinded_path::BlindedPath
42019  */
42020 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
42021
42022 /**
42023  * The CLTV delta added for this hop.
42024  * If this is the last hop in [`Path::hops`]:
42025  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
42026  * * otherwise, this is the CLTV delta expected at the destination
42027  *
42028  * [`BlindedPath`]: crate::blinded_path::BlindedPath
42029  */
42030 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
42031
42032 /**
42033  * Indicates whether this hop is possibly announced in the public network graph.
42034  *
42035  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
42036  * either know for sure it's announced in the public graph, or if any public channels exist
42037  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
42038  * the channel to be unannounced.
42039  *
42040  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
42041  */
42042 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
42043
42044 /**
42045  * Indicates whether this hop is possibly announced in the public network graph.
42046  *
42047  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
42048  * either know for sure it's announced in the public graph, or if any public channels exist
42049  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
42050  * the channel to be unannounced.
42051  *
42052  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
42053  */
42054 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
42055
42056 /**
42057  * Constructs a new RouteHop given each field
42058  */
42059 MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg, bool maybe_announced_channel_arg);
42060
42061 /**
42062  * Creates a copy of the RouteHop
42063  */
42064 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
42065
42066 /**
42067  * Generates a non-cryptographic 64-bit hash of the RouteHop.
42068  */
42069 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
42070
42071 /**
42072  * Checks if two RouteHops contain equal inner contents.
42073  * This ignores pointers and is_owned flags and looks at the values in fields.
42074  * Two objects with NULL inner values will be considered "equal" here.
42075  */
42076 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
42077
42078 /**
42079  * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
42080  */
42081 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
42082
42083 /**
42084  * Read a RouteHop from a byte array, created by RouteHop_write
42085  */
42086 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
42087
42088 /**
42089  * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
42090  */
42091 void BlindedTail_free(struct LDKBlindedTail this_obj);
42092
42093 /**
42094  * The hops of the [`BlindedPath`] provided by the recipient.
42095  *
42096  * [`BlindedPath`]: crate::blinded_path::BlindedPath
42097  */
42098 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
42099
42100 /**
42101  * The hops of the [`BlindedPath`] provided by the recipient.
42102  *
42103  * [`BlindedPath`]: crate::blinded_path::BlindedPath
42104  */
42105 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
42106
42107 /**
42108  * The blinding point of the [`BlindedPath`] provided by the recipient.
42109  *
42110  * [`BlindedPath`]: crate::blinded_path::BlindedPath
42111  */
42112 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
42113
42114 /**
42115  * The blinding point of the [`BlindedPath`] provided by the recipient.
42116  *
42117  * [`BlindedPath`]: crate::blinded_path::BlindedPath
42118  */
42119 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42120
42121 /**
42122  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
42123  * inferring the destination. May be 0.
42124  */
42125 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
42126
42127 /**
42128  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
42129  * inferring the destination. May be 0.
42130  */
42131 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
42132
42133 /**
42134  * The total amount paid on this [`Path`], excluding the fees.
42135  */
42136 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
42137
42138 /**
42139  * The total amount paid on this [`Path`], excluding the fees.
42140  */
42141 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
42142
42143 /**
42144  * Constructs a new BlindedTail given each field
42145  */
42146 MUST_USE_RES struct LDKBlindedTail BlindedTail_new(struct LDKCVec_BlindedHopZ hops_arg, struct LDKPublicKey blinding_point_arg, uint32_t excess_final_cltv_expiry_delta_arg, uint64_t final_value_msat_arg);
42147
42148 /**
42149  * Creates a copy of the BlindedTail
42150  */
42151 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
42152
42153 /**
42154  * Generates a non-cryptographic 64-bit hash of the BlindedTail.
42155  */
42156 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
42157
42158 /**
42159  * Checks if two BlindedTails contain equal inner contents.
42160  * This ignores pointers and is_owned flags and looks at the values in fields.
42161  * Two objects with NULL inner values will be considered "equal" here.
42162  */
42163 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
42164
42165 /**
42166  * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
42167  */
42168 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
42169
42170 /**
42171  * Read a BlindedTail from a byte array, created by BlindedTail_write
42172  */
42173 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
42174
42175 /**
42176  * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
42177  */
42178 void Path_free(struct LDKPath this_obj);
42179
42180 /**
42181  * The list of unblinded hops in this [`Path`]. Must be at least length one.
42182  */
42183 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
42184
42185 /**
42186  * The list of unblinded hops in this [`Path`]. Must be at least length one.
42187  */
42188 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
42189
42190 /**
42191  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
42192  *
42193  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42194  */
42195 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
42196
42197 /**
42198  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
42199  *
42200  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
42201  */
42202 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
42203
42204 /**
42205  * Constructs a new Path given each field
42206  *
42207  * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
42208  */
42209 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
42210
42211 /**
42212  * Creates a copy of the Path
42213  */
42214 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
42215
42216 /**
42217  * Generates a non-cryptographic 64-bit hash of the Path.
42218  */
42219 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
42220
42221 /**
42222  * Checks if two Paths contain equal inner contents.
42223  * This ignores pointers and is_owned flags and looks at the values in fields.
42224  * Two objects with NULL inner values will be considered "equal" here.
42225  */
42226 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
42227
42228 /**
42229  * Gets the fees for a given path, excluding any excess paid to the recipient.
42230  */
42231 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
42232
42233 /**
42234  * Gets the total amount paid on this [`Path`], excluding the fees.
42235  */
42236 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
42237
42238 /**
42239  * Gets the final hop's CLTV expiry delta.
42240  */
42241 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
42242
42243 /**
42244  * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
42245  */
42246 void Route_free(struct LDKRoute this_obj);
42247
42248 /**
42249  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
42250  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
42251  * the same.
42252  */
42253 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
42254
42255 /**
42256  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
42257  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
42258  * the same.
42259  */
42260 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
42261
42262 /**
42263  * The `route_params` parameter passed to [`find_route`].
42264  *
42265  * This is used by `ChannelManager` to track information which may be required for retries.
42266  *
42267  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
42268  *
42269  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42270  */
42271 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
42272
42273 /**
42274  * The `route_params` parameter passed to [`find_route`].
42275  *
42276  * This is used by `ChannelManager` to track information which may be required for retries.
42277  *
42278  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
42279  *
42280  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
42281  */
42282 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
42283
42284 /**
42285  * Constructs a new Route given each field
42286  *
42287  * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
42288  */
42289 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
42290
42291 /**
42292  * Creates a copy of the Route
42293  */
42294 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
42295
42296 /**
42297  * Generates a non-cryptographic 64-bit hash of the Route.
42298  */
42299 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
42300
42301 /**
42302  * Checks if two Routes contain equal inner contents.
42303  * This ignores pointers and is_owned flags and looks at the values in fields.
42304  * Two objects with NULL inner values will be considered "equal" here.
42305  */
42306 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
42307
42308 /**
42309  * Returns the total amount of fees paid on this [`Route`].
42310  *
42311  * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
42312  * the recipient, which can happen in excess of the amount passed to [`find_route`] via
42313  * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
42314  *
42315  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
42316  */
42317 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
42318
42319 /**
42320  * Returns the total amount paid on this [`Route`], excluding the fees.
42321  *
42322  * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
42323  * we had to reach the [`htlc_minimum_msat`] limits.
42324  *
42325  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
42326  */
42327 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
42328
42329 /**
42330  * Serialize the Route object into a byte array which can be read by Route_read
42331  */
42332 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
42333
42334 /**
42335  * Read a Route from a byte array, created by Route_write
42336  */
42337 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
42338
42339 /**
42340  * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
42341  */
42342 void RouteParameters_free(struct LDKRouteParameters this_obj);
42343
42344 /**
42345  * The parameters of the failed payment path.
42346  */
42347 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
42348
42349 /**
42350  * The parameters of the failed payment path.
42351  */
42352 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
42353
42354 /**
42355  * The amount in msats sent on the failed payment path.
42356  */
42357 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
42358
42359 /**
42360  * The amount in msats sent on the failed payment path.
42361  */
42362 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
42363
42364 /**
42365  * The maximum total fees, in millisatoshi, that may accrue during route finding.
42366  *
42367  * This limit also applies to the total fees that may arise while retrying failed payment
42368  * paths.
42369  *
42370  * Note that values below a few sats may result in some paths being spuriously ignored.
42371  */
42372 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
42373
42374 /**
42375  * The maximum total fees, in millisatoshi, that may accrue during route finding.
42376  *
42377  * This limit also applies to the total fees that may arise while retrying failed payment
42378  * paths.
42379  *
42380  * Note that values below a few sats may result in some paths being spuriously ignored.
42381  */
42382 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42383
42384 /**
42385  * Constructs a new RouteParameters given each field
42386  */
42387 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg, struct LDKCOption_u64Z max_total_routing_fee_msat_arg);
42388
42389 /**
42390  * Creates a copy of the RouteParameters
42391  */
42392 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
42393
42394 /**
42395  * Generates a non-cryptographic 64-bit hash of the RouteParameters.
42396  */
42397 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
42398
42399 /**
42400  * Checks if two RouteParameterss contain equal inner contents.
42401  * This ignores pointers and is_owned flags and looks at the values in fields.
42402  * Two objects with NULL inner values will be considered "equal" here.
42403  */
42404 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
42405
42406 /**
42407  * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
42408  *
42409  * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
42410  */
42411 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
42412
42413 /**
42414  * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
42415  */
42416 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
42417
42418 /**
42419  * Read a RouteParameters from a byte array, created by RouteParameters_write
42420  */
42421 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
42422
42423 /**
42424  * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
42425  */
42426 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
42427
42428 /**
42429  * Information about the payee, such as their features and route hints for their channels.
42430  */
42431 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42432
42433 /**
42434  * Information about the payee, such as their features and route hints for their channels.
42435  */
42436 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
42437
42438 /**
42439  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
42440  */
42441 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42442
42443 /**
42444  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
42445  */
42446 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42447
42448 /**
42449  * The maximum total CLTV delta we accept for the route.
42450  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
42451  */
42452 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42453
42454 /**
42455  * The maximum total CLTV delta we accept for the route.
42456  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
42457  */
42458 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
42459
42460 /**
42461  * The maximum number of paths that may be used by (MPP) payments.
42462  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
42463  */
42464 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42465
42466 /**
42467  * The maximum number of paths that may be used by (MPP) payments.
42468  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
42469  */
42470 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
42471
42472 /**
42473  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
42474  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
42475  * a lower value prefers to send larger MPP parts, potentially saturating channels and
42476  * increasing failure probability for those paths.
42477  *
42478  * Note that this restriction will be relaxed during pathfinding after paths which meet this
42479  * restriction have been found. While paths which meet this criteria will be searched for, it
42480  * is ultimately up to the scorer to select them over other paths.
42481  *
42482  * A value of 0 will allow payments up to and including a channel's total announced usable
42483  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
42484  *
42485  * Default value: 2
42486  */
42487 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42488
42489 /**
42490  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
42491  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
42492  * a lower value prefers to send larger MPP parts, potentially saturating channels and
42493  * increasing failure probability for those paths.
42494  *
42495  * Note that this restriction will be relaxed during pathfinding after paths which meet this
42496  * restriction have been found. While paths which meet this criteria will be searched for, it
42497  * is ultimately up to the scorer to select them over other paths.
42498  *
42499  * A value of 0 will allow payments up to and including a channel's total announced usable
42500  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
42501  *
42502  * Default value: 2
42503  */
42504 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
42505
42506 /**
42507  * A list of SCIDs which this payment was previously attempted over and which caused the
42508  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
42509  * these SCIDs.
42510  *
42511  * Returns a copy of the field.
42512  */
42513 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42514
42515 /**
42516  * A list of SCIDs which this payment was previously attempted over and which caused the
42517  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
42518  * these SCIDs.
42519  */
42520 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
42521
42522 /**
42523  * Constructs a new PaymentParameters given each field
42524  */
42525 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg);
42526
42527 /**
42528  * Creates a copy of the PaymentParameters
42529  */
42530 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
42531
42532 /**
42533  * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
42534  */
42535 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
42536
42537 /**
42538  * Checks if two PaymentParameterss contain equal inner contents.
42539  * This ignores pointers and is_owned flags and looks at the values in fields.
42540  * Two objects with NULL inner values will be considered "equal" here.
42541  */
42542 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
42543
42544 /**
42545  * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
42546  */
42547 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
42548
42549 /**
42550  * Read a PaymentParameters from a byte array, created by PaymentParameters_write
42551  */
42552 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
42553
42554 /**
42555  * Creates a payee with the node id of the given `pubkey`.
42556  *
42557  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
42558  * provided.
42559  */
42560 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
42561
42562 /**
42563  * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
42564  *
42565  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
42566  * provided.
42567  *
42568  * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
42569  * whether your router will be allowed to find a multi-part route for this payment. If you
42570  * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
42571  * [`RecipientOnionFields::secret_only`].
42572  *
42573  * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
42574  */
42575 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
42576
42577 /**
42578  * Creates parameters for paying to a blinded payee from the provided invoice. Sets
42579  * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
42580  * [`PaymentParameters::expiry_time`].
42581  */
42582 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
42583
42584 /**
42585  * Creates parameters for paying to a blinded payee from the provided blinded route hints.
42586  */
42587 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
42588
42589 /**
42590  * Frees any resources used by the Payee
42591  */
42592 void Payee_free(struct LDKPayee this_ptr);
42593
42594 /**
42595  * Creates a copy of the Payee
42596  */
42597 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
42598
42599 /**
42600  * Utility method to constructs a new Blinded-variant Payee
42601  */
42602 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
42603
42604 /**
42605  * Utility method to constructs a new Clear-variant Payee
42606  */
42607 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
42608
42609 /**
42610  * Generates a non-cryptographic 64-bit hash of the Payee.
42611  */
42612 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
42613
42614 /**
42615  * Checks if two Payees contain equal inner contents.
42616  * This ignores pointers and is_owned flags and looks at the values in fields.
42617  */
42618 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
42619
42620 /**
42621  * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
42622  */
42623 void RouteHint_free(struct LDKRouteHint this_obj);
42624
42625 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
42626
42627 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
42628
42629 /**
42630  * Constructs a new RouteHint given each field
42631  */
42632 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
42633
42634 /**
42635  * Creates a copy of the RouteHint
42636  */
42637 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
42638
42639 /**
42640  * Generates a non-cryptographic 64-bit hash of the RouteHint.
42641  */
42642 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
42643
42644 /**
42645  * Checks if two RouteHints contain equal inner contents.
42646  * This ignores pointers and is_owned flags and looks at the values in fields.
42647  * Two objects with NULL inner values will be considered "equal" here.
42648  */
42649 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
42650
42651 /**
42652  * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
42653  */
42654 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
42655
42656 /**
42657  * Read a RouteHint from a byte array, created by RouteHint_write
42658  */
42659 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
42660
42661 /**
42662  * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
42663  */
42664 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
42665
42666 /**
42667  * The node_id of the non-target end of the route
42668  */
42669 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42670
42671 /**
42672  * The node_id of the non-target end of the route
42673  */
42674 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42675
42676 /**
42677  * The short_channel_id of this channel
42678  */
42679 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42680
42681 /**
42682  * The short_channel_id of this channel
42683  */
42684 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
42685
42686 /**
42687  * The fees which must be paid to use this channel
42688  */
42689 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42690
42691 /**
42692  * The fees which must be paid to use this channel
42693  */
42694 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
42695
42696 /**
42697  * The difference in CLTV values between this node and the next node.
42698  */
42699 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42700
42701 /**
42702  * The difference in CLTV values between this node and the next node.
42703  */
42704 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
42705
42706 /**
42707  * The minimum value, in msat, which must be relayed to the next hop.
42708  */
42709 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42710
42711 /**
42712  * The minimum value, in msat, which must be relayed to the next hop.
42713  */
42714 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42715
42716 /**
42717  * The maximum value in msat available for routing with a single HTLC.
42718  */
42719 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42720
42721 /**
42722  * The maximum value in msat available for routing with a single HTLC.
42723  */
42724 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42725
42726 /**
42727  * Constructs a new RouteHintHop given each field
42728  */
42729 MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg);
42730
42731 /**
42732  * Creates a copy of the RouteHintHop
42733  */
42734 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
42735
42736 /**
42737  * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
42738  */
42739 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
42740
42741 /**
42742  * Checks if two RouteHintHops contain equal inner contents.
42743  * This ignores pointers and is_owned flags and looks at the values in fields.
42744  * Two objects with NULL inner values will be considered "equal" here.
42745  */
42746 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
42747
42748 /**
42749  * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
42750  */
42751 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
42752
42753 /**
42754  * Read a RouteHintHop from a byte array, created by RouteHintHop_write
42755  */
42756 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
42757
42758 /**
42759  * Finds a route from us (payer) to the given target node (payee).
42760  *
42761  * If the payee provided features in their invoice, they should be provided via the `payee` field
42762  * in the given [`RouteParameters::payment_params`].
42763  * Without this, MPP will only be used if the payee's features are available in the network graph.
42764  *
42765  * Private routing paths between a public node and the target may be included in the `payee` field
42766  * of [`RouteParameters::payment_params`].
42767  *
42768  * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
42769  * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
42770  * from `network_graph` will be ignored, and only those in `first_hops` will be used.
42771  *
42772  * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
42773  * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
42774  * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
42775  *
42776  * # Panics
42777  *
42778  * Panics if first_hops contains channels without `short_channel_id`s;
42779  * [`ChannelManager::list_usable_channels`] will never include such channels.
42780  *
42781  * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
42782  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
42783  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
42784  *
42785  * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
42786  */
42787 struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScoreLookUp *NONNULL_PTR scorer, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params, const uint8_t (*random_seed_bytes)[32]);
42788
42789 /**
42790  * Construct a route from us (payer) to the target node (payee) via the given hops (which should
42791  * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
42792  *
42793  * Re-uses logic from `find_route`, so the restrictions described there also apply here.
42794  */
42795 struct LDKCResult_RouteLightningErrorZ build_route_from_hops(struct LDKPublicKey our_node_pubkey, struct LDKCVec_PublicKeyZ hops, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]);
42796
42797 /**
42798  * Calls the free function if one is set
42799  */
42800 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
42801
42802 /**
42803  * Calls the free function if one is set
42804  */
42805 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
42806
42807 /**
42808  * Calls the free function if one is set
42809  */
42810 void Score_free(struct LDKScore this_ptr);
42811
42812 /**
42813  * Calls the free function if one is set
42814  */
42815 void LockableScore_free(struct LDKLockableScore this_ptr);
42816
42817 /**
42818  * Calls the free function if one is set
42819  */
42820 void WriteableScore_free(struct LDKWriteableScore this_ptr);
42821
42822 /**
42823  * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
42824  */
42825 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
42826
42827 /**
42828  * Constructs a new LockableScore which calls the relevant methods on this_arg.
42829  * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
42830  */
42831 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
42832
42833 /**
42834  * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
42835  */
42836 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
42837
42838 /**
42839  * Constructs a new WriteableScore which calls the relevant methods on this_arg.
42840  * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
42841  */
42842 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
42843
42844 /**
42845  * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
42846  */
42847 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
42848
42849 /**
42850  * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
42851  */
42852 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
42853
42854 /**
42855  * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
42856  */
42857 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
42858
42859 /**
42860  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42861  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42862  */
42863 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
42864
42865 /**
42866  * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
42867  */
42868 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
42869
42870 /**
42871  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42872  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42873  */
42874 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
42875
42876 /**
42877  * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
42878  */
42879 void ChannelUsage_free(struct LDKChannelUsage this_obj);
42880
42881 /**
42882  * The amount to send through the channel, denominated in millisatoshis.
42883  */
42884 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42885
42886 /**
42887  * The amount to send through the channel, denominated in millisatoshis.
42888  */
42889 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
42890
42891 /**
42892  * Total amount, denominated in millisatoshis, already allocated to send through the channel
42893  * as part of a multi-path payment.
42894  */
42895 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42896
42897 /**
42898  * Total amount, denominated in millisatoshis, already allocated to send through the channel
42899  * as part of a multi-path payment.
42900  */
42901 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
42902
42903 /**
42904  * The effective capacity of the channel.
42905  */
42906 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42907
42908 /**
42909  * The effective capacity of the channel.
42910  */
42911 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
42912
42913 /**
42914  * Constructs a new ChannelUsage given each field
42915  */
42916 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
42917
42918 /**
42919  * Creates a copy of the ChannelUsage
42920  */
42921 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
42922
42923 /**
42924  * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
42925  */
42926 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
42927
42928 /**
42929  * Creates a copy of the FixedPenaltyScorer
42930  */
42931 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
42932
42933 /**
42934  * Creates a new scorer using `penalty_msat`.
42935  */
42936 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
42937
42938 /**
42939  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42940  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42941  */
42942 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
42943
42944 /**
42945  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42946  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42947  */
42948 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
42949
42950 /**
42951  * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
42952  */
42953 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
42954
42955 /**
42956  * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
42957  */
42958 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
42959
42960 /**
42961  * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
42962  */
42963 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
42964
42965 /**
42966  * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
42967  */
42968 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
42969
42970 /**
42971  * A fixed penalty in msats to apply to each channel.
42972  *
42973  * Default value: 500 msat
42974  */
42975 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42976
42977 /**
42978  * A fixed penalty in msats to apply to each channel.
42979  *
42980  * Default value: 500 msat
42981  */
42982 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42983
42984 /**
42985  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
42986  * applied to each channel, in excess of the [`base_penalty_msat`].
42987  *
42988  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42989  * fees plus penalty) for large payments. The penalty is computed as the product of this
42990  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
42991  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
42992  *
42993  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
42994  *
42995  * Default value: 8,192 msat
42996  *
42997  * [`base_penalty_msat`]: Self::base_penalty_msat
42998  */
42999 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43000
43001 /**
43002  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
43003  * applied to each channel, in excess of the [`base_penalty_msat`].
43004  *
43005  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
43006  * fees plus penalty) for large payments. The penalty is computed as the product of this
43007  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
43008  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
43009  *
43010  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
43011  *
43012  * Default value: 8,192 msat
43013  *
43014  * [`base_penalty_msat`]: Self::base_penalty_msat
43015  */
43016 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43017
43018 /**
43019  * A multiplier used in conjunction with the negative `log10` of the channel's success
43020  * probability for a payment, as determined by our latest estimates of the channel's
43021  * liquidity, to determine the liquidity penalty.
43022  *
43023  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
43024  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
43025  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
43026  * lower bounding the success probability to `0.01`) when the amount falls within the
43027  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
43028  * result in a `u64::max_value` penalty, however.
43029  *
43030  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
43031  *
43032  * Default value: 30,000 msat
43033  *
43034  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
43035  */
43036 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43037
43038 /**
43039  * A multiplier used in conjunction with the negative `log10` of the channel's success
43040  * probability for a payment, as determined by our latest estimates of the channel's
43041  * liquidity, to determine the liquidity penalty.
43042  *
43043  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
43044  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
43045  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
43046  * lower bounding the success probability to `0.01`) when the amount falls within the
43047  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
43048  * result in a `u64::max_value` penalty, however.
43049  *
43050  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
43051  *
43052  * Default value: 30,000 msat
43053  *
43054  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
43055  */
43056 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43057
43058 /**
43059  * A multiplier used in conjunction with the total amount flowing over a channel and the
43060  * negative `log10` of the channel's success probability for the payment, as determined by our
43061  * latest estimates of the channel's liquidity, to determine the amount penalty.
43062  *
43063  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
43064  * fees plus penalty) for large payments. The penalty is computed as the product of this
43065  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
43066  * `log10` of the success probability.
43067  *
43068  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
43069  *
43070  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
43071  * the amount will result in a penalty of the multiplier. And, as the success probability
43072  * decreases, the negative `log10` weighting will increase dramatically. For higher success
43073  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
43074  * fall below `1`.
43075  *
43076  * Default value: 192 msat
43077  */
43078 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43079
43080 /**
43081  * A multiplier used in conjunction with the total amount flowing over a channel and the
43082  * negative `log10` of the channel's success probability for the payment, as determined by our
43083  * latest estimates of the channel's liquidity, to determine the amount penalty.
43084  *
43085  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
43086  * fees plus penalty) for large payments. The penalty is computed as the product of this
43087  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
43088  * `log10` of the success probability.
43089  *
43090  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
43091  *
43092  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
43093  * the amount will result in a penalty of the multiplier. And, as the success probability
43094  * decreases, the negative `log10` weighting will increase dramatically. For higher success
43095  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
43096  * fall below `1`.
43097  *
43098  * Default value: 192 msat
43099  */
43100 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43101
43102 /**
43103  * A multiplier used in conjunction with the negative `log10` of the channel's success
43104  * probability for the payment, as determined based on the history of our estimates of the
43105  * channel's available liquidity, to determine a penalty.
43106  *
43107  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
43108  * only our latest estimate for the current liquidity available in the channel, it estimates
43109  * success probability based on the estimated liquidity available in the channel through
43110  * history. Specifically, every time we update our liquidity bounds on a given channel, we
43111  * track which of several buckets those bounds fall into, exponentially decaying the
43112  * probability of each bucket as new samples are added.
43113  *
43114  * Default value: 10,000 msat
43115  *
43116  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
43117  */
43118 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43119
43120 /**
43121  * A multiplier used in conjunction with the negative `log10` of the channel's success
43122  * probability for the payment, as determined based on the history of our estimates of the
43123  * channel's available liquidity, to determine a penalty.
43124  *
43125  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
43126  * only our latest estimate for the current liquidity available in the channel, it estimates
43127  * success probability based on the estimated liquidity available in the channel through
43128  * history. Specifically, every time we update our liquidity bounds on a given channel, we
43129  * track which of several buckets those bounds fall into, exponentially decaying the
43130  * probability of each bucket as new samples are added.
43131  *
43132  * Default value: 10,000 msat
43133  *
43134  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
43135  */
43136 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43137
43138 /**
43139  * A multiplier used in conjunction with the total amount flowing over a channel and the
43140  * negative `log10` of the channel's success probability for the payment, as determined based
43141  * on the history of our estimates of the channel's available liquidity, to determine a
43142  * penalty.
43143  *
43144  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
43145  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
43146  * of the amount flowing over this channel, weighted by the negative `log10` of the success
43147  * probability.
43148  *
43149  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
43150  * of using only our latest estimate for the current liquidity available in the channel, it
43151  * estimates success probability based on the estimated liquidity available in the channel
43152  * through history. Specifically, every time we update our liquidity bounds on a given
43153  * channel, we track which of several buckets those bounds fall into, exponentially decaying
43154  * the probability of each bucket as new samples are added.
43155  *
43156  * Default value: 64 msat
43157  *
43158  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
43159  */
43160 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43161
43162 /**
43163  * A multiplier used in conjunction with the total amount flowing over a channel and the
43164  * negative `log10` of the channel's success probability for the payment, as determined based
43165  * on the history of our estimates of the channel's available liquidity, to determine a
43166  * penalty.
43167  *
43168  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
43169  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
43170  * of the amount flowing over this channel, weighted by the negative `log10` of the success
43171  * probability.
43172  *
43173  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
43174  * of using only our latest estimate for the current liquidity available in the channel, it
43175  * estimates success probability based on the estimated liquidity available in the channel
43176  * through history. Specifically, every time we update our liquidity bounds on a given
43177  * channel, we track which of several buckets those bounds fall into, exponentially decaying
43178  * the probability of each bucket as new samples are added.
43179  *
43180  * Default value: 64 msat
43181  *
43182  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
43183  */
43184 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43185
43186 /**
43187  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
43188  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
43189  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
43190  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
43191  * to restrict `htlc_maximum_msat` and improve privacy.
43192  *
43193  * Default value: 250 msat
43194  */
43195 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43196
43197 /**
43198  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
43199  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
43200  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
43201  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
43202  * to restrict `htlc_maximum_msat` and improve privacy.
43203  *
43204  * Default value: 250 msat
43205  */
43206 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43207
43208 /**
43209  * This penalty is applied when the total amount flowing over a channel exceeds our current
43210  * estimate of the channel's available liquidity. The total amount is the amount of the
43211  * current HTLC plus any HTLCs which we've sent over the same channel.
43212  *
43213  * Note that in this case all other penalties, including the
43214  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
43215  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
43216  * applicable, are still included in the overall penalty.
43217  *
43218  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
43219  * `u64::max_value()` will guarantee that.
43220  *
43221  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
43222  *
43223  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
43224  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
43225  * [`base_penalty_msat`]: Self::base_penalty_msat
43226  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
43227  */
43228 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43229
43230 /**
43231  * This penalty is applied when the total amount flowing over a channel exceeds our current
43232  * estimate of the channel's available liquidity. The total amount is the amount of the
43233  * current HTLC plus any HTLCs which we've sent over the same channel.
43234  *
43235  * Note that in this case all other penalties, including the
43236  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
43237  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
43238  * applicable, are still included in the overall penalty.
43239  *
43240  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
43241  * `u64::max_value()` will guarantee that.
43242  *
43243  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
43244  *
43245  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
43246  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
43247  * [`base_penalty_msat`]: Self::base_penalty_msat
43248  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
43249  */
43250 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43251
43252 /**
43253  * In order to calculate most of the scores above, we must first convert a lower and upper
43254  * bound on the available liquidity in a channel into the probability that we think a payment
43255  * will succeed. That probability is derived from a Probability Density Function for where we
43256  * think the liquidity in a channel likely lies, given such bounds.
43257  *
43258  * If this flag is set, that PDF is simply a constant - we assume that the actual available
43259  * liquidity in a channel is just as likely to be at any point between our lower and upper
43260  * bounds.
43261  *
43262  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
43263  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
43264  * matches experimental results - most routing nodes do not aggressively rebalance their
43265  * channels and flows in the network are often unbalanced, leaving liquidity usually
43266  * unavailable.
43267  *
43268  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
43269  * of floating-point multiplications in the hottest routing code, which may lead to routing
43270  * performance degradation on some machines.
43271  *
43272  * Default value: false
43273  */
43274 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43275
43276 /**
43277  * In order to calculate most of the scores above, we must first convert a lower and upper
43278  * bound on the available liquidity in a channel into the probability that we think a payment
43279  * will succeed. That probability is derived from a Probability Density Function for where we
43280  * think the liquidity in a channel likely lies, given such bounds.
43281  *
43282  * If this flag is set, that PDF is simply a constant - we assume that the actual available
43283  * liquidity in a channel is just as likely to be at any point between our lower and upper
43284  * bounds.
43285  *
43286  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
43287  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
43288  * matches experimental results - most routing nodes do not aggressively rebalance their
43289  * channels and flows in the network are often unbalanced, leaving liquidity usually
43290  * unavailable.
43291  *
43292  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
43293  * of floating-point multiplications in the hottest routing code, which may lead to routing
43294  * performance degradation on some machines.
43295  *
43296  * Default value: false
43297  */
43298 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
43299
43300 /**
43301  * Creates a copy of the ProbabilisticScoringFeeParameters
43302  */
43303 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
43304
43305 /**
43306  * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
43307  */
43308 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
43309
43310 /**
43311  * Marks the node with the given `node_id` as banned,
43312  * i.e it will be avoided during path finding.
43313  */
43314 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
43315
43316 /**
43317  * Marks all nodes in the given list as banned, i.e.,
43318  * they will be avoided during path finding.
43319  */
43320 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
43321
43322 /**
43323  * Removes the node with the given `node_id` from the list of nodes to avoid.
43324  */
43325 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
43326
43327 /**
43328  * Sets a manual penalty for the given node.
43329  */
43330 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
43331
43332 /**
43333  * Removes the node with the given `node_id` from the list of manual penalties.
43334  */
43335 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
43336
43337 /**
43338  * Clears the list of manual penalties that are applied during path finding.
43339  */
43340 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
43341
43342 /**
43343  * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
43344  */
43345 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
43346
43347 /**
43348  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
43349  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
43350  * seen a liquidity estimate update for this amount of time, the historical datapoints are
43351  * decayed by half.
43352  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
43353  *
43354  * Note that after 16 or more half lives all historical data will be completely gone.
43355  *
43356  * Default value: 14 days
43357  *
43358  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
43359  */
43360 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
43361
43362 /**
43363  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
43364  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
43365  * seen a liquidity estimate update for this amount of time, the historical datapoints are
43366  * decayed by half.
43367  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
43368  *
43369  * Note that after 16 or more half lives all historical data will be completely gone.
43370  *
43371  * Default value: 14 days
43372  *
43373  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
43374  */
43375 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
43376
43377 /**
43378  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
43379  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
43380  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
43381  * capacity.
43382  *
43383  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
43384  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
43385  * struct documentation for more info on the way the liquidity bounds are used.
43386  *
43387  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
43388  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
43389  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
43390  *
43391  * Default value: 6 hours
43392  *
43393  * # Note
43394  *
43395  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
43396  * liquidity knowledge will never decay except when the bounds cross.
43397  */
43398 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
43399
43400 /**
43401  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
43402  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
43403  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
43404  * capacity.
43405  *
43406  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
43407  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
43408  * struct documentation for more info on the way the liquidity bounds are used.
43409  *
43410  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
43411  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
43412  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
43413  *
43414  * Default value: 6 hours
43415  *
43416  * # Note
43417  *
43418  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
43419  * liquidity knowledge will never decay except when the bounds cross.
43420  */
43421 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
43422
43423 /**
43424  * Constructs a new ProbabilisticScoringDecayParameters given each field
43425  */
43426 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
43427
43428 /**
43429  * Creates a copy of the ProbabilisticScoringDecayParameters
43430  */
43431 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
43432
43433 /**
43434  * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
43435  */
43436 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
43437
43438 /**
43439  * Creates a new scorer using the given scoring parameters for sending payments from a node
43440  * through a network graph.
43441  */
43442 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
43443
43444 /**
43445  * Dump the contents of this scorer into the configured logger.
43446  *
43447  * Note that this writes roughly one line per channel for which we have a liquidity estimate,
43448  * which may be a substantial amount of log output.
43449  */
43450 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
43451
43452 /**
43453  * Query the estimated minimum and maximum liquidity available for sending a payment over the
43454  * channel with `scid` towards the given `target` node.
43455  */
43456 MUST_USE_RES struct LDKCOption_C2Tuple_u64u64ZZ ProbabilisticScorer_estimated_channel_liquidity_range(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
43457
43458 /**
43459  * Query the historical estimated minimum and maximum liquidity available for sending a
43460  * payment over the channel with `scid` towards the given `target` node.
43461  *
43462  * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
43463  * the second set describes the upper-bound liquidity history. Each bucket describes the
43464  * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
43465  * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
43466  * more recent data points are weighted more heavily than older datapoints.
43467  *
43468  * Note that the range of each bucket varies by its location to provide more granular results
43469  * at the edges of a channel's capacity, where it is more likely to sit.
43470  *
43471  * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
43472  * is calculated by dividing that bucket's value with the total value of all buckets.
43473  *
43474  * For example, using a lower bucket count for illustrative purposes, a value of
43475  * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
43476  * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
43477  * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
43478  * in the top and bottom bucket, and roughly with similar (recent) frequency.
43479  *
43480  * Because the datapoints are decayed slowly over time, values will eventually return to
43481  * `Some(([1; 32], [1; 32]))` and then to `None` once no datapoints remain.
43482  *
43483  * In order to fetch a single success probability from the buckets provided here, as used in
43484  * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
43485  */
43486 MUST_USE_RES struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
43487
43488 /**
43489  * Query the probability of payment success sending the given `amount_msat` over the channel
43490  * with `scid` towards the given `target` node, based on the historical estimated liquidity
43491  * bounds.
43492  *
43493  * These are the same bounds as returned by
43494  * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
43495  * [`Self::estimated_channel_liquidity_range`]).
43496  */
43497 MUST_USE_RES struct LDKCOption_f64Z ProbabilisticScorer_historical_estimated_payment_success_probability(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target, uint64_t amount_msat, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR params);
43498
43499 /**
43500  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
43501  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
43502  */
43503 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
43504
43505 /**
43506  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
43507  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
43508  */
43509 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
43510
43511 /**
43512  * Constructs a new Score which calls the relevant methods on this_arg.
43513  * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
43514  */
43515 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
43516
43517 /**
43518  * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
43519  */
43520 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
43521
43522 /**
43523  * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
43524  */
43525 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
43526
43527 /**
43528  * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
43529  */
43530 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
43531
43532 /**
43533  * The outpoint which is spendable.
43534  */
43535 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43536
43537 /**
43538  * The outpoint which is spendable.
43539  */
43540 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
43541
43542 /**
43543  * Per commitment point to derive the delayed payment key by key holder.
43544  */
43545 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43546
43547 /**
43548  * Per commitment point to derive the delayed payment key by key holder.
43549  */
43550 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43551
43552 /**
43553  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
43554  * the witness_script.
43555  */
43556 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43557
43558 /**
43559  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
43560  * the witness_script.
43561  */
43562 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
43563
43564 /**
43565  * The output which is referenced by the given outpoint.
43566  */
43567 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43568
43569 /**
43570  * The output which is referenced by the given outpoint.
43571  */
43572 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
43573
43574 /**
43575  * The revocation point specific to the commitment transaction which was broadcast. Used to
43576  * derive the witnessScript for this output.
43577  */
43578 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43579
43580 /**
43581  * The revocation point specific to the commitment transaction which was broadcast. Used to
43582  * derive the witnessScript for this output.
43583  */
43584 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43585
43586 /**
43587  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43588  * This may be useful in re-deriving keys used in the channel to spend the output.
43589  */
43590 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
43591
43592 /**
43593  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43594  * This may be useful in re-deriving keys used in the channel to spend the output.
43595  */
43596 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43597
43598 /**
43599  * The value of the channel which this output originated from, possibly indirectly.
43600  */
43601 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43602
43603 /**
43604  * The value of the channel which this output originated from, possibly indirectly.
43605  */
43606 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43607
43608 /**
43609  * Constructs a new DelayedPaymentOutputDescriptor given each field
43610  */
43611 MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
43612
43613 /**
43614  * Creates a copy of the DelayedPaymentOutputDescriptor
43615  */
43616 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
43617
43618 /**
43619  * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
43620  */
43621 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
43622
43623 /**
43624  * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
43625  * This ignores pointers and is_owned flags and looks at the values in fields.
43626  * Two objects with NULL inner values will be considered "equal" here.
43627  */
43628 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
43629
43630 /**
43631  * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
43632  */
43633 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
43634
43635 /**
43636  * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
43637  */
43638 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
43639
43640 /**
43641  * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
43642  */
43643 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
43644
43645 /**
43646  * The outpoint which is spendable.
43647  */
43648 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43649
43650 /**
43651  * The outpoint which is spendable.
43652  */
43653 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
43654
43655 /**
43656  * The output which is referenced by the given outpoint.
43657  */
43658 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43659
43660 /**
43661  * The output which is referenced by the given outpoint.
43662  */
43663 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
43664
43665 /**
43666  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43667  * This may be useful in re-deriving keys used in the channel to spend the output.
43668  */
43669 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
43670
43671 /**
43672  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43673  * This may be useful in re-deriving keys used in the channel to spend the output.
43674  */
43675 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43676
43677 /**
43678  * The value of the channel which this transactions spends.
43679  */
43680 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43681
43682 /**
43683  * The value of the channel which this transactions spends.
43684  */
43685 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43686
43687 /**
43688  * The necessary channel parameters that need to be provided to the re-derived signer through
43689  * [`ChannelSigner::provide_channel_parameters`].
43690  *
43691  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
43692  *
43693  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43694  */
43695 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43696
43697 /**
43698  * The necessary channel parameters that need to be provided to the re-derived signer through
43699  * [`ChannelSigner::provide_channel_parameters`].
43700  *
43701  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
43702  *
43703  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
43704  */
43705 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
43706
43707 /**
43708  * Constructs a new StaticPaymentOutputDescriptor given each field
43709  *
43710  * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
43711  */
43712 MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
43713
43714 /**
43715  * Creates a copy of the StaticPaymentOutputDescriptor
43716  */
43717 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
43718
43719 /**
43720  * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
43721  */
43722 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
43723
43724 /**
43725  * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
43726  * This ignores pointers and is_owned flags and looks at the values in fields.
43727  * Two objects with NULL inner values will be considered "equal" here.
43728  */
43729 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
43730
43731 /**
43732  * Returns the `witness_script` of the spendable output.
43733  *
43734  * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
43735  * originated from an anchor outputs channel, as they take the form of a P2WSH script.
43736  */
43737 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
43738
43739 /**
43740  * The maximum length a well-formed witness spending one of these should have.
43741  * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
43742  * shorter.
43743  */
43744 MUST_USE_RES uintptr_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
43745
43746 /**
43747  * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
43748  */
43749 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
43750
43751 /**
43752  * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
43753  */
43754 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
43755
43756 /**
43757  * Frees any resources used by the SpendableOutputDescriptor
43758  */
43759 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
43760
43761 /**
43762  * Creates a copy of the SpendableOutputDescriptor
43763  */
43764 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
43765
43766 /**
43767  * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
43768  */
43769 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
43770
43771 /**
43772  * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
43773  */
43774 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
43775
43776 /**
43777  * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
43778  */
43779 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
43780
43781 /**
43782  * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
43783  */
43784 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
43785
43786 /**
43787  * Checks if two SpendableOutputDescriptors contain equal inner contents.
43788  * This ignores pointers and is_owned flags and looks at the values in fields.
43789  */
43790 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
43791
43792 /**
43793  * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
43794  */
43795 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
43796
43797 /**
43798  * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
43799  */
43800 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
43801
43802 /**
43803  * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
43804  * the given outputs, plus an output to the given change destination (if sufficient
43805  * change value remains). The PSBT will have a feerate, at least, of the given value.
43806  *
43807  * The `locktime` argument is used to set the transaction's locktime. If `None`, the
43808  * transaction will have a locktime of 0. It it recommended to set this to the current block
43809  * height to avoid fee sniping, unless you have some specific reason to use a different
43810  * locktime.
43811  *
43812  * Returns the PSBT and expected max transaction weight.
43813  *
43814  * Returns `Err(())` if the output value is greater than the input value minus required fee,
43815  * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
43816  * does not match the one we can spend.
43817  *
43818  * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
43819  */
43820 MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
43821
43822 /**
43823  * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
43824  */
43825 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
43826
43827 /**
43828  * The value in satoshis of the channel we're attempting to spend the anchor output of.
43829  */
43830 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
43831
43832 /**
43833  * The value in satoshis of the channel we're attempting to spend the anchor output of.
43834  */
43835 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
43836
43837 /**
43838  * The unique identifier to re-derive the signer for the associated channel.
43839  */
43840 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
43841
43842 /**
43843  * The unique identifier to re-derive the signer for the associated channel.
43844  */
43845 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43846
43847 /**
43848  * The necessary channel parameters that need to be provided to the re-derived signer through
43849  * [`ChannelSigner::provide_channel_parameters`].
43850  */
43851 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
43852
43853 /**
43854  * The necessary channel parameters that need to be provided to the re-derived signer through
43855  * [`ChannelSigner::provide_channel_parameters`].
43856  */
43857 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
43858
43859 /**
43860  * Constructs a new ChannelDerivationParameters given each field
43861  */
43862 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
43863
43864 /**
43865  * Creates a copy of the ChannelDerivationParameters
43866  */
43867 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
43868
43869 /**
43870  * Checks if two ChannelDerivationParameterss contain equal inner contents.
43871  * This ignores pointers and is_owned flags and looks at the values in fields.
43872  * Two objects with NULL inner values will be considered "equal" here.
43873  */
43874 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
43875
43876 /**
43877  * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
43878  */
43879 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
43880
43881 /**
43882  * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
43883  */
43884 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
43885
43886 /**
43887  * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
43888  */
43889 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
43890
43891 /**
43892  * The parameters required to derive the signer for the HTLC input.
43893  */
43894 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43895
43896 /**
43897  * The parameters required to derive the signer for the HTLC input.
43898  */
43899 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
43900
43901 /**
43902  * The number of the commitment transaction in which the HTLC output lives.
43903  */
43904 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43905
43906 /**
43907  * The number of the commitment transaction in which the HTLC output lives.
43908  */
43909 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43910
43911 /**
43912  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
43913  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
43914  * arrive at unique keys per commitment.
43915  *
43916  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
43917  */
43918 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43919
43920 /**
43921  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
43922  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
43923  * arrive at unique keys per commitment.
43924  *
43925  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
43926  */
43927 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43928
43929 /**
43930  * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
43931  * originating from a channel supporting anchor outputs, otherwise it is the channel's
43932  * negotiated feerate at the time the commitment transaction was built.
43933  */
43934 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43935
43936 /**
43937  * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
43938  * originating from a channel supporting anchor outputs, otherwise it is the channel's
43939  * negotiated feerate at the time the commitment transaction was built.
43940  */
43941 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
43942
43943 /**
43944  * The details of the HTLC as it appears in the commitment transaction.
43945  */
43946 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43947
43948 /**
43949  * The details of the HTLC as it appears in the commitment transaction.
43950  */
43951 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
43952
43953 /**
43954  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
43955  * taken.
43956  */
43957 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43958
43959 /**
43960  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
43961  * taken.
43962  */
43963 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
43964
43965 /**
43966  * The counterparty's signature required to spend the HTLC output.
43967  */
43968 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43969
43970 /**
43971  * The counterparty's signature required to spend the HTLC output.
43972  */
43973 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
43974
43975 /**
43976  * Creates a copy of the HTLCDescriptor
43977  */
43978 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
43979
43980 /**
43981  * Checks if two HTLCDescriptors contain equal inner contents.
43982  * This ignores pointers and is_owned flags and looks at the values in fields.
43983  * Two objects with NULL inner values will be considered "equal" here.
43984  */
43985 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
43986
43987 /**
43988  * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
43989  */
43990 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
43991
43992 /**
43993  * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
43994  */
43995 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
43996
43997 /**
43998  * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
43999  * being spent by the HTLC input in the HTLC transaction.
44000  */
44001 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44002
44003 /**
44004  * Returns the UTXO to be spent by the HTLC input, which can be obtained via
44005  * [`Self::unsigned_tx_input`].
44006  */
44007 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44008
44009 /**
44010  * Returns the unsigned transaction input spending the HTLC output in the commitment
44011  * transaction.
44012  */
44013 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44014
44015 /**
44016  * Returns the delayed output created as a result of spending the HTLC output in the commitment
44017  * transaction.
44018  */
44019 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44020
44021 /**
44022  * Returns the witness script of the HTLC output in the commitment transaction.
44023  */
44024 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44025
44026 /**
44027  * Returns the fully signed witness required to spend the HTLC output in the commitment
44028  * transaction.
44029  */
44030 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
44031
44032 /**
44033  * Derives the channel signer required to sign the HTLC input.
44034  */
44035 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
44036
44037 /**
44038  * Calls the free function if one is set
44039  */
44040 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
44041
44042 /**
44043  * Calls the free function if one is set
44044  */
44045 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
44046
44047 /**
44048  * Creates a copy of a WriteableEcdsaChannelSigner
44049  */
44050 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
44051
44052 /**
44053  * Calls the free function if one is set
44054  */
44055 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
44056
44057 /**
44058  * Creates a copy of the Recipient
44059  */
44060 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
44061
44062 /**
44063  * Utility method to constructs a new Node-variant Recipient
44064  */
44065 enum LDKRecipient Recipient_node(void);
44066
44067 /**
44068  * Utility method to constructs a new PhantomNode-variant Recipient
44069  */
44070 enum LDKRecipient Recipient_phantom_node(void);
44071
44072 /**
44073  * Calls the free function if one is set
44074  */
44075 void EntropySource_free(struct LDKEntropySource this_ptr);
44076
44077 /**
44078  * Calls the free function if one is set
44079  */
44080 void NodeSigner_free(struct LDKNodeSigner this_ptr);
44081
44082 /**
44083  * Calls the free function if one is set
44084  */
44085 void SignerProvider_free(struct LDKSignerProvider this_ptr);
44086
44087 /**
44088  * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
44089  */
44090 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
44091
44092 /**
44093  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
44094  * holder's anchor output in a commitment transaction, if one is present.
44095  */
44096 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44097
44098 /**
44099  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
44100  * holder's anchor output in a commitment transaction, if one is present.
44101  */
44102 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44103
44104 /**
44105  * Holder secret key for blinded revocation pubkey.
44106  */
44107 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44108
44109 /**
44110  * Holder secret key for blinded revocation pubkey.
44111  */
44112 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44113
44114 /**
44115  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
44116  */
44117 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44118
44119 /**
44120  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
44121  */
44122 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44123
44124 /**
44125  * Holder secret key used in an HTLC transaction.
44126  */
44127 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44128
44129 /**
44130  * Holder secret key used in an HTLC transaction.
44131  */
44132 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44133
44134 /**
44135  * Holder HTLC secret key used in commitment transaction HTLC outputs.
44136  */
44137 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44138
44139 /**
44140  * Holder HTLC secret key used in commitment transaction HTLC outputs.
44141  */
44142 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44143
44144 /**
44145  * Commitment seed.
44146  */
44147 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44148
44149 /**
44150  * Commitment seed.
44151  */
44152 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44153
44154 /**
44155  * Creates a copy of the InMemorySigner
44156  */
44157 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
44158
44159 /**
44160  * Creates a new [`InMemorySigner`].
44161  */
44162 MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id, struct LDKThirtyTwoBytes rand_bytes_unique_start);
44163
44164 /**
44165  * Returns the counterparty's pubkeys.
44166  *
44167  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44168  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44169  *
44170  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44171  */
44172 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44173
44174 /**
44175  * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
44176  * transactions, i.e., the amount of time that we have to wait to recover our funds if we
44177  * broadcast a transaction.
44178  *
44179  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44180  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44181  */
44182 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44183
44184 /**
44185  * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
44186  * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
44187  * if they broadcast a transaction.
44188  *
44189  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44190  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44191  */
44192 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44193
44194 /**
44195  * Returns whether the holder is the initiator.
44196  *
44197  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44198  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44199  */
44200 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44201
44202 /**
44203  * Funding outpoint
44204  *
44205  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44206  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44207  *
44208  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44209  */
44210 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44211
44212 /**
44213  * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
44214  * building transactions.
44215  *
44216  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44217  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44218  *
44219  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44220  */
44221 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44222
44223 /**
44224  * Returns the channel type features of the channel parameters. Should be helpful for
44225  * determining a channel's category, i. e. legacy/anchors/taproot/etc.
44226  *
44227  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44228  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44229  *
44230  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44231  */
44232 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44233
44234 /**
44235  * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
44236  * by `descriptor`, returning the witness stack for the input.
44237  *
44238  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
44239  * is not spending the outpoint described by [`descriptor.outpoint`],
44240  * or if an output descriptor `script_pubkey` does not match the one we can spend.
44241  *
44242  * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
44243  */
44244 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
44245
44246 /**
44247  * Sign the single input of `spend_tx` at index `input_idx` which spends the output
44248  * described by `descriptor`, returning the witness stack for the input.
44249  *
44250  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
44251  * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
44252  * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
44253  * `script_pubkey` does not match the one we can spend.
44254  *
44255  * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
44256  * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
44257  */
44258 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
44259
44260 /**
44261  * Constructs a new EntropySource which calls the relevant methods on this_arg.
44262  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
44263  */
44264 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44265
44266 /**
44267  * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
44268  * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
44269  */
44270 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44271
44272 /**
44273  * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
44274  * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
44275  */
44276 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44277
44278 /**
44279  * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
44280  * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
44281  */
44282 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44283
44284 /**
44285  * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
44286  */
44287 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
44288
44289 /**
44290  * Read a InMemorySigner from a byte array, created by InMemorySigner_write
44291  */
44292 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
44293
44294 /**
44295  * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
44296  */
44297 void KeysManager_free(struct LDKKeysManager this_obj);
44298
44299 /**
44300  * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
44301  * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
44302  * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
44303  * without a doubt, be unique to this instance. ie if you start multiple times with the same
44304  * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
44305  * is to simply use the current time (with very high precision).
44306  *
44307  * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
44308  * obviously, `starting_time` should be unique every time you reload the library - it is only
44309  * used to generate new ephemeral key data (which will be stored by the individual channel if
44310  * necessary).
44311  *
44312  * Note that the seed is required to recover certain on-chain funds independent of
44313  * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
44314  * for any channel, and some on-chain during-closing funds.
44315  *
44316  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
44317  */
44318 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
44319
44320 /**
44321  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
44322  */
44323 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
44324
44325 /**
44326  * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
44327  */
44328 MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
44329
44330 /**
44331  * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
44332  * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
44333  * are no other inputs that need signing.
44334  *
44335  * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
44336  *
44337  * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
44338  * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
44339  */
44340 MUST_USE_RES struct LDKCResult_CVec_u8ZNoneZ KeysManager_sign_spendable_outputs_psbt(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_u8Z psbt);
44341
44342 /**
44343  * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
44344  * output to the given change destination (if sufficient change value remains). The
44345  * transaction will have a feerate, at least, of the given value.
44346  *
44347  * The `locktime` argument is used to set the transaction's locktime. If `None`, the
44348  * transaction will have a locktime of 0. It it recommended to set this to the current block
44349  * height to avoid fee sniping, unless you have some specific reason to use a different
44350  * locktime.
44351  *
44352  * Returns `Err(())` if the output value is greater than the input value minus required fee,
44353  * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
44354  * does not match the one we can spend.
44355  *
44356  * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
44357  *
44358  * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
44359  * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
44360  */
44361 MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
44362
44363 /**
44364  * Constructs a new EntropySource which calls the relevant methods on this_arg.
44365  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
44366  */
44367 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
44368
44369 /**
44370  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
44371  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
44372  */
44373 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
44374
44375 /**
44376  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
44377  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
44378  */
44379 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
44380
44381 /**
44382  * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
44383  */
44384 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
44385
44386 /**
44387  * Constructs a new EntropySource which calls the relevant methods on this_arg.
44388  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
44389  */
44390 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44391
44392 /**
44393  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
44394  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
44395  */
44396 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44397
44398 /**
44399  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
44400  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
44401  */
44402 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44403
44404 /**
44405  * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
44406  * that is shared across all nodes that intend to participate in [phantom node payments]
44407  * together.
44408  *
44409  * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
44410  * `starting_time_nanos`.
44411  *
44412  * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
44413  * same across restarts, or else inbound payments may fail.
44414  *
44415  * [phantom node payments]: PhantomKeysManager
44416  */
44417 MUST_USE_RES struct LDKPhantomKeysManager PhantomKeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos, const uint8_t (*cross_node_seed)[32]);
44418
44419 /**
44420  * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
44421  */
44422 MUST_USE_RES struct LDKCResult_TransactionNoneZ PhantomKeysManager_spend_spendable_outputs(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
44423
44424 /**
44425  * See [`KeysManager::derive_channel_keys`] for documentation on this method.
44426  */
44427 MUST_USE_RES struct LDKInMemorySigner PhantomKeysManager_derive_channel_keys(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
44428
44429 /**
44430  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
44431  */
44432 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44433
44434 /**
44435  * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
44436  * last-hop onion data, etc.
44437  */
44438 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44439
44440 /**
44441  * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
44442  */
44443 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
44444
44445 /**
44446  * Calls the free function if one is set
44447  */
44448 void MessageRouter_free(struct LDKMessageRouter this_ptr);
44449
44450 /**
44451  * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
44452  */
44453 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
44454
44455 /**
44456  * Constructs a new DefaultMessageRouter given each field
44457  */
44458 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(void);
44459
44460 /**
44461  * Constructs a new MessageRouter which calls the relevant methods on this_arg.
44462  * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
44463  */
44464 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
44465
44466 /**
44467  * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
44468  */
44469 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
44470
44471 /**
44472  * Nodes on the path between the sender and the destination.
44473  *
44474  * Returns a copy of the field.
44475  */
44476 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
44477
44478 /**
44479  * Nodes on the path between the sender and the destination.
44480  */
44481 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
44482
44483 /**
44484  * The recipient of the message.
44485  */
44486 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
44487
44488 /**
44489  * The recipient of the message.
44490  */
44491 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
44492
44493 /**
44494  * Constructs a new OnionMessagePath given each field
44495  */
44496 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg);
44497
44498 /**
44499  * Creates a copy of the OnionMessagePath
44500  */
44501 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
44502
44503 /**
44504  * Frees any resources used by the Destination
44505  */
44506 void Destination_free(struct LDKDestination this_ptr);
44507
44508 /**
44509  * Creates a copy of the Destination
44510  */
44511 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
44512
44513 /**
44514  * Utility method to constructs a new Node-variant Destination
44515  */
44516 struct LDKDestination Destination_node(struct LDKPublicKey a);
44517
44518 /**
44519  * Utility method to constructs a new BlindedPath-variant Destination
44520  */
44521 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
44522
44523 /**
44524  * Frees any resources used by the SendError
44525  */
44526 void SendError_free(struct LDKSendError this_ptr);
44527
44528 /**
44529  * Creates a copy of the SendError
44530  */
44531 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
44532
44533 /**
44534  * Utility method to constructs a new Secp256k1-variant SendError
44535  */
44536 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
44537
44538 /**
44539  * Utility method to constructs a new TooBigPacket-variant SendError
44540  */
44541 struct LDKSendError SendError_too_big_packet(void);
44542
44543 /**
44544  * Utility method to constructs a new TooFewBlindedHops-variant SendError
44545  */
44546 struct LDKSendError SendError_too_few_blinded_hops(void);
44547
44548 /**
44549  * Utility method to constructs a new InvalidFirstHop-variant SendError
44550  */
44551 struct LDKSendError SendError_invalid_first_hop(void);
44552
44553 /**
44554  * Utility method to constructs a new InvalidMessage-variant SendError
44555  */
44556 struct LDKSendError SendError_invalid_message(void);
44557
44558 /**
44559  * Utility method to constructs a new BufferFull-variant SendError
44560  */
44561 struct LDKSendError SendError_buffer_full(void);
44562
44563 /**
44564  * Utility method to constructs a new GetNodeIdFailed-variant SendError
44565  */
44566 struct LDKSendError SendError_get_node_id_failed(void);
44567
44568 /**
44569  * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
44570  */
44571 struct LDKSendError SendError_blinded_path_advance_failed(void);
44572
44573 /**
44574  * Checks if two SendErrors contain equal inner contents.
44575  * This ignores pointers and is_owned flags and looks at the values in fields.
44576  */
44577 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
44578
44579 /**
44580  * Calls the free function if one is set
44581  */
44582 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
44583
44584 /**
44585  * Frees any resources used by the PeeledOnion
44586  */
44587 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
44588
44589 /**
44590  * Creates a copy of the PeeledOnion
44591  */
44592 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
44593
44594 /**
44595  * Utility method to constructs a new Forward-variant PeeledOnion
44596  */
44597 struct LDKPeeledOnion PeeledOnion_forward(struct LDKPublicKey a, struct LDKOnionMessage b);
44598
44599 /**
44600  * Utility method to constructs a new Receive-variant PeeledOnion
44601  */
44602 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
44603
44604 /**
44605  * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
44606  * `path`.
44607  *
44608  * Returns both the node id of the peer to send the message to and the message itself.
44609  *
44610  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
44611  */
44612 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
44613
44614 /**
44615  * Decode one layer of an incoming [`OnionMessage`].
44616  *
44617  * Returns either the next layer of the onion for forwarding or the decrypted content for the
44618  * receiver.
44619  */
44620 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
44621
44622 /**
44623  * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
44624  * their respective handlers.
44625  */
44626 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler);
44627
44628 /**
44629  * Sends an [`OnionMessage`] with the given `contents` for sending to the destination of
44630  * `path`.
44631  *
44632  * See [`OnionMessenger`] for example usage.
44633  *
44634  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
44635  */
44636 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
44637
44638 /**
44639  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
44640  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
44641  */
44642 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
44643
44644 /**
44645  * Calls the free function if one is set
44646  */
44647 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
44648
44649 /**
44650  * Frees any resources used by the OffersMessage
44651  */
44652 void OffersMessage_free(struct LDKOffersMessage this_ptr);
44653
44654 /**
44655  * Creates a copy of the OffersMessage
44656  */
44657 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
44658
44659 /**
44660  * Utility method to constructs a new InvoiceRequest-variant OffersMessage
44661  */
44662 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
44663
44664 /**
44665  * Utility method to constructs a new Invoice-variant OffersMessage
44666  */
44667 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
44668
44669 /**
44670  * Utility method to constructs a new InvoiceError-variant OffersMessage
44671  */
44672 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
44673
44674 /**
44675  * Returns whether `tlv_type` corresponds to a TLV record for Offers.
44676  */
44677 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
44678
44679 /**
44680  * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
44681  */
44682 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
44683
44684 /**
44685  * Read a OffersMessage from a byte array, created by OffersMessage_write
44686  */
44687 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
44688
44689 /**
44690  * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
44691  */
44692 void Packet_free(struct LDKPacket this_obj);
44693
44694 /**
44695  * Bolt 04 version number
44696  */
44697 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
44698
44699 /**
44700  * Bolt 04 version number
44701  */
44702 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
44703
44704 /**
44705  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
44706  */
44707 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
44708
44709 /**
44710  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
44711  */
44712 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44713
44714 /**
44715  * Encrypted payload for the next hop
44716  *
44717  * Returns a copy of the field.
44718  */
44719 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
44720
44721 /**
44722  * Encrypted payload for the next hop
44723  */
44724 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
44725
44726 /**
44727  * HMAC to verify the integrity of hop_data
44728  */
44729 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
44730
44731 /**
44732  * HMAC to verify the integrity of hop_data
44733  */
44734 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44735
44736 /**
44737  * Constructs a new Packet given each field
44738  */
44739 MUST_USE_RES struct LDKPacket Packet_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
44740
44741 /**
44742  * Creates a copy of the Packet
44743  */
44744 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
44745
44746 /**
44747  * Checks if two Packets contain equal inner contents.
44748  * This ignores pointers and is_owned flags and looks at the values in fields.
44749  * Two objects with NULL inner values will be considered "equal" here.
44750  */
44751 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
44752
44753 /**
44754  * Serialize the Packet object into a byte array which can be read by Packet_read
44755  */
44756 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
44757
44758 /**
44759  * Frees any resources used by the ParsedOnionMessageContents
44760  */
44761 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
44762
44763 /**
44764  * Creates a copy of the ParsedOnionMessageContents
44765  */
44766 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
44767
44768 /**
44769  * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
44770  */
44771 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
44772
44773 /**
44774  * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
44775  */
44776 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
44777
44778 /**
44779  * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
44780  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
44781  */
44782 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
44783
44784 /**
44785  * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
44786  */
44787 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
44788
44789 /**
44790  * Creates a copy of a OnionMessageContents
44791  */
44792 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
44793
44794 /**
44795  * Calls the free function if one is set
44796  */
44797 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
44798
44799 /**
44800  * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
44801  */
44802 void BlindedPath_free(struct LDKBlindedPath this_obj);
44803
44804 /**
44805  * To send to a blinded path, the sender first finds a route to the unblinded
44806  * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
44807  * message or payment's next hop and forward it along.
44808  *
44809  * [`encrypted_payload`]: BlindedHop::encrypted_payload
44810  */
44811 struct LDKPublicKey BlindedPath_get_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44812
44813 /**
44814  * To send to a blinded path, the sender first finds a route to the unblinded
44815  * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
44816  * message or payment's next hop and forward it along.
44817  *
44818  * [`encrypted_payload`]: BlindedHop::encrypted_payload
44819  */
44820 void BlindedPath_set_introduction_node_id(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44821
44822 /**
44823  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
44824  * message or payment.
44825  *
44826  * [`encrypted_payload`]: BlindedHop::encrypted_payload
44827  */
44828 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44829
44830 /**
44831  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
44832  * message or payment.
44833  *
44834  * [`encrypted_payload`]: BlindedHop::encrypted_payload
44835  */
44836 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44837
44838 /**
44839  * The hops composing the blinded path.
44840  */
44841 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44842
44843 /**
44844  * The hops composing the blinded path.
44845  */
44846 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
44847
44848 /**
44849  * Constructs a new BlindedPath given each field
44850  */
44851 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKPublicKey introduction_node_id_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
44852
44853 /**
44854  * Creates a copy of the BlindedPath
44855  */
44856 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
44857
44858 /**
44859  * Generates a non-cryptographic 64-bit hash of the BlindedPath.
44860  */
44861 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
44862
44863 /**
44864  * Checks if two BlindedPaths contain equal inner contents.
44865  * This ignores pointers and is_owned flags and looks at the values in fields.
44866  * Two objects with NULL inner values will be considered "equal" here.
44867  */
44868 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
44869
44870 /**
44871  * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
44872  */
44873 void BlindedHop_free(struct LDKBlindedHop this_obj);
44874
44875 /**
44876  * The blinded node id of this hop in a [`BlindedPath`].
44877  */
44878 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
44879
44880 /**
44881  * The blinded node id of this hop in a [`BlindedPath`].
44882  */
44883 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44884
44885 /**
44886  * The encrypted payload intended for this hop in a [`BlindedPath`].
44887  *
44888  * Returns a copy of the field.
44889  */
44890 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
44891
44892 /**
44893  * The encrypted payload intended for this hop in a [`BlindedPath`].
44894  */
44895 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
44896
44897 /**
44898  * Constructs a new BlindedHop given each field
44899  */
44900 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
44901
44902 /**
44903  * Creates a copy of the BlindedHop
44904  */
44905 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
44906
44907 /**
44908  * Generates a non-cryptographic 64-bit hash of the BlindedHop.
44909  */
44910 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
44911
44912 /**
44913  * Checks if two BlindedHops contain equal inner contents.
44914  * This ignores pointers and is_owned flags and looks at the values in fields.
44915  * Two objects with NULL inner values will be considered "equal" here.
44916  */
44917 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
44918
44919 /**
44920  * Create a one-hop blinded path for a message.
44921  */
44922 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44923
44924 /**
44925  * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
44926  * pubkey in `node_pks` will be the destination node.
44927  *
44928  * Errors if no hops are provided or if `node_pk`(s) are invalid.
44929  */
44930 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44931
44932 /**
44933  * Create a one-hop blinded path for a payment.
44934  */
44935 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44936
44937 /**
44938  * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
44939  */
44940 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
44941
44942 /**
44943  * Read a BlindedPath from a byte array, created by BlindedPath_write
44944  */
44945 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
44946
44947 /**
44948  * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
44949  */
44950 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
44951
44952 /**
44953  * Read a BlindedHop from a byte array, created by BlindedHop_write
44954  */
44955 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
44956
44957 /**
44958  * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
44959  */
44960 void ForwardNode_free(struct LDKForwardNode this_obj);
44961
44962 /**
44963  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
44964  * used for [`BlindedPayInfo`] construction.
44965  */
44966 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44967
44968 /**
44969  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
44970  * used for [`BlindedPayInfo`] construction.
44971  */
44972 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
44973
44974 /**
44975  * This node's pubkey.
44976  */
44977 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44978
44979 /**
44980  * This node's pubkey.
44981  */
44982 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44983
44984 /**
44985  * The maximum value, in msat, that may be accepted by this node.
44986  */
44987 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44988
44989 /**
44990  * The maximum value, in msat, that may be accepted by this node.
44991  */
44992 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
44993
44994 /**
44995  * Constructs a new ForwardNode given each field
44996  */
44997 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
44998
44999 /**
45000  * Creates a copy of the ForwardNode
45001  */
45002 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
45003
45004 /**
45005  * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
45006  */
45007 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
45008
45009 /**
45010  * The short channel id this payment should be forwarded out over.
45011  */
45012 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
45013
45014 /**
45015  * The short channel id this payment should be forwarded out over.
45016  */
45017 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
45018
45019 /**
45020  * Payment parameters for relaying over [`Self::short_channel_id`].
45021  */
45022 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
45023
45024 /**
45025  * Payment parameters for relaying over [`Self::short_channel_id`].
45026  */
45027 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
45028
45029 /**
45030  * Payment constraints for relaying over [`Self::short_channel_id`].
45031  */
45032 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
45033
45034 /**
45035  * Payment constraints for relaying over [`Self::short_channel_id`].
45036  */
45037 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
45038
45039 /**
45040  * Supported and required features when relaying a payment onion containing this object's
45041  * corresponding [`BlindedHop::encrypted_payload`].
45042  *
45043  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
45044  */
45045 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
45046
45047 /**
45048  * Supported and required features when relaying a payment onion containing this object's
45049  * corresponding [`BlindedHop::encrypted_payload`].
45050  *
45051  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
45052  */
45053 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
45054
45055 /**
45056  * Constructs a new ForwardTlvs given each field
45057  */
45058 MUST_USE_RES struct LDKForwardTlvs ForwardTlvs_new(uint64_t short_channel_id_arg, struct LDKPaymentRelay payment_relay_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKBlindedHopFeatures features_arg);
45059
45060 /**
45061  * Creates a copy of the ForwardTlvs
45062  */
45063 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
45064
45065 /**
45066  * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
45067  */
45068 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
45069
45070 /**
45071  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
45072  */
45073 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
45074
45075 /**
45076  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
45077  */
45078 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45079
45080 /**
45081  * Constraints for the receiver of this payment.
45082  */
45083 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
45084
45085 /**
45086  * Constraints for the receiver of this payment.
45087  */
45088 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
45089
45090 /**
45091  * Constructs a new ReceiveTlvs given each field
45092  */
45093 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg);
45094
45095 /**
45096  * Creates a copy of the ReceiveTlvs
45097  */
45098 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
45099
45100 /**
45101  * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
45102  */
45103 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
45104
45105 /**
45106  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
45107  */
45108 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
45109
45110 /**
45111  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
45112  */
45113 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
45114
45115 /**
45116  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
45117  * this [`BlindedHop`], (i.e., 10,000 is 1%).
45118  */
45119 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
45120
45121 /**
45122  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
45123  * this [`BlindedHop`], (i.e., 10,000 is 1%).
45124  */
45125 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
45126
45127 /**
45128  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
45129  */
45130 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
45131
45132 /**
45133  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
45134  */
45135 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
45136
45137 /**
45138  * Constructs a new PaymentRelay given each field
45139  */
45140 MUST_USE_RES struct LDKPaymentRelay PaymentRelay_new(uint16_t cltv_expiry_delta_arg, uint32_t fee_proportional_millionths_arg, uint32_t fee_base_msat_arg);
45141
45142 /**
45143  * Creates a copy of the PaymentRelay
45144  */
45145 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
45146
45147 /**
45148  * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
45149  */
45150 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
45151
45152 /**
45153  * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
45154  */
45155 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
45156
45157 /**
45158  * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
45159  */
45160 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
45161
45162 /**
45163  * The minimum value, in msat, that may be accepted by the node corresponding to this
45164  * [`BlindedHop`].
45165  */
45166 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
45167
45168 /**
45169  * The minimum value, in msat, that may be accepted by the node corresponding to this
45170  * [`BlindedHop`].
45171  */
45172 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
45173
45174 /**
45175  * Constructs a new PaymentConstraints given each field
45176  */
45177 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
45178
45179 /**
45180  * Creates a copy of the PaymentConstraints
45181  */
45182 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
45183
45184 /**
45185  * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
45186  */
45187 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
45188
45189 /**
45190  * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
45191  */
45192 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
45193
45194 /**
45195  * Read a ReceiveTlvs from a byte array, created by ReceiveTlvs_write
45196  */
45197 struct LDKCResult_ReceiveTlvsDecodeErrorZ ReceiveTlvs_read(struct LDKu8slice ser);
45198
45199 /**
45200  * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
45201  */
45202 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
45203
45204 /**
45205  * Read a PaymentRelay from a byte array, created by PaymentRelay_write
45206  */
45207 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
45208
45209 /**
45210  * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
45211  */
45212 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
45213
45214 /**
45215  * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
45216  */
45217 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
45218
45219 /**
45220  * Frees any resources used by the PaymentPurpose
45221  */
45222 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
45223
45224 /**
45225  * Creates a copy of the PaymentPurpose
45226  */
45227 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
45228
45229 /**
45230  * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
45231  */
45232 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
45233
45234 /**
45235  * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
45236  */
45237 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
45238
45239 /**
45240  * Checks if two PaymentPurposes contain equal inner contents.
45241  * This ignores pointers and is_owned flags and looks at the values in fields.
45242  */
45243 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
45244
45245 /**
45246  * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
45247  */
45248 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
45249
45250 /**
45251  * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
45252  */
45253 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
45254
45255 /**
45256  * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
45257  */
45258 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
45259
45260 /**
45261  * The `channel_id` of the channel over which the HTLC was received.
45262  */
45263 const uint8_t (*ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr))[32];
45264
45265 /**
45266  * The `channel_id` of the channel over which the HTLC was received.
45267  */
45268 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45269
45270 /**
45271  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
45272  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
45273  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
45274  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
45275  * `user_channel_id` will be randomized for an inbound channel.
45276  *
45277  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
45278  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
45279  * was not actually claimed until after upgrading.)
45280  *
45281  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
45282  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
45283  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
45284  */
45285 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
45286
45287 /**
45288  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
45289  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
45290  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
45291  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
45292  * `user_channel_id` will be randomized for an inbound channel.
45293  *
45294  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
45295  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
45296  * was not actually claimed until after upgrading.)
45297  *
45298  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
45299  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
45300  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
45301  */
45302 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
45303
45304 /**
45305  * The block height at which this HTLC expires.
45306  */
45307 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
45308
45309 /**
45310  * The block height at which this HTLC expires.
45311  */
45312 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
45313
45314 /**
45315  * The amount (in msats) of this part of an MPP.
45316  */
45317 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
45318
45319 /**
45320  * The amount (in msats) of this part of an MPP.
45321  */
45322 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
45323
45324 /**
45325  * Constructs a new ClaimedHTLC given each field
45326  */
45327 MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg);
45328
45329 /**
45330  * Creates a copy of the ClaimedHTLC
45331  */
45332 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
45333
45334 /**
45335  * Checks if two ClaimedHTLCs contain equal inner contents.
45336  * This ignores pointers and is_owned flags and looks at the values in fields.
45337  * Two objects with NULL inner values will be considered "equal" here.
45338  */
45339 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
45340
45341 /**
45342  * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
45343  */
45344 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
45345
45346 /**
45347  * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
45348  */
45349 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
45350
45351 /**
45352  * Frees any resources used by the PathFailure
45353  */
45354 void PathFailure_free(struct LDKPathFailure this_ptr);
45355
45356 /**
45357  * Creates a copy of the PathFailure
45358  */
45359 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
45360
45361 /**
45362  * Utility method to constructs a new InitialSend-variant PathFailure
45363  */
45364 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
45365
45366 /**
45367  * Utility method to constructs a new OnPath-variant PathFailure
45368  */
45369 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
45370
45371 /**
45372  * Checks if two PathFailures contain equal inner contents.
45373  * This ignores pointers and is_owned flags and looks at the values in fields.
45374  */
45375 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
45376
45377 /**
45378  * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
45379  */
45380 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
45381
45382 /**
45383  * Read a PathFailure from a byte array, created by PathFailure_write
45384  */
45385 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
45386
45387 /**
45388  * Frees any resources used by the ClosureReason
45389  */
45390 void ClosureReason_free(struct LDKClosureReason this_ptr);
45391
45392 /**
45393  * Creates a copy of the ClosureReason
45394  */
45395 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
45396
45397 /**
45398  * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
45399  */
45400 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
45401
45402 /**
45403  * Utility method to constructs a new HolderForceClosed-variant ClosureReason
45404  */
45405 struct LDKClosureReason ClosureReason_holder_force_closed(void);
45406
45407 /**
45408  * Utility method to constructs a new CooperativeClosure-variant ClosureReason
45409  */
45410 struct LDKClosureReason ClosureReason_cooperative_closure(void);
45411
45412 /**
45413  * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
45414  */
45415 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
45416
45417 /**
45418  * Utility method to constructs a new FundingTimedOut-variant ClosureReason
45419  */
45420 struct LDKClosureReason ClosureReason_funding_timed_out(void);
45421
45422 /**
45423  * Utility method to constructs a new ProcessingError-variant ClosureReason
45424  */
45425 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
45426
45427 /**
45428  * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
45429  */
45430 struct LDKClosureReason ClosureReason_disconnected_peer(void);
45431
45432 /**
45433  * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
45434  */
45435 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
45436
45437 /**
45438  * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
45439  */
45440 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
45441
45442 /**
45443  * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
45444  */
45445 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
45446
45447 /**
45448  * Checks if two ClosureReasons contain equal inner contents.
45449  * This ignores pointers and is_owned flags and looks at the values in fields.
45450  */
45451 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
45452
45453 /**
45454  * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
45455  */
45456 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
45457
45458 /**
45459  * Read a ClosureReason from a byte array, created by ClosureReason_write
45460  */
45461 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
45462
45463 /**
45464  * Frees any resources used by the HTLCDestination
45465  */
45466 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
45467
45468 /**
45469  * Creates a copy of the HTLCDestination
45470  */
45471 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
45472
45473 /**
45474  * Utility method to constructs a new NextHopChannel-variant HTLCDestination
45475  */
45476 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
45477
45478 /**
45479  * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
45480  */
45481 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
45482
45483 /**
45484  * Utility method to constructs a new InvalidForward-variant HTLCDestination
45485  */
45486 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
45487
45488 /**
45489  * Utility method to constructs a new FailedPayment-variant HTLCDestination
45490  */
45491 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
45492
45493 /**
45494  * Checks if two HTLCDestinations contain equal inner contents.
45495  * This ignores pointers and is_owned flags and looks at the values in fields.
45496  */
45497 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
45498
45499 /**
45500  * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
45501  */
45502 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
45503
45504 /**
45505  * Read a HTLCDestination from a byte array, created by HTLCDestination_write
45506  */
45507 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
45508
45509 /**
45510  * Creates a copy of the PaymentFailureReason
45511  */
45512 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
45513
45514 /**
45515  * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
45516  */
45517 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
45518
45519 /**
45520  * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
45521  */
45522 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
45523
45524 /**
45525  * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
45526  */
45527 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
45528
45529 /**
45530  * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
45531  */
45532 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
45533
45534 /**
45535  * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
45536  */
45537 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
45538
45539 /**
45540  * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
45541  */
45542 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
45543
45544 /**
45545  * Checks if two PaymentFailureReasons contain equal inner contents.
45546  * This ignores pointers and is_owned flags and looks at the values in fields.
45547  */
45548 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
45549
45550 /**
45551  * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
45552  */
45553 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
45554
45555 /**
45556  * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
45557  */
45558 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
45559
45560 /**
45561  * Frees any resources used by the Event
45562  */
45563 void Event_free(struct LDKEvent this_ptr);
45564
45565 /**
45566  * Creates a copy of the Event
45567  */
45568 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
45569
45570 /**
45571  * Utility method to constructs a new FundingGenerationReady-variant Event
45572  */
45573 struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id);
45574
45575 /**
45576  * Utility method to constructs a new PaymentClaimable-variant Event
45577  */
45578 struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKCOption_ThirtyTwoBytesZ via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
45579
45580 /**
45581  * Utility method to constructs a new PaymentClaimed-variant Event
45582  */
45583 struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKCVec_ClaimedHTLCZ htlcs, struct LDKCOption_u64Z sender_intended_total_msat);
45584
45585 /**
45586  * Utility method to constructs a new InvoiceRequestFailed-variant Event
45587  */
45588 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
45589
45590 /**
45591  * Utility method to constructs a new PaymentSent-variant Event
45592  */
45593 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
45594
45595 /**
45596  * Utility method to constructs a new PaymentFailed-variant Event
45597  */
45598 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
45599
45600 /**
45601  * Utility method to constructs a new PaymentPathSuccessful-variant Event
45602  */
45603 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
45604
45605 /**
45606  * Utility method to constructs a new PaymentPathFailed-variant Event
45607  */
45608 struct LDKEvent Event_payment_path_failed(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
45609
45610 /**
45611  * Utility method to constructs a new ProbeSuccessful-variant Event
45612  */
45613 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
45614
45615 /**
45616  * Utility method to constructs a new ProbeFailed-variant Event
45617  */
45618 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
45619
45620 /**
45621  * Utility method to constructs a new PendingHTLCsForwardable-variant Event
45622  */
45623 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
45624
45625 /**
45626  * Utility method to constructs a new HTLCIntercepted-variant Event
45627  */
45628 struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat);
45629
45630 /**
45631  * Utility method to constructs a new SpendableOutputs-variant Event
45632  */
45633 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKCOption_ThirtyTwoBytesZ channel_id);
45634
45635 /**
45636  * Utility method to constructs a new PaymentForwarded-variant Event
45637  */
45638 struct LDKEvent Event_payment_forwarded(struct LDKCOption_ThirtyTwoBytesZ prev_channel_id, struct LDKCOption_ThirtyTwoBytesZ next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
45639
45640 /**
45641  * Utility method to constructs a new ChannelPending-variant Event
45642  */
45643 struct LDKEvent Event_channel_pending(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo);
45644
45645 /**
45646  * Utility method to constructs a new ChannelReady-variant Event
45647  */
45648 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
45649
45650 /**
45651  * Utility method to constructs a new ChannelClosed-variant Event
45652  */
45653 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats);
45654
45655 /**
45656  * Utility method to constructs a new DiscardFunding-variant Event
45657  */
45658 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
45659
45660 /**
45661  * Utility method to constructs a new OpenChannelRequest-variant Event
45662  */
45663 struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
45664
45665 /**
45666  * Utility method to constructs a new HTLCHandlingFailed-variant Event
45667  */
45668 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
45669
45670 /**
45671  * Utility method to constructs a new BumpTransaction-variant Event
45672  */
45673 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
45674
45675 /**
45676  * Checks if two Events contain equal inner contents.
45677  * This ignores pointers and is_owned flags and looks at the values in fields.
45678  */
45679 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
45680
45681 /**
45682  * Serialize the Event object into a byte array which can be read by Event_read
45683  */
45684 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
45685
45686 /**
45687  * Read a Event from a byte array, created by Event_write
45688  */
45689 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
45690
45691 /**
45692  * Frees any resources used by the MessageSendEvent
45693  */
45694 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
45695
45696 /**
45697  * Creates a copy of the MessageSendEvent
45698  */
45699 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
45700
45701 /**
45702  * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
45703  */
45704 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
45705
45706 /**
45707  * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
45708  */
45709 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
45710
45711 /**
45712  * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
45713  */
45714 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
45715
45716 /**
45717  * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
45718  */
45719 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
45720
45721 /**
45722  * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
45723  */
45724 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
45725
45726 /**
45727  * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
45728  */
45729 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
45730
45731 /**
45732  * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
45733  */
45734 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
45735
45736 /**
45737  * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
45738  */
45739 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
45740
45741 /**
45742  * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
45743  */
45744 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
45745
45746 /**
45747  * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
45748  */
45749 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
45750
45751 /**
45752  * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
45753  */
45754 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
45755
45756 /**
45757  * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
45758  */
45759 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
45760
45761 /**
45762  * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
45763  */
45764 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
45765
45766 /**
45767  * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
45768  */
45769 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
45770
45771 /**
45772  * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
45773  */
45774 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
45775
45776 /**
45777  * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
45778  */
45779 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
45780
45781 /**
45782  * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
45783  */
45784 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
45785
45786 /**
45787  * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
45788  */
45789 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
45790
45791 /**
45792  * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
45793  */
45794 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
45795
45796 /**
45797  * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
45798  */
45799 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
45800
45801 /**
45802  * Utility method to constructs a new SendShutdown-variant MessageSendEvent
45803  */
45804 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
45805
45806 /**
45807  * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
45808  */
45809 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
45810
45811 /**
45812  * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
45813  */
45814 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
45815
45816 /**
45817  * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
45818  */
45819 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
45820
45821 /**
45822  * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
45823  */
45824 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
45825
45826 /**
45827  * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
45828  */
45829 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
45830
45831 /**
45832  * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
45833  */
45834 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
45835
45836 /**
45837  * Utility method to constructs a new HandleError-variant MessageSendEvent
45838  */
45839 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
45840
45841 /**
45842  * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
45843  */
45844 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
45845
45846 /**
45847  * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
45848  */
45849 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
45850
45851 /**
45852  * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
45853  */
45854 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
45855
45856 /**
45857  * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
45858  */
45859 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
45860
45861 /**
45862  * Calls the free function if one is set
45863  */
45864 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
45865
45866 /**
45867  * Calls the free function if one is set
45868  */
45869 void EventsProvider_free(struct LDKEventsProvider this_ptr);
45870
45871 /**
45872  * Calls the free function if one is set
45873  */
45874 void EventHandler_free(struct LDKEventHandler this_ptr);
45875
45876 /**
45877  * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
45878  */
45879 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
45880
45881 /**
45882  * The parameters required to derive the signer for the anchor input.
45883  */
45884 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
45885
45886 /**
45887  * The parameters required to derive the signer for the anchor input.
45888  */
45889 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
45890
45891 /**
45892  * The transaction input's outpoint corresponding to the commitment transaction's anchor
45893  * output.
45894  */
45895 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
45896
45897 /**
45898  * The transaction input's outpoint corresponding to the commitment transaction's anchor
45899  * output.
45900  */
45901 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45902
45903 /**
45904  * Constructs a new AnchorDescriptor given each field
45905  */
45906 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
45907
45908 /**
45909  * Creates a copy of the AnchorDescriptor
45910  */
45911 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
45912
45913 /**
45914  * Checks if two AnchorDescriptors contain equal inner contents.
45915  * This ignores pointers and is_owned flags and looks at the values in fields.
45916  * Two objects with NULL inner values will be considered "equal" here.
45917  */
45918 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
45919
45920 /**
45921  * Returns the UTXO to be spent by the anchor input, which can be obtained via
45922  * [`Self::unsigned_tx_input`].
45923  */
45924 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45925
45926 /**
45927  * Returns the unsigned transaction input spending the anchor output in the commitment
45928  * transaction.
45929  */
45930 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45931
45932 /**
45933  * Returns the witness script of the anchor output in the commitment transaction.
45934  */
45935 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45936
45937 /**
45938  * Returns the fully signed witness required to spend the anchor output in the commitment
45939  * transaction.
45940  */
45941 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
45942
45943 /**
45944  * Derives the channel signer required to sign the anchor input.
45945  */
45946 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
45947
45948 /**
45949  * Frees any resources used by the BumpTransactionEvent
45950  */
45951 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
45952
45953 /**
45954  * Creates a copy of the BumpTransactionEvent
45955  */
45956 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
45957
45958 /**
45959  * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
45960  */
45961 struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs);
45962
45963 /**
45964  * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
45965  */
45966 struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
45967
45968 /**
45969  * Checks if two BumpTransactionEvents contain equal inner contents.
45970  * This ignores pointers and is_owned flags and looks at the values in fields.
45971  */
45972 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
45973
45974 /**
45975  * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
45976  */
45977 void Input_free(struct LDKInput this_obj);
45978
45979 /**
45980  * The unique identifier of the input.
45981  */
45982 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
45983
45984 /**
45985  * The unique identifier of the input.
45986  */
45987 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45988
45989 /**
45990  * The UTXO being spent by the input.
45991  */
45992 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
45993
45994 /**
45995  * The UTXO being spent by the input.
45996  */
45997 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
45998
45999 /**
46000  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
46001  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
46002  * script.
46003  */
46004 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
46005
46006 /**
46007  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
46008  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
46009  * script.
46010  */
46011 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
46012
46013 /**
46014  * Constructs a new Input given each field
46015  */
46016 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
46017
46018 /**
46019  * Creates a copy of the Input
46020  */
46021 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
46022
46023 /**
46024  * Generates a non-cryptographic 64-bit hash of the Input.
46025  */
46026 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
46027
46028 /**
46029  * Checks if two Inputs contain equal inner contents.
46030  * This ignores pointers and is_owned flags and looks at the values in fields.
46031  * Two objects with NULL inner values will be considered "equal" here.
46032  */
46033 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
46034
46035 /**
46036  * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
46037  */
46038 void Utxo_free(struct LDKUtxo this_obj);
46039
46040 /**
46041  * The unique identifier of the output.
46042  */
46043 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
46044
46045 /**
46046  * The unique identifier of the output.
46047  */
46048 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
46049
46050 /**
46051  * The output to spend.
46052  */
46053 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
46054
46055 /**
46056  * The output to spend.
46057  */
46058 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
46059
46060 /**
46061  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
46062  * with their lengths included, required to satisfy the output's script. The weight consumed by
46063  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
46064  */
46065 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
46066
46067 /**
46068  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
46069  * with their lengths included, required to satisfy the output's script. The weight consumed by
46070  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
46071  */
46072 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
46073
46074 /**
46075  * Constructs a new Utxo given each field
46076  */
46077 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
46078
46079 /**
46080  * Creates a copy of the Utxo
46081  */
46082 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
46083
46084 /**
46085  * Generates a non-cryptographic 64-bit hash of the Utxo.
46086  */
46087 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
46088
46089 /**
46090  * Checks if two Utxos contain equal inner contents.
46091  * This ignores pointers and is_owned flags and looks at the values in fields.
46092  * Two objects with NULL inner values will be considered "equal" here.
46093  */
46094 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
46095
46096 /**
46097  * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
46098  */
46099 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
46100
46101 /**
46102  * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
46103  */
46104 void CoinSelection_free(struct LDKCoinSelection this_obj);
46105
46106 /**
46107  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
46108  * requiring additional fees.
46109  */
46110 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
46111
46112 /**
46113  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
46114  * requiring additional fees.
46115  */
46116 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
46117
46118 /**
46119  * An additional output tracking whether any change remained after coin selection. This output
46120  * should always have a value above dust for its given `script_pubkey`. It should not be
46121  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
46122  * not met. This implies no other party should be able to spend it except us.
46123  */
46124 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
46125
46126 /**
46127  * An additional output tracking whether any change remained after coin selection. This output
46128  * should always have a value above dust for its given `script_pubkey`. It should not be
46129  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
46130  * not met. This implies no other party should be able to spend it except us.
46131  */
46132 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
46133
46134 /**
46135  * Constructs a new CoinSelection given each field
46136  */
46137 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
46138
46139 /**
46140  * Creates a copy of the CoinSelection
46141  */
46142 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
46143
46144 /**
46145  * Calls the free function if one is set
46146  */
46147 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
46148
46149 /**
46150  * Calls the free function if one is set
46151  */
46152 void WalletSource_free(struct LDKWalletSource this_ptr);
46153
46154 /**
46155  * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
46156  */
46157 void Wallet_free(struct LDKWallet this_obj);
46158
46159 /**
46160  * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
46161  * of [`CoinSelectionSource`].
46162  */
46163 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
46164
46165 /**
46166  * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
46167  * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
46168  */
46169 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
46170
46171 /**
46172  * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
46173  */
46174 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
46175
46176 /**
46177  * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
46178  *
46179  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
46180  */
46181 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
46182
46183 /**
46184  * Handles all variants of [`BumpTransactionEvent`].
46185  */
46186 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
46187
46188 /**
46189  * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
46190  */
46191 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
46192
46193 /**
46194  * Constructs a new [`FilesystemStore`].
46195  */
46196 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
46197
46198 /**
46199  * Returns the data directory.
46200  */
46201 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
46202
46203 /**
46204  * Constructs a new KVStore which calls the relevant methods on this_arg.
46205  * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
46206  */
46207 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
46208
46209 /**
46210  * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
46211  */
46212 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
46213
46214 /**
46215  * Frees any resources used by the GossipSync
46216  */
46217 void GossipSync_free(struct LDKGossipSync this_ptr);
46218
46219 /**
46220  * Utility method to constructs a new P2P-variant GossipSync
46221  */
46222 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
46223
46224 /**
46225  * Utility method to constructs a new Rapid-variant GossipSync
46226  */
46227 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
46228
46229 /**
46230  * Utility method to constructs a new None-variant GossipSync
46231  */
46232 struct LDKGossipSync GossipSync_none(void);
46233
46234 /**
46235  * Start a background thread that takes care of responsibilities enumerated in the [top-level
46236  * documentation].
46237  *
46238  * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
46239  * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
46240  * either [`join`] or [`stop`].
46241  *
46242  * # Data Persistence
46243  *
46244  * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
46245  * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
46246  * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
46247  * provided implementation.
46248  *
46249  * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
46250  * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
46251  * See the `lightning-persister` crate for LDK's provided implementation.
46252  *
46253  * Typically, users should either implement [`Persister::persist_manager`] to never return an
46254  * error or call [`join`] and handle any error that may arise. For the latter case,
46255  * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
46256  *
46257  * # Event Handling
46258  *
46259  * `event_handler` is responsible for handling events that users should be notified of (e.g.,
46260  * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
46261  * functionality implemented by other handlers.
46262  * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
46263  *
46264  * # Rapid Gossip Sync
46265  *
46266  * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
46267  * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
46268  * until the [`RapidGossipSync`] instance completes its first sync.
46269  *
46270  * [top-level documentation]: BackgroundProcessor
46271  * [`join`]: Self::join
46272  * [`stop`]: Self::stop
46273  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
46274  * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
46275  * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
46276  * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
46277  * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
46278  * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
46279  */
46280 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKCOption_WriteableScoreZ scorer);
46281
46282 /**
46283  * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
46284  * [`ChannelManager`].
46285  *
46286  * # Panics
46287  *
46288  * This function panics if the background thread has panicked such as while persisting or
46289  * handling events.
46290  *
46291  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
46292  */
46293 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
46294
46295 /**
46296  * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
46297  * [`ChannelManager`].
46298  *
46299  * # Panics
46300  *
46301  * This function panics if the background thread has panicked such as while persisting or
46302  * handling events.
46303  *
46304  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
46305  */
46306 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
46307
46308 /**
46309  * Frees any resources used by the Bolt11ParseError
46310  */
46311 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
46312
46313 /**
46314  * Creates a copy of the Bolt11ParseError
46315  */
46316 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
46317
46318 /**
46319  * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
46320  */
46321 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
46322
46323 /**
46324  * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
46325  */
46326 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
46327
46328 /**
46329  * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
46330  */
46331 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
46332
46333 /**
46334  * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
46335  */
46336 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
46337
46338 /**
46339  * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
46340  */
46341 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
46342
46343 /**
46344  * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
46345  */
46346 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
46347
46348 /**
46349  * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
46350  */
46351 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
46352
46353 /**
46354  * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
46355  */
46356 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
46357
46358 /**
46359  * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
46360  */
46361 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
46362
46363 /**
46364  * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
46365  */
46366 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
46367
46368 /**
46369  * Utility method to constructs a new PaddingError-variant Bolt11ParseError
46370  */
46371 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
46372
46373 /**
46374  * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
46375  */
46376 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
46377
46378 /**
46379  * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
46380  */
46381 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
46382
46383 /**
46384  * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
46385  */
46386 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
46387
46388 /**
46389  * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
46390  */
46391 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
46392
46393 /**
46394  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
46395  */
46396 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
46397
46398 /**
46399  * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
46400  */
46401 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
46402
46403 /**
46404  * Utility method to constructs a new Skip-variant Bolt11ParseError
46405  */
46406 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
46407
46408 /**
46409  * Checks if two Bolt11ParseErrors contain equal inner contents.
46410  * This ignores pointers and is_owned flags and looks at the values in fields.
46411  */
46412 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
46413
46414 /**
46415  * Frees any resources used by the ParseOrSemanticError
46416  */
46417 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
46418
46419 /**
46420  * Creates a copy of the ParseOrSemanticError
46421  */
46422 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
46423
46424 /**
46425  * Utility method to constructs a new ParseError-variant ParseOrSemanticError
46426  */
46427 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
46428
46429 /**
46430  * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
46431  */
46432 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
46433
46434 /**
46435  * Checks if two ParseOrSemanticErrors contain equal inner contents.
46436  * This ignores pointers and is_owned flags and looks at the values in fields.
46437  */
46438 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
46439
46440 /**
46441  * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
46442  */
46443 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
46444
46445 /**
46446  * Checks if two Bolt11Invoices contain equal inner contents.
46447  * This ignores pointers and is_owned flags and looks at the values in fields.
46448  * Two objects with NULL inner values will be considered "equal" here.
46449  */
46450 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
46451
46452 /**
46453  * Creates a copy of the Bolt11Invoice
46454  */
46455 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
46456
46457 /**
46458  * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
46459  */
46460 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
46461
46462 /**
46463  * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
46464  */
46465 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
46466
46467 /**
46468  * Checks if two SignedRawBolt11Invoices contain equal inner contents.
46469  * This ignores pointers and is_owned flags and looks at the values in fields.
46470  * Two objects with NULL inner values will be considered "equal" here.
46471  */
46472 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
46473
46474 /**
46475  * Creates a copy of the SignedRawBolt11Invoice
46476  */
46477 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
46478
46479 /**
46480  * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
46481  */
46482 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
46483
46484 /**
46485  * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
46486  */
46487 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
46488
46489 /**
46490  * data part
46491  */
46492 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
46493
46494 /**
46495  * data part
46496  */
46497 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
46498
46499 /**
46500  * Checks if two RawBolt11Invoices contain equal inner contents.
46501  * This ignores pointers and is_owned flags and looks at the values in fields.
46502  * Two objects with NULL inner values will be considered "equal" here.
46503  */
46504 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
46505
46506 /**
46507  * Creates a copy of the RawBolt11Invoice
46508  */
46509 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
46510
46511 /**
46512  * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
46513  */
46514 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
46515
46516 /**
46517  * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
46518  */
46519 void RawDataPart_free(struct LDKRawDataPart this_obj);
46520
46521 /**
46522  * generation time of the invoice
46523  */
46524 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
46525
46526 /**
46527  * generation time of the invoice
46528  */
46529 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
46530
46531 /**
46532  * Checks if two RawDataParts contain equal inner contents.
46533  * This ignores pointers and is_owned flags and looks at the values in fields.
46534  * Two objects with NULL inner values will be considered "equal" here.
46535  */
46536 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
46537
46538 /**
46539  * Creates a copy of the RawDataPart
46540  */
46541 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
46542
46543 /**
46544  * Generates a non-cryptographic 64-bit hash of the RawDataPart.
46545  */
46546 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
46547
46548 /**
46549  * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
46550  */
46551 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
46552
46553 /**
46554  * Checks if two PositiveTimestamps contain equal inner contents.
46555  * This ignores pointers and is_owned flags and looks at the values in fields.
46556  * Two objects with NULL inner values will be considered "equal" here.
46557  */
46558 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
46559
46560 /**
46561  * Creates a copy of the PositiveTimestamp
46562  */
46563 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
46564
46565 /**
46566  * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
46567  */
46568 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
46569
46570 /**
46571  * Creates a copy of the SiPrefix
46572  */
46573 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
46574
46575 /**
46576  * Utility method to constructs a new Milli-variant SiPrefix
46577  */
46578 enum LDKSiPrefix SiPrefix_milli(void);
46579
46580 /**
46581  * Utility method to constructs a new Micro-variant SiPrefix
46582  */
46583 enum LDKSiPrefix SiPrefix_micro(void);
46584
46585 /**
46586  * Utility method to constructs a new Nano-variant SiPrefix
46587  */
46588 enum LDKSiPrefix SiPrefix_nano(void);
46589
46590 /**
46591  * Utility method to constructs a new Pico-variant SiPrefix
46592  */
46593 enum LDKSiPrefix SiPrefix_pico(void);
46594
46595 /**
46596  * Checks if two SiPrefixs contain equal inner contents.
46597  * This ignores pointers and is_owned flags and looks at the values in fields.
46598  */
46599 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
46600
46601 /**
46602  * Generates a non-cryptographic 64-bit hash of the SiPrefix.
46603  */
46604 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
46605
46606 /**
46607  * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
46608  * This is effectively 10^12 * the prefix multiplier
46609  */
46610 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
46611
46612 /**
46613  * Creates a copy of the Currency
46614  */
46615 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
46616
46617 /**
46618  * Utility method to constructs a new Bitcoin-variant Currency
46619  */
46620 enum LDKCurrency Currency_bitcoin(void);
46621
46622 /**
46623  * Utility method to constructs a new BitcoinTestnet-variant Currency
46624  */
46625 enum LDKCurrency Currency_bitcoin_testnet(void);
46626
46627 /**
46628  * Utility method to constructs a new Regtest-variant Currency
46629  */
46630 enum LDKCurrency Currency_regtest(void);
46631
46632 /**
46633  * Utility method to constructs a new Simnet-variant Currency
46634  */
46635 enum LDKCurrency Currency_simnet(void);
46636
46637 /**
46638  * Utility method to constructs a new Signet-variant Currency
46639  */
46640 enum LDKCurrency Currency_signet(void);
46641
46642 /**
46643  * Generates a non-cryptographic 64-bit hash of the Currency.
46644  */
46645 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
46646
46647 /**
46648  * Checks if two Currencys contain equal inner contents.
46649  * This ignores pointers and is_owned flags and looks at the values in fields.
46650  */
46651 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
46652
46653 /**
46654  * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
46655  */
46656 void Sha256_free(struct LDKSha256 this_obj);
46657
46658 /**
46659  * Creates a copy of the Sha256
46660  */
46661 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
46662
46663 /**
46664  * Generates a non-cryptographic 64-bit hash of the Sha256.
46665  */
46666 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
46667
46668 /**
46669  * Checks if two Sha256s contain equal inner contents.
46670  * This ignores pointers and is_owned flags and looks at the values in fields.
46671  * Two objects with NULL inner values will be considered "equal" here.
46672  */
46673 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
46674
46675 /**
46676  * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
46677  * single sha256 hash.
46678  */
46679 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
46680
46681 /**
46682  * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
46683  */
46684 void Description_free(struct LDKDescription this_obj);
46685
46686 /**
46687  * Creates a copy of the Description
46688  */
46689 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
46690
46691 /**
46692  * Generates a non-cryptographic 64-bit hash of the Description.
46693  */
46694 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
46695
46696 /**
46697  * Checks if two Descriptions contain equal inner contents.
46698  * This ignores pointers and is_owned flags and looks at the values in fields.
46699  * Two objects with NULL inner values will be considered "equal" here.
46700  */
46701 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
46702
46703 /**
46704  * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
46705  */
46706 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
46707
46708 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
46709
46710 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
46711
46712 /**
46713  * Constructs a new PayeePubKey given each field
46714  */
46715 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
46716
46717 /**
46718  * Creates a copy of the PayeePubKey
46719  */
46720 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
46721
46722 /**
46723  * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
46724  */
46725 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
46726
46727 /**
46728  * Checks if two PayeePubKeys contain equal inner contents.
46729  * This ignores pointers and is_owned flags and looks at the values in fields.
46730  * Two objects with NULL inner values will be considered "equal" here.
46731  */
46732 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
46733
46734 /**
46735  * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
46736  */
46737 void ExpiryTime_free(struct LDKExpiryTime this_obj);
46738
46739 /**
46740  * Creates a copy of the ExpiryTime
46741  */
46742 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
46743
46744 /**
46745  * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
46746  */
46747 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
46748
46749 /**
46750  * Checks if two ExpiryTimes contain equal inner contents.
46751  * This ignores pointers and is_owned flags and looks at the values in fields.
46752  * Two objects with NULL inner values will be considered "equal" here.
46753  */
46754 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
46755
46756 /**
46757  * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
46758  */
46759 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
46760
46761 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
46762
46763 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
46764
46765 /**
46766  * Constructs a new MinFinalCltvExpiryDelta given each field
46767  */
46768 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
46769
46770 /**
46771  * Creates a copy of the MinFinalCltvExpiryDelta
46772  */
46773 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
46774
46775 /**
46776  * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
46777  */
46778 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
46779
46780 /**
46781  * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
46782  * This ignores pointers and is_owned flags and looks at the values in fields.
46783  * Two objects with NULL inner values will be considered "equal" here.
46784  */
46785 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
46786
46787 /**
46788  * Frees any resources used by the Fallback
46789  */
46790 void Fallback_free(struct LDKFallback this_ptr);
46791
46792 /**
46793  * Creates a copy of the Fallback
46794  */
46795 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
46796
46797 /**
46798  * Utility method to constructs a new SegWitProgram-variant Fallback
46799  */
46800 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
46801
46802 /**
46803  * Utility method to constructs a new PubKeyHash-variant Fallback
46804  */
46805 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
46806
46807 /**
46808  * Utility method to constructs a new ScriptHash-variant Fallback
46809  */
46810 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
46811
46812 /**
46813  * Generates a non-cryptographic 64-bit hash of the Fallback.
46814  */
46815 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
46816
46817 /**
46818  * Checks if two Fallbacks contain equal inner contents.
46819  * This ignores pointers and is_owned flags and looks at the values in fields.
46820  */
46821 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
46822
46823 /**
46824  * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
46825  */
46826 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
46827
46828 /**
46829  * Creates a copy of the Bolt11InvoiceSignature
46830  */
46831 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
46832
46833 /**
46834  * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
46835  */
46836 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
46837
46838 /**
46839  * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
46840  * This ignores pointers and is_owned flags and looks at the values in fields.
46841  * Two objects with NULL inner values will be considered "equal" here.
46842  */
46843 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
46844
46845 /**
46846  * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
46847  */
46848 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
46849
46850 /**
46851  * Creates a copy of the PrivateRoute
46852  */
46853 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
46854
46855 /**
46856  * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
46857  */
46858 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
46859
46860 /**
46861  * Checks if two PrivateRoutes contain equal inner contents.
46862  * This ignores pointers and is_owned flags and looks at the values in fields.
46863  * Two objects with NULL inner values will be considered "equal" here.
46864  */
46865 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
46866
46867 /**
46868  * Disassembles the `SignedRawBolt11Invoice` into its three parts:
46869  *  1. raw invoice
46870  *  2. hash of the raw invoice
46871  *  3. signature
46872  */
46873 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
46874
46875 /**
46876  * The [`RawBolt11Invoice`] which was signed.
46877  */
46878 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46879
46880 /**
46881  * The hash of the [`RawBolt11Invoice`] that was signed.
46882  */
46883 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
46884
46885 /**
46886  * Signature for the invoice.
46887  */
46888 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46889
46890 /**
46891  * Recovers the public key used for signing the invoice from the recoverable signature.
46892  */
46893 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46894
46895 /**
46896  * Checks if the signature is valid for the included payee public key or if none exists if it's
46897  * valid for the recovered signature (which should always be true?).
46898  */
46899 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46900
46901 /**
46902  * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
46903  */
46904 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46905
46906 /**
46907  *
46908  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46909  */
46910 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46911
46912 /**
46913  *
46914  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46915  */
46916 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46917
46918 /**
46919  *
46920  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46921  */
46922 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46923
46924 /**
46925  *
46926  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46927  */
46928 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46929
46930 /**
46931  *
46932  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46933  */
46934 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46935
46936 /**
46937  *
46938  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46939  */
46940 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46941
46942 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46943
46944 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46945
46946 /**
46947  *
46948  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46949  */
46950 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46951
46952 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46953
46954 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46955
46956 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46957
46958 /**
46959  * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
46960  *
46961  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46962  */
46963 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
46964
46965 /**
46966  * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
46967  * the range `0..=MAX_TIMESTAMP`.
46968  *
46969  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
46970  *
46971  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46972  */
46973 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
46974
46975 /**
46976  * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
46977  * `0..=MAX_TIMESTAMP`.
46978  *
46979  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
46980  *
46981  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46982  */
46983 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
46984
46985 /**
46986  * Returns the Unix timestamp representing the stored time
46987  */
46988 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46989
46990 /**
46991  * Returns the duration of the stored time since the Unix epoch
46992  */
46993 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46994
46995 /**
46996  * Returns the [`SystemTime`] representing the stored time
46997  */
46998 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46999
47000 /**
47001  * The hash of the [`RawBolt11Invoice`] that was signed.
47002  */
47003 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47004
47005 /**
47006  * Transform the `Bolt11Invoice` into its unchecked version.
47007  */
47008 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
47009
47010 /**
47011  * Check that the invoice is signed correctly and that key recovery works
47012  */
47013 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47014
47015 /**
47016  * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
47017  * ```
47018  * use lightning_invoice::*;
47019  *
47020  * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
47021  * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
47022  * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
47023  * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
47024  * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
47025  * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
47026  * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
47027  * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
47028  * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
47029  * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
47030  * j5r6drg6k6zcqj0fcwg\";
47031  *
47032  * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
47033  *
47034  * assert!(Bolt11Invoice::from_signed(signed).is_ok());
47035  * ```
47036  */
47037 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
47038
47039 /**
47040  * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
47041  */
47042 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47043
47044 /**
47045  * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
47046  */
47047 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47048
47049 /**
47050  * Returns the hash to which we will receive the preimage on completion of the payment
47051  */
47052 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
47053
47054 /**
47055  * Get the payee's public key if one was included in the invoice
47056  *
47057  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47058  */
47059 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47060
47061 /**
47062  * Get the payment secret if one was included in the invoice
47063  */
47064 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
47065
47066 /**
47067  * Get the payment metadata blob if one was included in the invoice
47068  */
47069 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47070
47071 /**
47072  * Get the invoice features if they were included in the invoice
47073  *
47074  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47075  */
47076 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47077
47078 /**
47079  * Recover the payee's public key (only to be used if none was included in the invoice)
47080  */
47081 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47082
47083 /**
47084  * Returns the Duration since the Unix epoch at which the invoice expires.
47085  * Returning None if overflow occurred.
47086  */
47087 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47088
47089 /**
47090  * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
47091  */
47092 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47093
47094 /**
47095  * Returns whether the invoice has expired.
47096  */
47097 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47098
47099 /**
47100  * Returns the Duration remaining until the invoice expires.
47101  */
47102 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47103
47104 /**
47105  * Returns the Duration remaining until the invoice expires given the current time.
47106  * `time` is the timestamp as a duration since the Unix epoch.
47107  */
47108 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
47109
47110 /**
47111  * Returns whether the expiry time would pass at the given point in time.
47112  * `at_time` is the timestamp as a duration since the Unix epoch.
47113  */
47114 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
47115
47116 /**
47117  * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
47118  * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
47119  */
47120 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47121
47122 /**
47123  * Returns a list of all fallback addresses as [`Address`]es
47124  */
47125 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47126
47127 /**
47128  * Returns a list of all routes included in the invoice
47129  */
47130 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47131
47132 /**
47133  * Returns a list of all routes included in the invoice as the underlying hints
47134  */
47135 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47136
47137 /**
47138  * Returns the currency for which the invoice was issued
47139  */
47140 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47141
47142 /**
47143  * Returns the amount if specified in the invoice as millisatoshis.
47144  */
47145 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47146
47147 /**
47148  * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
47149  * returns [`CreationError::DescriptionTooLong`] otherwise
47150  *
47151  * Please note that single characters may use more than one byte due to UTF8 encoding.
47152  */
47153 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
47154
47155 /**
47156  * Returns the underlying description [`String`]
47157  */
47158 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
47159
47160 /**
47161  * Construct an `ExpiryTime` from seconds.
47162  */
47163 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
47164
47165 /**
47166  * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
47167  */
47168 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
47169
47170 /**
47171  * Returns the expiry time in seconds
47172  */
47173 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
47174
47175 /**
47176  * Returns a reference to the underlying [`Duration`] (=expiry time)
47177  */
47178 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
47179
47180 /**
47181  * Creates a new (partial) route from a list of hops
47182  */
47183 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
47184
47185 /**
47186  * Returns the underlying list of hops
47187  */
47188 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
47189
47190 /**
47191  * Creates a copy of the CreationError
47192  */
47193 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
47194
47195 /**
47196  * Utility method to constructs a new DescriptionTooLong-variant CreationError
47197  */
47198 enum LDKCreationError CreationError_description_too_long(void);
47199
47200 /**
47201  * Utility method to constructs a new RouteTooLong-variant CreationError
47202  */
47203 enum LDKCreationError CreationError_route_too_long(void);
47204
47205 /**
47206  * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
47207  */
47208 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
47209
47210 /**
47211  * Utility method to constructs a new InvalidAmount-variant CreationError
47212  */
47213 enum LDKCreationError CreationError_invalid_amount(void);
47214
47215 /**
47216  * Utility method to constructs a new MissingRouteHints-variant CreationError
47217  */
47218 enum LDKCreationError CreationError_missing_route_hints(void);
47219
47220 /**
47221  * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
47222  */
47223 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
47224
47225 /**
47226  * Checks if two CreationErrors contain equal inner contents.
47227  * This ignores pointers and is_owned flags and looks at the values in fields.
47228  */
47229 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
47230
47231 /**
47232  * Get the string representation of a CreationError object
47233  */
47234 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
47235
47236 /**
47237  * Creates a copy of the Bolt11SemanticError
47238  */
47239 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
47240
47241 /**
47242  * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
47243  */
47244 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
47245
47246 /**
47247  * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
47248  */
47249 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
47250
47251 /**
47252  * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
47253  */
47254 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
47255
47256 /**
47257  * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
47258  */
47259 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
47260
47261 /**
47262  * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
47263  */
47264 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
47265
47266 /**
47267  * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
47268  */
47269 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
47270
47271 /**
47272  * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
47273  */
47274 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
47275
47276 /**
47277  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
47278  */
47279 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
47280
47281 /**
47282  * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
47283  */
47284 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
47285
47286 /**
47287  * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
47288  */
47289 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
47290
47291 /**
47292  * Checks if two Bolt11SemanticErrors contain equal inner contents.
47293  * This ignores pointers and is_owned flags and looks at the values in fields.
47294  */
47295 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
47296
47297 /**
47298  * Get the string representation of a Bolt11SemanticError object
47299  */
47300 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
47301
47302 /**
47303  * Frees any resources used by the SignOrCreationError
47304  */
47305 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
47306
47307 /**
47308  * Creates a copy of the SignOrCreationError
47309  */
47310 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
47311
47312 /**
47313  * Utility method to constructs a new SignError-variant SignOrCreationError
47314  */
47315 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
47316
47317 /**
47318  * Utility method to constructs a new CreationError-variant SignOrCreationError
47319  */
47320 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
47321
47322 /**
47323  * Checks if two SignOrCreationErrors contain equal inner contents.
47324  * This ignores pointers and is_owned flags and looks at the values in fields.
47325  */
47326 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
47327
47328 /**
47329  * Get the string representation of a SignOrCreationError object
47330  */
47331 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
47332
47333 /**
47334  * Pays the given [`Bolt11Invoice`], retrying if needed based on [`Retry`].
47335  *
47336  * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
47337  * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
47338  * with the same [`PaymentHash`] is never sent.
47339  *
47340  * If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`].
47341  */
47342 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ pay_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
47343
47344 /**
47345  * Pays the given [`Bolt11Invoice`] with a custom idempotency key, retrying if needed based on
47346  * [`Retry`].
47347  *
47348  * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
47349  * payment completes or fails, no idempotency guarantees are made.
47350  *
47351  * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
47352  * [`PaymentHash`] has never been paid before.
47353  *
47354  * See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token.
47355  */
47356 struct LDKCResult_NonePaymentErrorZ pay_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
47357
47358 /**
47359  * Pays the given zero-value [`Bolt11Invoice`] using the given amount, retrying if needed based on
47360  * [`Retry`].
47361  *
47362  * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
47363  * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
47364  * with the same [`PaymentHash`] is never sent.
47365  *
47366  * If you wish to use a different payment idempotency token, see
47367  * [`pay_zero_value_invoice_with_id`].
47368  */
47369 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ pay_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
47370
47371 /**
47372  * Pays the given zero-value [`Bolt11Invoice`] using the given amount and custom idempotency key,
47373  * retrying if needed based on [`Retry`].
47374  *
47375  * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
47376  * payment completes or fails, no idempotency guarantees are made.
47377  *
47378  * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
47379  * [`PaymentHash`] has never been paid before.
47380  *
47381  * See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
47382  * idempotency token.
47383  */
47384 struct LDKCResult_NonePaymentErrorZ pay_zero_value_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
47385
47386 /**
47387  * Sends payment probes over all paths of a route that would be used to pay the given invoice.
47388  *
47389  * See [`ChannelManager::send_preflight_probes`] for more information.
47390  */
47391 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ preflight_probe_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z liquidity_limit_multiplier);
47392
47393 /**
47394  * Sends payment probes over all paths of a route that would be used to pay the given zero-value
47395  * invoice using the given amount.
47396  *
47397  * See [`ChannelManager::send_preflight_probes`] for more information.
47398  */
47399 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ preflight_probe_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat, const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z liquidity_limit_multiplier);
47400
47401 /**
47402  * Frees any resources used by the PaymentError
47403  */
47404 void PaymentError_free(struct LDKPaymentError this_ptr);
47405
47406 /**
47407  * Creates a copy of the PaymentError
47408  */
47409 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
47410
47411 /**
47412  * Utility method to constructs a new Invoice-variant PaymentError
47413  */
47414 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
47415
47416 /**
47417  * Utility method to constructs a new Sending-variant PaymentError
47418  */
47419 struct LDKPaymentError PaymentError_sending(enum LDKRetryableSendFailure a);
47420
47421 /**
47422  * Checks if two PaymentErrors contain equal inner contents.
47423  * This ignores pointers and is_owned flags and looks at the values in fields.
47424  */
47425 bool PaymentError_eq(const struct LDKPaymentError *NONNULL_PTR a, const struct LDKPaymentError *NONNULL_PTR b);
47426
47427 /**
47428  * Frees any resources used by the ProbingError
47429  */
47430 void ProbingError_free(struct LDKProbingError this_ptr);
47431
47432 /**
47433  * Creates a copy of the ProbingError
47434  */
47435 struct LDKProbingError ProbingError_clone(const struct LDKProbingError *NONNULL_PTR orig);
47436
47437 /**
47438  * Utility method to constructs a new Invoice-variant ProbingError
47439  */
47440 struct LDKProbingError ProbingError_invoice(struct LDKStr a);
47441
47442 /**
47443  * Utility method to constructs a new Sending-variant ProbingError
47444  */
47445 struct LDKProbingError ProbingError_sending(struct LDKProbeSendFailure a);
47446
47447 /**
47448  * Checks if two ProbingErrors contain equal inner contents.
47449  * This ignores pointers and is_owned flags and looks at the values in fields.
47450  */
47451 bool ProbingError_eq(const struct LDKProbingError *NONNULL_PTR a, const struct LDKProbingError *NONNULL_PTR b);
47452
47453 /**
47454  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
47455  * See [`PhantomKeysManager`] for more information on phantom node payments.
47456  *
47457  * `phantom_route_hints` parameter:
47458  * * Contains channel info for all nodes participating in the phantom invoice
47459  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
47460  *   participating node
47461  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
47462  *   updated when a channel becomes disabled or closes
47463  * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
47464  *   may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
47465  *   down
47466  *
47467  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
47468  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
47469  * If `None` is provided for `payment_hash`, then one will be created.
47470  *
47471  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
47472  * in excess of the current time.
47473  *
47474  * `duration_since_epoch` is the current time since epoch in seconds.
47475  *
47476  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
47477  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
47478  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
47479  * confirmations during routing.
47480  *
47481  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
47482  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
47483  * requirement).
47484  *
47485  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
47486  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
47487  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
47488  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
47489  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
47490  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
47491  *
47492  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
47493  * available and the current time is supplied by the caller.
47494  */
47495 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
47496
47497 /**
47498  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
47499  * See [`PhantomKeysManager`] for more information on phantom node payments.
47500  *
47501  * `phantom_route_hints` parameter:
47502  * * Contains channel info for all nodes participating in the phantom invoice
47503  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
47504  *   participating node
47505  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
47506  *   updated when a channel becomes disabled or closes
47507  * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
47508  *   of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
47509  *   in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
47510  *   until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
47511  *   desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
47512  *
47513  * `description_hash` is a SHA-256 hash of the description text
47514  *
47515  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
47516  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
47517  * If `None` is provided for `payment_hash`, then one will be created.
47518  *
47519  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
47520  * in excess of the current time.
47521  *
47522  * `duration_since_epoch` is the current time since epoch in seconds.
47523  *
47524  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
47525  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
47526  * requirement).
47527  *
47528  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
47529  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
47530  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
47531  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
47532  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
47533  *
47534  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
47535  * available and the current time is supplied by the caller.
47536  */
47537 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
47538
47539 /**
47540  * Utility to construct an invoice. Generally, unless you want to do something like a custom
47541  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
47542  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
47543  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
47544  * that the payment secret is valid when the invoice is paid.
47545  *
47546  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
47547  * in excess of the current time.
47548  *
47549  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
47550  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
47551  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
47552  * confirmations during routing.
47553  *
47554  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
47555  */
47556 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
47557
47558 /**
47559  * Utility to construct an invoice. Generally, unless you want to do something like a custom
47560  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
47561  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
47562  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
47563  * that the payment secret is valid when the invoice is paid.
47564  * Use this variant if you want to pass the `description_hash` to the invoice.
47565  *
47566  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
47567  * in excess of the current time.
47568  *
47569  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
47570  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
47571  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
47572  * confirmations during routing.
47573  *
47574  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
47575  */
47576 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
47577
47578 /**
47579  * See [`create_invoice_from_channelmanager_with_description_hash`]
47580  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
47581  * available and the current time is supplied by the caller.
47582  */
47583 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
47584
47585 /**
47586  * See [`create_invoice_from_channelmanager`]
47587  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
47588  * available and the current time is supplied by the caller.
47589  */
47590 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
47591
47592 /**
47593  * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
47594  * This version allows for providing a custom [`PaymentHash`] for the invoice.
47595  * This may be useful if you're building an on-chain swap or involving another protocol where
47596  * the payment hash is also involved outside the scope of lightning.
47597  */
47598 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
47599
47600 /**
47601  * Read a SiPrefix object from a string
47602  */
47603 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
47604
47605 /**
47606  * Read a Bolt11Invoice object from a string
47607  */
47608 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
47609
47610 /**
47611  * Read a SignedRawBolt11Invoice object from a string
47612  */
47613 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
47614
47615 /**
47616  * Get the string representation of a Bolt11ParseError object
47617  */
47618 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
47619
47620 /**
47621  * Get the string representation of a ParseOrSemanticError object
47622  */
47623 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
47624
47625 /**
47626  * Get the string representation of a Bolt11Invoice object
47627  */
47628 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
47629
47630 /**
47631  * Get the string representation of a SignedRawBolt11Invoice object
47632  */
47633 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
47634
47635 /**
47636  * Get the string representation of a Currency object
47637  */
47638 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
47639
47640 /**
47641  * Get the string representation of a SiPrefix object
47642  */
47643 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
47644
47645 /**
47646  * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
47647  */
47648 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
47649
47650 /**
47651  * Instantiate a new [`RapidGossipSync`] instance.
47652  */
47653 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
47654
47655 /**
47656  * Sync gossip data from a file.
47657  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47658  *
47659  * `network_graph`: The network graph to apply the updates to
47660  *
47661  * `sync_path`: Path to the file where the gossip update data is located
47662  *
47663  */
47664 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
47665
47666 /**
47667  * Update network graph from binary data.
47668  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47669  *
47670  * `update_data`: `&[u8]` binary stream that comprises the update data
47671  */
47672 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
47673
47674 /**
47675  * Update network graph from binary data.
47676  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47677  *
47678  * `update_data`: `&[u8]` binary stream that comprises the update data
47679  * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
47680  */
47681 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph_no_std(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data, struct LDKCOption_u64Z current_time_unix);
47682
47683 /**
47684  * Returns whether a rapid gossip sync has completed at least once.
47685  */
47686 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
47687
47688 /**
47689  * Frees any resources used by the GraphSyncError
47690  */
47691 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
47692
47693 /**
47694  * Creates a copy of the GraphSyncError
47695  */
47696 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
47697
47698 /**
47699  * Utility method to constructs a new DecodeError-variant GraphSyncError
47700  */
47701 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
47702
47703 /**
47704  * Utility method to constructs a new LightningError-variant GraphSyncError
47705  */
47706 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
47707
47708 #endif /* LDK_C_BINDINGS_H */
47709
47710 #include "ldk_ver.h"