Update auto-generated bindings to LDK 0.0.121
[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  * Whether this blinded HTLC is being failed backwards by the introduction node or a blinded node,
15  * which determines the failure message that should be used.
16  */
17 typedef enum LDKBlindedFailure {
18    /**
19     * This HTLC is being failed backwards by the introduction node, and thus should be failed with
20     * [`msgs::UpdateFailHTLC`] and error code `0x8000|0x4000|24`.
21     */
22    LDKBlindedFailure_FromIntroductionNode,
23    /**
24     * This HTLC is being failed backwards by a blinded node within the path, and thus should be
25     * failed with [`msgs::UpdateFailMalformedHTLC`] and error code `0x8000|0x4000|24`.
26     */
27    LDKBlindedFailure_FromBlindedNode,
28    /**
29     * Must be last for serialization purposes
30     */
31    LDKBlindedFailure_Sentinel,
32 } LDKBlindedFailure;
33
34 /**
35  * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
36  * the requirements sections in BOLT #11
37  */
38 typedef enum LDKBolt11SemanticError {
39    /**
40     * The invoice is missing the mandatory payment hash
41     */
42    LDKBolt11SemanticError_NoPaymentHash,
43    /**
44     * The invoice has multiple payment hashes which isn't allowed
45     */
46    LDKBolt11SemanticError_MultiplePaymentHashes,
47    /**
48     * No description or description hash are part of the invoice
49     */
50    LDKBolt11SemanticError_NoDescription,
51    /**
52     * The invoice contains multiple descriptions and/or description hashes which isn't allowed
53     */
54    LDKBolt11SemanticError_MultipleDescriptions,
55    /**
56     * The invoice is missing the mandatory payment secret, which all modern lightning nodes
57     * should provide.
58     */
59    LDKBolt11SemanticError_NoPaymentSecret,
60    /**
61     * The invoice contains multiple payment secrets
62     */
63    LDKBolt11SemanticError_MultiplePaymentSecrets,
64    /**
65     * The invoice's features are invalid
66     */
67    LDKBolt11SemanticError_InvalidFeatures,
68    /**
69     * The recovery id doesn't fit the signature/pub key
70     */
71    LDKBolt11SemanticError_InvalidRecoveryId,
72    /**
73     * The invoice's signature is invalid
74     */
75    LDKBolt11SemanticError_InvalidSignature,
76    /**
77     * The invoice's amount was not a whole number of millisatoshis
78     */
79    LDKBolt11SemanticError_ImpreciseAmount,
80    /**
81     * Must be last for serialization purposes
82     */
83    LDKBolt11SemanticError_Sentinel,
84 } LDKBolt11SemanticError;
85
86 /**
87  * Error when interpreting a TLV stream as a specific type.
88  */
89 typedef enum LDKBolt12SemanticError {
90    /**
91     * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
92     */
93    LDKBolt12SemanticError_AlreadyExpired,
94    /**
95     * The provided chain hash does not correspond to a supported chain.
96     */
97    LDKBolt12SemanticError_UnsupportedChain,
98    /**
99     * A chain was provided but was not expected.
100     */
101    LDKBolt12SemanticError_UnexpectedChain,
102    /**
103     * An amount was expected but was missing.
104     */
105    LDKBolt12SemanticError_MissingAmount,
106    /**
107     * The amount exceeded the total bitcoin supply.
108     */
109    LDKBolt12SemanticError_InvalidAmount,
110    /**
111     * An amount was provided but was not sufficient in value.
112     */
113    LDKBolt12SemanticError_InsufficientAmount,
114    /**
115     * An amount was provided but was not expected.
116     */
117    LDKBolt12SemanticError_UnexpectedAmount,
118    /**
119     * A currency was provided that is not supported.
120     */
121    LDKBolt12SemanticError_UnsupportedCurrency,
122    /**
123     * A feature was required but is unknown.
124     */
125    LDKBolt12SemanticError_UnknownRequiredFeatures,
126    /**
127     * Features were provided but were not expected.
128     */
129    LDKBolt12SemanticError_UnexpectedFeatures,
130    /**
131     * A required description was not provided.
132     */
133    LDKBolt12SemanticError_MissingDescription,
134    /**
135     * A signing pubkey was not provided.
136     */
137    LDKBolt12SemanticError_MissingSigningPubkey,
138    /**
139     * A signing pubkey was provided but a different one was expected.
140     */
141    LDKBolt12SemanticError_InvalidSigningPubkey,
142    /**
143     * A signing pubkey was provided but was not expected.
144     */
145    LDKBolt12SemanticError_UnexpectedSigningPubkey,
146    /**
147     * A quantity was expected but was missing.
148     */
149    LDKBolt12SemanticError_MissingQuantity,
150    /**
151     * An unsupported quantity was provided.
152     */
153    LDKBolt12SemanticError_InvalidQuantity,
154    /**
155     * A quantity or quantity bounds was provided but was not expected.
156     */
157    LDKBolt12SemanticError_UnexpectedQuantity,
158    /**
159     * Metadata could not be used to verify the offers message.
160     */
161    LDKBolt12SemanticError_InvalidMetadata,
162    /**
163     * Metadata was provided but was not expected.
164     */
165    LDKBolt12SemanticError_UnexpectedMetadata,
166    /**
167     * Payer metadata was expected but was missing.
168     */
169    LDKBolt12SemanticError_MissingPayerMetadata,
170    /**
171     * A payer id was expected but was missing.
172     */
173    LDKBolt12SemanticError_MissingPayerId,
174    /**
175     * The payment id for a refund or request is already in use.
176     */
177    LDKBolt12SemanticError_DuplicatePaymentId,
178    /**
179     * Blinded paths were expected but were missing.
180     */
181    LDKBolt12SemanticError_MissingPaths,
182    /**
183     * The blinded payinfo given does not match the number of blinded path hops.
184     */
185    LDKBolt12SemanticError_InvalidPayInfo,
186    /**
187     * An invoice creation time was expected but was missing.
188     */
189    LDKBolt12SemanticError_MissingCreationTime,
190    /**
191     * An invoice payment hash was expected but was missing.
192     */
193    LDKBolt12SemanticError_MissingPaymentHash,
194    /**
195     * A signature was expected but was missing.
196     */
197    LDKBolt12SemanticError_MissingSignature,
198    /**
199     * Must be last for serialization purposes
200     */
201    LDKBolt12SemanticError_Sentinel,
202 } LDKBolt12SemanticError;
203
204 /**
205  * An enum which can either contain a  or not
206  */
207 typedef enum LDKCOption_NoneZ {
208    /**
209     * When we're in this state, this COption_NoneZ contains a
210     */
211    LDKCOption_NoneZ_Some,
212    /**
213     * When we're in this state, this COption_NoneZ contains nothing
214     */
215    LDKCOption_NoneZ_None,
216    /**
217     * Must be last for serialization purposes
218     */
219    LDKCOption_NoneZ_Sentinel,
220 } LDKCOption_NoneZ;
221
222 /**
223  * An enum representing the status of a channel monitor update persistence.
224  *
225  * These are generally used as the return value for an implementation of [`Persist`] which is used
226  * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
227  * explanation of how to handle different cases.
228  *
229  * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
230  * calling side, and generally results in an immediate panic. For those who prefer to avoid
231  * panics, `InProgress` can be used and you can retry the update operation in the background or
232  * shut down cleanly.
233  *
234  * Note that channels should generally *not* be force-closed after a persistence failure.
235  * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
236  * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
237  * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
238  * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
239  *
240  * [`Persist`]: chainmonitor::Persist
241  * [`ChainMonitor`]: chainmonitor::ChainMonitor
242  * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
243  */
244 typedef enum LDKChannelMonitorUpdateStatus {
245    /**
246     * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
247     * have been updated.
248     *
249     * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
250     * be available on restart even if the application crashes.
251     */
252    LDKChannelMonitorUpdateStatus_Completed,
253    /**
254     * Indicates that the update will happen asynchronously in the background or that a transient
255     * failure occurred which is being retried in the background and will eventually complete.
256     *
257     * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
258     * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
259     * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
260     * operational state.
261     *
262     * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
263     * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
264     * attempting to claim it on this channel) and those updates must still be persisted.
265     *
266     * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
267     * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
268     * monitor update for the same channel.
269     *
270     * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
271     * a remote location (with local copies persisted immediately), it is anticipated that all
272     * updates will return [`InProgress`] until the remote copies could be updated.
273     *
274     * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
275     * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
276     * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
277     *
278     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
279     */
280    LDKChannelMonitorUpdateStatus_InProgress,
281    /**
282     * Indicates that an update has failed and will not complete at any point in the future.
283     *
284     * Currently returning this variant will cause LDK to immediately panic to encourage immediate
285     * shutdown. In the future this may be updated to disconnect peers and refuse to continue
286     * normal operation without a panic.
287     *
288     * Applications which wish to perform an orderly shutdown after failure should consider
289     * returning [`InProgress`] instead and simply shut down without ever marking the update
290     * complete.
291     *
292     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
293     */
294    LDKChannelMonitorUpdateStatus_UnrecoverableError,
295    /**
296     * Must be last for serialization purposes
297     */
298    LDKChannelMonitorUpdateStatus_Sentinel,
299 } LDKChannelMonitorUpdateStatus;
300
301 /**
302  * Further information on the details of the channel shutdown.
303  * Upon channels being forced closed (i.e. commitment transaction confirmation detected
304  * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
305  * the channel will be removed shortly.
306  * Also note, that in normal operation, peers could disconnect at any of these states
307  * and require peer re-connection before making progress onto other states
308  */
309 typedef enum LDKChannelShutdownState {
310    /**
311     * Channel has not sent or received a shutdown message.
312     */
313    LDKChannelShutdownState_NotShuttingDown,
314    /**
315     * Local node has sent a shutdown message for this channel.
316     */
317    LDKChannelShutdownState_ShutdownInitiated,
318    /**
319     * Shutdown message exchanges have concluded and the channels are in the midst of
320     * resolving all existing open HTLCs before closing can continue.
321     */
322    LDKChannelShutdownState_ResolvingHTLCs,
323    /**
324     * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
325     */
326    LDKChannelShutdownState_NegotiatingClosingFee,
327    /**
328     * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
329     * to drop the channel.
330     */
331    LDKChannelShutdownState_ShutdownComplete,
332    /**
333     * Must be last for serialization purposes
334     */
335    LDKChannelShutdownState_Sentinel,
336 } LDKChannelShutdownState;
337
338 /**
339  * An enum that represents the priority at which we want a transaction to confirm used for feerate
340  * estimation.
341  */
342 typedef enum LDKConfirmationTarget {
343    /**
344     * We have some funds available on chain which we need to spend prior to some expiry time at
345     * which point our counterparty may be able to steal them. Generally we have in the high tens
346     * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a
347     * fee - this should be a relatively high priority feerate.
348     */
349    LDKConfirmationTarget_OnChainSweep,
350    /**
351     * This is the lowest feerate we will allow our channel counterparty to have in an anchor
352     * channel in order to close the channel if a channel party goes away.
353     *
354     * This needs to be sufficient to get into the mempool when the channel needs to
355     * be force-closed. Setting too high may result in force-closures if our counterparty attempts
356     * to use a lower feerate. Because this is for anchor channels, we can always bump the feerate
357     * later; the feerate here only needs to be sufficient to enter the mempool.
358     *
359     * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
360     * is not an estimate which is very easy to calculate because we do not know the future. Using
361     * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
362     * ensure you can always close the channel. A future change to Bitcoin's P2P network
363     * (package relay) may obviate the need for this entirely.
364     */
365    LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee,
366    /**
367     * The lowest feerate we will allow our channel counterparty to have in a non-anchor channel.
368     *
369     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
370     * order to close the channel if a channel party goes away. Setting this value too high will
371     * cause immediate force-closures in order to avoid having an unbroadcastable state.
372     *
373     * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
374     * arbitrary time in the future. Obviously this is not an estimate which is very easy to
375     * calculate. This can leave channels subject to being unable to close if feerates rise, and in
376     * general you should prefer anchor channels to ensure you can increase the feerate when the
377     * transactions need broadcasting.
378     *
379     * Do note some fee estimators round up to the next full sat/vbyte (ie 250 sats per kw),
380     * causing occasional issues with feerate disagreements between an initiator that wants a
381     * feerate of 1.1 sat/vbyte and a receiver that wants 1.1 rounded up to 2. If your fee
382     * estimator rounds subtracting 250 to your desired feerate here can help avoid this issue.
383     *
384     * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
385     */
386    LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee,
387    /**
388     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
389     * order to close the channel if a channel party goes away.
390     *
391     * This needs to be sufficient to get into the mempool when the channel needs to
392     * be force-closed. Setting too low may result in force-closures. Because this is for anchor
393     * channels, it can be a low value as we can always bump the feerate later.
394     *
395     * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
396     * is not an estimate which is very easy to calculate because we do not know the future. Using
397     * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
398     * ensure you can always close the channel. A future change to Bitcoin's P2P network
399     * (package relay) may obviate the need for this entirely.
400     */
401    LDKConfirmationTarget_AnchorChannelFee,
402    /**
403     * Lightning is built around the ability to broadcast a transaction in the future to close our
404     * channel and claim all pending funds. In order to do so, non-anchor channels are built with
405     * transactions which we need to be able to broadcast at some point in the future.
406     *
407     * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
408     * arbitrary time in the future. Obviously this is not an estimate which is very easy to
409     * calculate, so most lightning nodes use some relatively high-priority feerate using the
410     * current mempool. This leaves channels subject to being unable to close if feerates rise, and
411     * in general you should prefer anchor channels to ensure you can increase the feerate when the
412     * transactions need broadcasting.
413     *
414     * Since this should represent the feerate of a channel close that does not need fee
415     * bumping, this is also used as an upper bound for our attempted feerate when doing cooperative
416     * closure of any channel.
417     */
418    LDKConfirmationTarget_NonAnchorChannelFee,
419    /**
420     * When cooperatively closing a channel, this is the minimum feerate we will accept.
421     * Recommended at least within a day or so worth of blocks.
422     *
423     * This will also be used when initiating a cooperative close of a channel. When closing a
424     * channel you can override this fee by using
425     * [`ChannelManager::close_channel_with_feerate_and_script`].
426     *
427     * [`ChannelManager::close_channel_with_feerate_and_script`]: crate::ln::channelmanager::ChannelManager::close_channel_with_feerate_and_script
428     */
429    LDKConfirmationTarget_ChannelCloseMinimum,
430    /**
431     * Must be last for serialization purposes
432     */
433    LDKConfirmationTarget_Sentinel,
434 } LDKConfirmationTarget;
435
436 /**
437  * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
438  */
439 typedef enum LDKCreationError {
440    /**
441     * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
442     */
443    LDKCreationError_DescriptionTooLong,
444    /**
445     * The specified route has too many hops and can't be encoded
446     */
447    LDKCreationError_RouteTooLong,
448    /**
449     * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
450     */
451    LDKCreationError_TimestampOutOfBounds,
452    /**
453     * The supplied millisatoshi amount was greater than the total bitcoin supply.
454     */
455    LDKCreationError_InvalidAmount,
456    /**
457     * Route hints were required for this invoice and were missing. Applies to
458     * [phantom invoices].
459     *
460     * [phantom invoices]: crate::utils::create_phantom_invoice
461     */
462    LDKCreationError_MissingRouteHints,
463    /**
464     * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
465     *
466     * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
467     */
468    LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
469    /**
470     * Must be last for serialization purposes
471     */
472    LDKCreationError_Sentinel,
473 } LDKCreationError;
474
475 /**
476  * Enum representing the crypto currencies (or networks) supported by this library
477  */
478 typedef enum LDKCurrency {
479    /**
480     * Bitcoin mainnet
481     */
482    LDKCurrency_Bitcoin,
483    /**
484     * Bitcoin testnet
485     */
486    LDKCurrency_BitcoinTestnet,
487    /**
488     * Bitcoin regtest
489     */
490    LDKCurrency_Regtest,
491    /**
492     * Bitcoin simnet
493     */
494    LDKCurrency_Simnet,
495    /**
496     * Bitcoin signet
497     */
498    LDKCurrency_Signet,
499    /**
500     * Must be last for serialization purposes
501     */
502    LDKCurrency_Sentinel,
503 } LDKCurrency;
504
505 /**
506  * Describes the type of HTLC claim as determined by analyzing the witness.
507  */
508 typedef enum LDKHTLCClaim {
509    /**
510     * Claims an offered output on a commitment transaction through the timeout path.
511     */
512    LDKHTLCClaim_OfferedTimeout,
513    /**
514     * Claims an offered output on a commitment transaction through the success path.
515     */
516    LDKHTLCClaim_OfferedPreimage,
517    /**
518     * Claims an accepted output on a commitment transaction through the timeout path.
519     */
520    LDKHTLCClaim_AcceptedTimeout,
521    /**
522     * Claims an accepted output on a commitment transaction through the success path.
523     */
524    LDKHTLCClaim_AcceptedPreimage,
525    /**
526     * Claims an offered/accepted output on a commitment transaction through the revocation path.
527     */
528    LDKHTLCClaim_Revocation,
529    /**
530     * Must be last for serialization purposes
531     */
532    LDKHTLCClaim_Sentinel,
533 } LDKHTLCClaim;
534
535 /**
536  * Represents an IO Error. Note that some information is lost in the conversion from Rust.
537  */
538 typedef enum LDKIOError {
539    LDKIOError_NotFound,
540    LDKIOError_PermissionDenied,
541    LDKIOError_ConnectionRefused,
542    LDKIOError_ConnectionReset,
543    LDKIOError_ConnectionAborted,
544    LDKIOError_NotConnected,
545    LDKIOError_AddrInUse,
546    LDKIOError_AddrNotAvailable,
547    LDKIOError_BrokenPipe,
548    LDKIOError_AlreadyExists,
549    LDKIOError_WouldBlock,
550    LDKIOError_InvalidInput,
551    LDKIOError_InvalidData,
552    LDKIOError_TimedOut,
553    LDKIOError_WriteZero,
554    LDKIOError_Interrupted,
555    LDKIOError_Other,
556    LDKIOError_UnexpectedEof,
557    /**
558     * Must be last for serialization purposes
559     */
560    LDKIOError_Sentinel,
561 } LDKIOError;
562
563 /**
564  * An enum representing the available verbosity levels of the logger.
565  */
566 typedef enum LDKLevel {
567    /**
568     * Designates extremely verbose information, including gossip-induced messages
569     */
570    LDKLevel_Gossip,
571    /**
572     * Designates very low priority, often extremely verbose, information
573     */
574    LDKLevel_Trace,
575    /**
576     * Designates lower priority information
577     */
578    LDKLevel_Debug,
579    /**
580     * Designates useful information
581     */
582    LDKLevel_Info,
583    /**
584     * Designates hazardous situations
585     */
586    LDKLevel_Warn,
587    /**
588     * Designates very serious errors
589     */
590    LDKLevel_Error,
591    /**
592     * Must be last for serialization purposes
593     */
594    LDKLevel_Sentinel,
595 } LDKLevel;
596
597 /**
598  * An enum representing the possible Bitcoin or test networks which we can run on
599  */
600 typedef enum LDKNetwork {
601    /**
602     * The main Bitcoin blockchain.
603     */
604    LDKNetwork_Bitcoin,
605    /**
606     * The testnet3 blockchain.
607     */
608    LDKNetwork_Testnet,
609    /**
610     * A local test blockchain.
611     */
612    LDKNetwork_Regtest,
613    /**
614     * A blockchain on which blocks are signed instead of mined.
615     */
616    LDKNetwork_Signet,
617    /**
618     * Must be last for serialization purposes
619     */
620    LDKNetwork_Sentinel,
621 } LDKNetwork;
622
623 /**
624  * The reason the payment failed. Used in [`Event::PaymentFailed`].
625  */
626 typedef enum LDKPaymentFailureReason {
627    /**
628     * The intended recipient rejected our payment.
629     */
630    LDKPaymentFailureReason_RecipientRejected,
631    /**
632     * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
633     *
634     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
635     */
636    LDKPaymentFailureReason_UserAbandoned,
637    /**
638     * We exhausted all of our retry attempts while trying to send the payment, or we
639     * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
640     * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
641     * have come before this.
642     *
643     * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
644     */
645    LDKPaymentFailureReason_RetriesExhausted,
646    /**
647     * The payment expired while retrying, based on the provided
648     * [`PaymentParameters::expiry_time`].
649     *
650     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
651     */
652    LDKPaymentFailureReason_PaymentExpired,
653    /**
654     * We failed to find a route while retrying the payment.
655     */
656    LDKPaymentFailureReason_RouteNotFound,
657    /**
658     * This error should generally never happen. This likely means that there is a problem with
659     * your router.
660     */
661    LDKPaymentFailureReason_UnexpectedError,
662    /**
663     * Must be last for serialization purposes
664     */
665    LDKPaymentFailureReason_Sentinel,
666 } LDKPaymentFailureReason;
667
668 /**
669  * Specifies the recipient of an invoice.
670  *
671  * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
672  * the invoice.
673  */
674 typedef enum LDKRecipient {
675    /**
676     * The invoice should be signed with the local node secret key.
677     */
678    LDKRecipient_Node,
679    /**
680     * The invoice should be signed with the phantom node secret key. This secret key must be the
681     * same for all nodes participating in the [phantom node payment].
682     *
683     * [phantom node payment]: PhantomKeysManager
684     */
685    LDKRecipient_PhantomNode,
686    /**
687     * Must be last for serialization purposes
688     */
689    LDKRecipient_Sentinel,
690 } LDKRecipient;
691
692 /**
693  * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
694  * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
695  *
696  * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
697  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
698  * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
699  */
700 typedef enum LDKRetryableSendFailure {
701    /**
702     * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
703     * that this error is *not* caused by [`Retry::Timeout`].
704     *
705     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
706     */
707    LDKRetryableSendFailure_PaymentExpired,
708    /**
709     * We were unable to find a route to the destination.
710     */
711    LDKRetryableSendFailure_RouteNotFound,
712    /**
713     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
714     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
715     *
716     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
717     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
718     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
719     */
720    LDKRetryableSendFailure_DuplicatePayment,
721    /**
722     * Must be last for serialization purposes
723     */
724    LDKRetryableSendFailure_Sentinel,
725 } LDKRetryableSendFailure;
726
727 /**
728  * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
729  */
730 typedef enum LDKSecp256k1Error {
731    /**
732     * Signature failed verification
733     */
734    LDKSecp256k1Error_IncorrectSignature,
735    /**
736     * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
737     */
738    LDKSecp256k1Error_InvalidMessage,
739    /**
740     * Bad public key
741     */
742    LDKSecp256k1Error_InvalidPublicKey,
743    /**
744     * Bad signature
745     */
746    LDKSecp256k1Error_InvalidSignature,
747    /**
748     * Bad secret key
749     */
750    LDKSecp256k1Error_InvalidSecretKey,
751    /**
752     * Bad shared secret.
753     */
754    LDKSecp256k1Error_InvalidSharedSecret,
755    /**
756     * Bad recovery id
757     */
758    LDKSecp256k1Error_InvalidRecoveryId,
759    /**
760     * Invalid tweak for add_assign or mul_assign
761     */
762    LDKSecp256k1Error_InvalidTweak,
763    /**
764     * Didn't pass enough memory to context creation with preallocated memory
765     */
766    LDKSecp256k1Error_NotEnoughMemory,
767    /**
768     * Bad set of public keys.
769     */
770    LDKSecp256k1Error_InvalidPublicKeySum,
771    /**
772     * The only valid parity values are 0 or 1.
773     */
774    LDKSecp256k1Error_InvalidParityValue,
775    /**
776     * Must be last for serialization purposes
777     */
778    LDKSecp256k1Error_Sentinel,
779 } LDKSecp256k1Error;
780
781 /**
782  * SI prefixes for the human readable part
783  */
784 typedef enum LDKSiPrefix {
785    /**
786     * 10^-3
787     */
788    LDKSiPrefix_Milli,
789    /**
790     * 10^-6
791     */
792    LDKSiPrefix_Micro,
793    /**
794     * 10^-9
795     */
796    LDKSiPrefix_Nano,
797    /**
798     * 10^-12
799     */
800    LDKSiPrefix_Pico,
801    /**
802     * Must be last for serialization purposes
803     */
804    LDKSiPrefix_Sentinel,
805 } LDKSiPrefix;
806
807 /**
808  * [`SocketAddress`] error variants
809  */
810 typedef enum LDKSocketAddressParseError {
811    /**
812     * Socket address (IPv4/IPv6) parsing error
813     */
814    LDKSocketAddressParseError_SocketAddrParse,
815    /**
816     * Invalid input format
817     */
818    LDKSocketAddressParseError_InvalidInput,
819    /**
820     * Invalid port
821     */
822    LDKSocketAddressParseError_InvalidPort,
823    /**
824     * Invalid onion v3 address
825     */
826    LDKSocketAddressParseError_InvalidOnionV3,
827    /**
828     * Must be last for serialization purposes
829     */
830    LDKSocketAddressParseError_Sentinel,
831 } LDKSocketAddressParseError;
832
833 /**
834  * An error when accessing the chain via [`UtxoLookup`].
835  */
836 typedef enum LDKUtxoLookupError {
837    /**
838     * The requested chain is unknown.
839     */
840    LDKUtxoLookupError_UnknownChain,
841    /**
842     * The requested transaction doesn't exist or hasn't confirmed.
843     */
844    LDKUtxoLookupError_UnknownTx,
845    /**
846     * Must be last for serialization purposes
847     */
848    LDKUtxoLookupError_Sentinel,
849 } LDKUtxoLookupError;
850
851 /**
852  * A Rust str object, ie a reference to a UTF8-valid string.
853  * This is *not* null-terminated so cannot be used directly as a C string!
854  */
855 typedef struct LDKStr {
856    /**
857     * A pointer to the string's bytes, in UTF8 encoding
858     */
859    const uint8_t *chars;
860    /**
861     * The number of bytes (not characters!) pointed to by `chars`
862     */
863    uintptr_t len;
864    /**
865     * Whether the data pointed to by `chars` should be freed or not.
866     */
867    bool chars_is_owned;
868 } LDKStr;
869
870 /**
871  * A 16-byte byte array.
872  */
873 typedef struct LDKSixteenBytes {
874    /**
875     * The sixteen bytes
876     */
877    uint8_t data[16];
878 } LDKSixteenBytes;
879
880 /**
881  * Unsigned, 128-bit integer.
882  *
883  * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
884  * See https://github.com/rust-lang/rust/issues/54341 for more details.
885  */
886 typedef struct LDKU128 {
887    /**
888     * The 128-bit integer, as 16 little-endian bytes
889     */
890    uint8_t le_bytes[16];
891 } LDKU128;
892
893 /**
894  * Integer in the range `0..=16`
895  */
896 typedef struct LDKWitnessVersion {
897    uint8_t _0;
898 } LDKWitnessVersion;
899
900 /**
901  * A dynamically-allocated array of u8s of arbitrary size.
902  * This corresponds to std::vector in C++
903  */
904 typedef struct LDKCVec_u8Z {
905    /**
906     * The elements in the array.
907     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
908     */
909    uint8_t *data;
910    /**
911     * The number of elements pointed to by `data`.
912     */
913    uintptr_t datalen;
914 } LDKCVec_u8Z;
915
916 /**
917  * A segregated witness version byte and script bytes
918  */
919 typedef struct LDKWitnessProgram {
920    struct LDKWitnessVersion version;
921    struct LDKCVec_u8Z program;
922 } LDKWitnessProgram;
923
924 /**
925  * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
926  * own the memory pointed to by data.
927  */
928 typedef struct LDKu8slice {
929    /**
930     * A pointer to the byte buffer
931     */
932    const uint8_t *data;
933    /**
934     * The number of bytes pointed to by `data`.
935     */
936    uintptr_t datalen;
937 } LDKu8slice;
938
939 /**
940  * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
941  */
942 typedef struct LDKBigEndianScalar {
943    /**
944     * The bytes of the scalar value.
945     */
946    uint8_t big_endian_bytes[32];
947 } LDKBigEndianScalar;
948
949 /**
950  * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
951  * look up the corresponding function in rust-lightning's docs.
952  */
953 typedef struct LDKThirtyTwoBytes {
954    /**
955     * The thirty-two bytes
956     */
957    uint8_t data[32];
958 } LDKThirtyTwoBytes;
959
960 /**
961  * Represents an error returned from the bech32 library during validation of some bech32 data
962  */
963 typedef enum LDKBech32Error_Tag {
964    /**
965     * String does not contain the separator character
966     */
967    LDKBech32Error_MissingSeparator,
968    /**
969     * The checksum does not match the rest of the data
970     */
971    LDKBech32Error_InvalidChecksum,
972    /**
973     * The data or human-readable part is too long or too short
974     */
975    LDKBech32Error_InvalidLength,
976    /**
977     * Some part of the string contains an invalid character
978     */
979    LDKBech32Error_InvalidChar,
980    /**
981     * Some part of the data has an invalid value
982     */
983    LDKBech32Error_InvalidData,
984    /**
985     * The bit conversion failed due to a padding issue
986     */
987    LDKBech32Error_InvalidPadding,
988    /**
989     * The whole string must be of one case
990     */
991    LDKBech32Error_MixedCase,
992    /**
993     * Must be last for serialization purposes
994     */
995    LDKBech32Error_Sentinel,
996 } LDKBech32Error_Tag;
997
998 typedef struct LDKBech32Error {
999    LDKBech32Error_Tag tag;
1000    union {
1001       struct {
1002          uint32_t invalid_char;
1003       };
1004       struct {
1005          uint8_t invalid_data;
1006       };
1007    };
1008 } LDKBech32Error;
1009
1010 /**
1011  * A serialized transaction, in (pointer, length) form.
1012  *
1013  * This type optionally owns its own memory, and thus the semantics around access change based on
1014  * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
1015  * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
1016  * access to the buffer after the scope in which the object was provided to you is invalid. eg,
1017  * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
1018  * you would be invalid.
1019  *
1020  * Note that, while it may change in the future, because transactions on the Rust side are stored
1021  * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
1022  * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
1023  * `data_is_owned` either set or unset at your discretion.
1024  */
1025 typedef struct LDKTransaction {
1026    /**
1027     * The serialized transaction data.
1028     *
1029     * This is non-const for your convenience, an object passed to Rust is never written to.
1030     */
1031    uint8_t *data;
1032    /**
1033     * The length of the serialized transaction
1034     */
1035    uintptr_t datalen;
1036    /**
1037     * Whether the data pointed to by `data` should be freed or not.
1038     */
1039    bool data_is_owned;
1040 } LDKTransaction;
1041
1042 /**
1043  * A serialized witness.
1044  */
1045 typedef struct LDKWitness {
1046    /**
1047     * The serialized transaction data.
1048     *
1049     * This is non-const for your convenience, an object passed to Rust is never written to.
1050     */
1051    uint8_t *data;
1052    /**
1053     * The length of the serialized transaction
1054     */
1055    uintptr_t datalen;
1056    /**
1057     * Whether the data pointed to by `data` should be freed or not.
1058     */
1059    bool data_is_owned;
1060 } LDKWitness;
1061
1062 /**
1063  * An input to a transaction.
1064  *
1065  * This contains the witness, the scriptSig and the previous outpoint and represents a single
1066  * input to a transaction
1067  */
1068 typedef struct LDKTxIn {
1069    /**
1070     * The witness which includes any signatures required to spend a segwit output.
1071     */
1072    struct LDKWitness witness;
1073    /**
1074     * The script_sig which includes signatures requires to spend a pre-segwit output (or a
1075     * P2SH-wrapped segwit output).
1076     */
1077    struct LDKCVec_u8Z script_sig;
1078    /**
1079     * The sequence number of the transaction input
1080     */
1081    uint32_t sequence;
1082    /**
1083     * The txid of the transaction being spent.
1084     */
1085    struct LDKThirtyTwoBytes previous_txid;
1086    /**
1087     * The output index of the transaction being spent.
1088     */
1089    uint32_t previous_vout;
1090 } LDKTxIn;
1091
1092 /**
1093  * A transaction output including a scriptPubKey and value.
1094  * This type *does* own its own memory, so must be free'd appropriately.
1095  */
1096 typedef struct LDKTxOut {
1097    /**
1098     * The script_pubkey in this output
1099     */
1100    struct LDKCVec_u8Z script_pubkey;
1101    /**
1102     * The value, in satoshis, of this output
1103     */
1104    uint64_t value;
1105 } LDKTxOut;
1106
1107 /**
1108  * An enum which can either contain a u64 or not
1109  */
1110 typedef enum LDKCOption_u64Z_Tag {
1111    /**
1112     * When we're in this state, this COption_u64Z contains a u64
1113     */
1114    LDKCOption_u64Z_Some,
1115    /**
1116     * When we're in this state, this COption_u64Z contains nothing
1117     */
1118    LDKCOption_u64Z_None,
1119    /**
1120     * Must be last for serialization purposes
1121     */
1122    LDKCOption_u64Z_Sentinel,
1123 } LDKCOption_u64Z_Tag;
1124
1125 typedef struct LDKCOption_u64Z {
1126    LDKCOption_u64Z_Tag tag;
1127    union {
1128       struct {
1129          uint64_t some;
1130       };
1131    };
1132 } LDKCOption_u64Z;
1133
1134
1135
1136 /**
1137  * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1138  * identity of the recipient.
1139  */
1140 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1141    /**
1142     * A pointer to the opaque Rust object.
1143     * Nearly everywhere, inner must be non-null, however in places where
1144     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1145     */
1146    LDKnativeBlindedPath *inner;
1147    /**
1148     * Indicates that this is the only struct which contains the same pointer.
1149     * Rust functions which take ownership of an object provided via an argument require
1150     * this to be true and invalidate the object pointed to by inner.
1151     */
1152    bool is_owned;
1153 } LDKBlindedPath;
1154
1155 /**
1156  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1157  * This corresponds to std::vector in C++
1158  */
1159 typedef struct LDKCVec_BlindedPathZ {
1160    /**
1161     * The elements in the array.
1162     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1163     */
1164    struct LDKBlindedPath *data;
1165    /**
1166     * The number of elements pointed to by `data`.
1167     */
1168    uintptr_t datalen;
1169 } LDKCVec_BlindedPathZ;
1170
1171
1172
1173 /**
1174  * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1175  *
1176  * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1177  * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1178  * bitcoin ATM.
1179  *
1180  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1181  * [`Offer`]: crate::offers::offer::Offer
1182  */
1183 typedef struct MUST_USE_STRUCT LDKRefund {
1184    /**
1185     * A pointer to the opaque Rust object.
1186     * Nearly everywhere, inner must be non-null, however in places where
1187     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1188     */
1189    LDKnativeRefund *inner;
1190    /**
1191     * Indicates that this is the only struct which contains the same pointer.
1192     * Rust functions which take ownership of an object provided via an argument require
1193     * this to be true and invalidate the object pointed to by inner.
1194     */
1195    bool is_owned;
1196 } LDKRefund;
1197
1198
1199
1200 /**
1201  * Error when parsing a bech32 encoded message using [`str::parse`].
1202  */
1203 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1204    /**
1205     * A pointer to the opaque Rust object.
1206     * Nearly everywhere, inner must be non-null, however in places where
1207     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1208     */
1209    LDKnativeBolt12ParseError *inner;
1210    /**
1211     * Indicates that this is the only struct which contains the same pointer.
1212     * Rust functions which take ownership of an object provided via an argument require
1213     * this to be true and invalidate the object pointed to by inner.
1214     */
1215    bool is_owned;
1216 } LDKBolt12ParseError;
1217
1218 /**
1219  * The contents of CResult_RefundBolt12ParseErrorZ
1220  */
1221 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1222    /**
1223     * A pointer to the contents in the success state.
1224     * Reading from this pointer when `result_ok` is not set is undefined.
1225     */
1226    struct LDKRefund *result;
1227    /**
1228     * A pointer to the contents in the error state.
1229     * Reading from this pointer when `result_ok` is set is undefined.
1230     */
1231    struct LDKBolt12ParseError *err;
1232 } LDKCResult_RefundBolt12ParseErrorZPtr;
1233
1234 /**
1235  * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1236  * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1237  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1238  */
1239 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1240    /**
1241     * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1242     * `err` or `result` depending on the state of `result_ok`.
1243     */
1244    union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1245    /**
1246     * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1247     */
1248    bool result_ok;
1249 } LDKCResult_RefundBolt12ParseErrorZ;
1250
1251 /**
1252  * Strategies available to retry payment path failures.
1253  */
1254 typedef enum LDKRetry_Tag {
1255    /**
1256     * Max number of attempts to retry payment.
1257     *
1258     * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1259     * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1260     * were retried along a route from a single call to [`Router::find_route_with_id`].
1261     */
1262    LDKRetry_Attempts,
1263    /**
1264     * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1265     * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1266     *
1267     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1268     */
1269    LDKRetry_Timeout,
1270    /**
1271     * Must be last for serialization purposes
1272     */
1273    LDKRetry_Sentinel,
1274 } LDKRetry_Tag;
1275
1276 typedef struct MUST_USE_STRUCT LDKRetry {
1277    LDKRetry_Tag tag;
1278    union {
1279       struct {
1280          uint32_t attempts;
1281       };
1282       struct {
1283          uint64_t timeout;
1284       };
1285    };
1286 } LDKRetry;
1287
1288 /**
1289  * An error in decoding a message or struct.
1290  */
1291 typedef enum LDKDecodeError_Tag {
1292    /**
1293     * A version byte specified something we don't know how to handle.
1294     *
1295     * Includes unknown realm byte in an onion hop data packet.
1296     */
1297    LDKDecodeError_UnknownVersion,
1298    /**
1299     * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1300     */
1301    LDKDecodeError_UnknownRequiredFeature,
1302    /**
1303     * Value was invalid.
1304     *
1305     * For example, a byte which was supposed to be a bool was something other than a 0
1306     * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1307     * syntactically incorrect, etc.
1308     */
1309    LDKDecodeError_InvalidValue,
1310    /**
1311     * The buffer to be read was too short.
1312     */
1313    LDKDecodeError_ShortRead,
1314    /**
1315     * A length descriptor in the packet didn't describe the later data correctly.
1316     */
1317    LDKDecodeError_BadLengthDescriptor,
1318    /**
1319     * Error from [`std::io`].
1320     */
1321    LDKDecodeError_Io,
1322    /**
1323     * The message included zlib-compressed values, which we don't support.
1324     */
1325    LDKDecodeError_UnsupportedCompression,
1326    /**
1327     * Must be last for serialization purposes
1328     */
1329    LDKDecodeError_Sentinel,
1330 } LDKDecodeError_Tag;
1331
1332 typedef struct MUST_USE_STRUCT LDKDecodeError {
1333    LDKDecodeError_Tag tag;
1334    union {
1335       struct {
1336          enum LDKIOError io;
1337       };
1338    };
1339 } LDKDecodeError;
1340
1341 /**
1342  * The contents of CResult_RetryDecodeErrorZ
1343  */
1344 typedef union LDKCResult_RetryDecodeErrorZPtr {
1345    /**
1346     * A pointer to the contents in the success state.
1347     * Reading from this pointer when `result_ok` is not set is undefined.
1348     */
1349    struct LDKRetry *result;
1350    /**
1351     * A pointer to the contents in the error state.
1352     * Reading from this pointer when `result_ok` is set is undefined.
1353     */
1354    struct LDKDecodeError *err;
1355 } LDKCResult_RetryDecodeErrorZPtr;
1356
1357 /**
1358  * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1359  * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1360  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1361  */
1362 typedef struct LDKCResult_RetryDecodeErrorZ {
1363    /**
1364     * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1365     * `err` or `result` depending on the state of `result_ok`.
1366     */
1367    union LDKCResult_RetryDecodeErrorZPtr contents;
1368    /**
1369     * Whether this CResult_RetryDecodeErrorZ represents a success state.
1370     */
1371    bool result_ok;
1372 } LDKCResult_RetryDecodeErrorZ;
1373
1374
1375
1376 /**
1377  * A script pubkey for shutting down a channel as defined by [BOLT #2].
1378  *
1379  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1380  */
1381 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1382    /**
1383     * A pointer to the opaque Rust object.
1384     * Nearly everywhere, inner must be non-null, however in places where
1385     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1386     */
1387    LDKnativeShutdownScript *inner;
1388    /**
1389     * Indicates that this is the only struct which contains the same pointer.
1390     * Rust functions which take ownership of an object provided via an argument require
1391     * this to be true and invalidate the object pointed to by inner.
1392     */
1393    bool is_owned;
1394 } LDKShutdownScript;
1395
1396 /**
1397  * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1398  * too-high values)
1399  */
1400 typedef enum LDKAPIError_Tag {
1401    /**
1402     * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1403     * are documented, but generally indicates some precondition of a function was violated.
1404     */
1405    LDKAPIError_APIMisuseError,
1406    /**
1407     * Due to a high feerate, we were unable to complete the request.
1408     * For example, this may be returned if the feerate implies we cannot open a channel at the
1409     * requested value, but opening a larger channel would succeed.
1410     */
1411    LDKAPIError_FeeRateTooHigh,
1412    /**
1413     * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1414     * too-many-hops, etc).
1415     */
1416    LDKAPIError_InvalidRoute,
1417    /**
1418     * We were unable to complete the request as the Channel required to do so is unable to
1419     * complete the request (or was not found). This can take many forms, including disconnected
1420     * peer, channel at capacity, channel shutting down, etc.
1421     */
1422    LDKAPIError_ChannelUnavailable,
1423    /**
1424     * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1425     * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1426     * monitor update is awaiting async resolution. Once it resolves the attempted action should
1427     * complete automatically.
1428     *
1429     * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1430     * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1431     * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1432     */
1433    LDKAPIError_MonitorUpdateInProgress,
1434    /**
1435     * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1436     * with the channel counterparty as negotiated in [`InitFeatures`].
1437     *
1438     * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1439     * a channel or cooperatively close one with this peer (and will have to force-close instead).
1440     *
1441     * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1442     * [`InitFeatures`]: crate::ln::features::InitFeatures
1443     */
1444    LDKAPIError_IncompatibleShutdownScript,
1445    /**
1446     * Must be last for serialization purposes
1447     */
1448    LDKAPIError_Sentinel,
1449 } LDKAPIError_Tag;
1450
1451 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1452    /**
1453     * A human-readable error message
1454     */
1455    struct LDKStr err;
1456 } LDKAPIError_LDKAPIMisuseError_Body;
1457
1458 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1459    /**
1460     * A human-readable error message
1461     */
1462    struct LDKStr err;
1463    /**
1464     * The feerate which was too high.
1465     */
1466    uint32_t feerate;
1467 } LDKAPIError_LDKFeeRateTooHigh_Body;
1468
1469 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1470    /**
1471     * A human-readable error message
1472     */
1473    struct LDKStr err;
1474 } LDKAPIError_LDKInvalidRoute_Body;
1475
1476 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1477    /**
1478     * A human-readable error message
1479     */
1480    struct LDKStr err;
1481 } LDKAPIError_LDKChannelUnavailable_Body;
1482
1483 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1484    /**
1485     * The incompatible shutdown script.
1486     */
1487    struct LDKShutdownScript script;
1488 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1489
1490 typedef struct MUST_USE_STRUCT LDKAPIError {
1491    LDKAPIError_Tag tag;
1492    union {
1493       LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1494       LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1495       LDKAPIError_LDKInvalidRoute_Body invalid_route;
1496       LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1497       LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1498    };
1499 } LDKAPIError;
1500
1501 /**
1502  * The contents of CResult_NoneAPIErrorZ
1503  */
1504 typedef union LDKCResult_NoneAPIErrorZPtr {
1505    /**
1506     * Note that this value is always NULL, as there are no contents in the OK variant
1507     */
1508    void *result;
1509    /**
1510     * A pointer to the contents in the error state.
1511     * Reading from this pointer when `result_ok` is set is undefined.
1512     */
1513    struct LDKAPIError *err;
1514 } LDKCResult_NoneAPIErrorZPtr;
1515
1516 /**
1517  * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1518  * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1519  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1520  */
1521 typedef struct LDKCResult_NoneAPIErrorZ {
1522    /**
1523     * The contents of this CResult_NoneAPIErrorZ, accessible via either
1524     * `err` or `result` depending on the state of `result_ok`.
1525     */
1526    union LDKCResult_NoneAPIErrorZPtr contents;
1527    /**
1528     * Whether this CResult_NoneAPIErrorZ represents a success state.
1529     */
1530    bool result_ok;
1531 } LDKCResult_NoneAPIErrorZ;
1532
1533 /**
1534  * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1535  * This corresponds to std::vector in C++
1536  */
1537 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1538    /**
1539     * The elements in the array.
1540     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1541     */
1542    struct LDKCResult_NoneAPIErrorZ *data;
1543    /**
1544     * The number of elements pointed to by `data`.
1545     */
1546    uintptr_t datalen;
1547 } LDKCVec_CResult_NoneAPIErrorZZ;
1548
1549 /**
1550  * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1551  * This corresponds to std::vector in C++
1552  */
1553 typedef struct LDKCVec_APIErrorZ {
1554    /**
1555     * The elements in the array.
1556     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1557     */
1558    struct LDKAPIError *data;
1559    /**
1560     * The number of elements pointed to by `data`.
1561     */
1562    uintptr_t datalen;
1563 } LDKCVec_APIErrorZ;
1564
1565 /**
1566  * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1567  */
1568 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1569    /**
1570     * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1571     */
1572    LDKCOption_ThirtyTwoBytesZ_Some,
1573    /**
1574     * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1575     */
1576    LDKCOption_ThirtyTwoBytesZ_None,
1577    /**
1578     * Must be last for serialization purposes
1579     */
1580    LDKCOption_ThirtyTwoBytesZ_Sentinel,
1581 } LDKCOption_ThirtyTwoBytesZ_Tag;
1582
1583 typedef struct LDKCOption_ThirtyTwoBytesZ {
1584    LDKCOption_ThirtyTwoBytesZ_Tag tag;
1585    union {
1586       struct {
1587          struct LDKThirtyTwoBytes some;
1588       };
1589    };
1590 } LDKCOption_ThirtyTwoBytesZ;
1591
1592 /**
1593  * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1594  */
1595 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1596    /**
1597     * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1598     */
1599    LDKCOption_CVec_u8ZZ_Some,
1600    /**
1601     * When we're in this state, this COption_CVec_u8ZZ contains nothing
1602     */
1603    LDKCOption_CVec_u8ZZ_None,
1604    /**
1605     * Must be last for serialization purposes
1606     */
1607    LDKCOption_CVec_u8ZZ_Sentinel,
1608 } LDKCOption_CVec_u8ZZ_Tag;
1609
1610 typedef struct LDKCOption_CVec_u8ZZ {
1611    LDKCOption_CVec_u8ZZ_Tag tag;
1612    union {
1613       struct {
1614          struct LDKCVec_u8Z some;
1615       };
1616    };
1617 } LDKCOption_CVec_u8ZZ;
1618
1619
1620
1621 /**
1622  * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1623  *
1624  * This should generally be constructed with data communicated to us from the recipient (via a
1625  * BOLT11 or BOLT12 invoice).
1626  */
1627 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1628    /**
1629     * A pointer to the opaque Rust object.
1630     * Nearly everywhere, inner must be non-null, however in places where
1631     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1632     */
1633    LDKnativeRecipientOnionFields *inner;
1634    /**
1635     * Indicates that this is the only struct which contains the same pointer.
1636     * Rust functions which take ownership of an object provided via an argument require
1637     * this to be true and invalidate the object pointed to by inner.
1638     */
1639    bool is_owned;
1640 } LDKRecipientOnionFields;
1641
1642 /**
1643  * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1644  */
1645 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1646    /**
1647     * A pointer to the contents in the success state.
1648     * Reading from this pointer when `result_ok` is not set is undefined.
1649     */
1650    struct LDKRecipientOnionFields *result;
1651    /**
1652     * A pointer to the contents in the error state.
1653     * Reading from this pointer when `result_ok` is set is undefined.
1654     */
1655    struct LDKDecodeError *err;
1656 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1657
1658 /**
1659  * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1660  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1661  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1662  */
1663 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1664    /**
1665     * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1666     * `err` or `result` depending on the state of `result_ok`.
1667     */
1668    union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1669    /**
1670     * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1671     */
1672    bool result_ok;
1673 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1674
1675 /**
1676  * A tuple of 2 elements. See the individual fields for the types contained.
1677  */
1678 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1679    /**
1680     * The element at position 0
1681     */
1682    uint64_t a;
1683    /**
1684     * The element at position 1
1685     */
1686    struct LDKCVec_u8Z b;
1687 } LDKC2Tuple_u64CVec_u8ZZ;
1688
1689 /**
1690  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1691  * This corresponds to std::vector in C++
1692  */
1693 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1694    /**
1695     * The elements in the array.
1696     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1697     */
1698    struct LDKC2Tuple_u64CVec_u8ZZ *data;
1699    /**
1700     * The number of elements pointed to by `data`.
1701     */
1702    uintptr_t datalen;
1703 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1704
1705 /**
1706  * The contents of CResult_RecipientOnionFieldsNoneZ
1707  */
1708 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1709    /**
1710     * A pointer to the contents in the success state.
1711     * Reading from this pointer when `result_ok` is not set is undefined.
1712     */
1713    struct LDKRecipientOnionFields *result;
1714    /**
1715     * Note that this value is always NULL, as there are no contents in the Err variant
1716     */
1717    void *err;
1718 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1719
1720 /**
1721  * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1722  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1723  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1724  */
1725 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1726    /**
1727     * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1728     * `err` or `result` depending on the state of `result_ok`.
1729     */
1730    union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1731    /**
1732     * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
1733     */
1734    bool result_ok;
1735 } LDKCResult_RecipientOnionFieldsNoneZ;
1736
1737 /**
1738  * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1739  * This corresponds to std::vector in C++
1740  */
1741 typedef struct LDKCVec_ThirtyTwoBytesZ {
1742    /**
1743     * The elements in the array.
1744     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1745     */
1746    struct LDKThirtyTwoBytes *data;
1747    /**
1748     * The number of elements pointed to by `data`.
1749     */
1750    uintptr_t datalen;
1751 } LDKCVec_ThirtyTwoBytesZ;
1752
1753 /**
1754  * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
1755  */
1756 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
1757    /**
1758     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
1759     */
1760    LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
1761    /**
1762     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
1763     */
1764    LDKCOption_CVec_ThirtyTwoBytesZZ_None,
1765    /**
1766     * Must be last for serialization purposes
1767     */
1768    LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
1769 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
1770
1771 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
1772    LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
1773    union {
1774       struct {
1775          struct LDKCVec_ThirtyTwoBytesZ some;
1776       };
1777    };
1778 } LDKCOption_CVec_ThirtyTwoBytesZZ;
1779
1780 /**
1781  * The contents of CResult_ThirtyTwoBytesNoneZ
1782  */
1783 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
1784    /**
1785     * A pointer to the contents in the success state.
1786     * Reading from this pointer when `result_ok` is not set is undefined.
1787     */
1788    struct LDKThirtyTwoBytes *result;
1789    /**
1790     * Note that this value is always NULL, as there are no contents in the Err variant
1791     */
1792    void *err;
1793 } LDKCResult_ThirtyTwoBytesNoneZPtr;
1794
1795 /**
1796  * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
1797  * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
1798  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1799  */
1800 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
1801    /**
1802     * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
1803     * `err` or `result` depending on the state of `result_ok`.
1804     */
1805    union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
1806    /**
1807     * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
1808     */
1809    bool result_ok;
1810 } LDKCResult_ThirtyTwoBytesNoneZ;
1811
1812
1813
1814 /**
1815  * Information needed to route a payment across a [`BlindedPath`].
1816  */
1817 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
1818    /**
1819     * A pointer to the opaque Rust object.
1820     * Nearly everywhere, inner must be non-null, however in places where
1821     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1822     */
1823    LDKnativeBlindedPayInfo *inner;
1824    /**
1825     * Indicates that this is the only struct which contains the same pointer.
1826     * Rust functions which take ownership of an object provided via an argument require
1827     * this to be true and invalidate the object pointed to by inner.
1828     */
1829    bool is_owned;
1830 } LDKBlindedPayInfo;
1831
1832 /**
1833  * The contents of CResult_BlindedPayInfoDecodeErrorZ
1834  */
1835 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
1836    /**
1837     * A pointer to the contents in the success state.
1838     * Reading from this pointer when `result_ok` is not set is undefined.
1839     */
1840    struct LDKBlindedPayInfo *result;
1841    /**
1842     * A pointer to the contents in the error state.
1843     * Reading from this pointer when `result_ok` is set is undefined.
1844     */
1845    struct LDKDecodeError *err;
1846 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
1847
1848 /**
1849  * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
1850  * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
1851  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1852  */
1853 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
1854    /**
1855     * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
1856     * `err` or `result` depending on the state of `result_ok`.
1857     */
1858    union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
1859    /**
1860     * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
1861     */
1862    bool result_ok;
1863 } LDKCResult_BlindedPayInfoDecodeErrorZ;
1864
1865
1866
1867 /**
1868  * Information about a spendable output to a P2WSH script.
1869  *
1870  * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
1871  */
1872 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1873    /**
1874     * A pointer to the opaque Rust object.
1875     * Nearly everywhere, inner must be non-null, however in places where
1876     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1877     */
1878    LDKnativeDelayedPaymentOutputDescriptor *inner;
1879    /**
1880     * Indicates that this is the only struct which contains the same pointer.
1881     * Rust functions which take ownership of an object provided via an argument require
1882     * this to be true and invalidate the object pointed to by inner.
1883     */
1884    bool is_owned;
1885 } LDKDelayedPaymentOutputDescriptor;
1886
1887 /**
1888  * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
1889  */
1890 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
1891    /**
1892     * A pointer to the contents in the success state.
1893     * Reading from this pointer when `result_ok` is not set is undefined.
1894     */
1895    struct LDKDelayedPaymentOutputDescriptor *result;
1896    /**
1897     * A pointer to the contents in the error state.
1898     * Reading from this pointer when `result_ok` is set is undefined.
1899     */
1900    struct LDKDecodeError *err;
1901 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
1902
1903 /**
1904  * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1905  * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1906  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1907  */
1908 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
1909    /**
1910     * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
1911     * `err` or `result` depending on the state of `result_ok`.
1912     */
1913    union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
1914    /**
1915     * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
1916     */
1917    bool result_ok;
1918 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
1919
1920
1921
1922 /**
1923  * Information about a spendable output to our \"payment key\".
1924  *
1925  * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
1926  */
1927 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1928    /**
1929     * A pointer to the opaque Rust object.
1930     * Nearly everywhere, inner must be non-null, however in places where
1931     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1932     */
1933    LDKnativeStaticPaymentOutputDescriptor *inner;
1934    /**
1935     * Indicates that this is the only struct which contains the same pointer.
1936     * Rust functions which take ownership of an object provided via an argument require
1937     * this to be true and invalidate the object pointed to by inner.
1938     */
1939    bool is_owned;
1940 } LDKStaticPaymentOutputDescriptor;
1941
1942 /**
1943  * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
1944  */
1945 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
1946    /**
1947     * A pointer to the contents in the success state.
1948     * Reading from this pointer when `result_ok` is not set is undefined.
1949     */
1950    struct LDKStaticPaymentOutputDescriptor *result;
1951    /**
1952     * A pointer to the contents in the error state.
1953     * Reading from this pointer when `result_ok` is set is undefined.
1954     */
1955    struct LDKDecodeError *err;
1956 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
1957
1958 /**
1959  * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1960  * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1961  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1962  */
1963 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
1964    /**
1965     * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
1966     * `err` or `result` depending on the state of `result_ok`.
1967     */
1968    union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
1969    /**
1970     * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
1971     */
1972    bool result_ok;
1973 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
1974
1975
1976
1977 /**
1978  * A reference to a transaction output.
1979  *
1980  * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1981  * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1982  */
1983 typedef struct MUST_USE_STRUCT LDKOutPoint {
1984    /**
1985     * A pointer to the opaque Rust object.
1986     * Nearly everywhere, inner must be non-null, however in places where
1987     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1988     */
1989    LDKnativeOutPoint *inner;
1990    /**
1991     * Indicates that this is the only struct which contains the same pointer.
1992     * Rust functions which take ownership of an object provided via an argument require
1993     * this to be true and invalidate the object pointed to by inner.
1994     */
1995    bool is_owned;
1996 } LDKOutPoint;
1997
1998 /**
1999  * Describes the necessary information to spend a spendable output.
2000  *
2001  * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
2002  * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
2003  * to spend on-chain. The information needed to do this is provided in this enum, including the
2004  * outpoint describing which `txid` and output `index` is available, the full output which exists
2005  * at that `txid`/`index`, and any keys or other information required to sign.
2006  *
2007  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
2008  */
2009 typedef enum LDKSpendableOutputDescriptor_Tag {
2010    /**
2011     * An output to a script which was provided via [`SignerProvider`] directly, either from
2012     * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
2013     * know how to spend it. No secret keys are provided as LDK was never given any key.
2014     * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2015     * on-chain using the payment preimage or after it has timed out.
2016     *
2017     * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
2018     * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
2019     */
2020    LDKSpendableOutputDescriptor_StaticOutput,
2021    /**
2022     * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
2023     * delay.
2024     *
2025     * The witness in the spending input should be:
2026     * ```bitcoin
2027     * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2028     * ```
2029     *
2030     * Note that the `nSequence` field in the spending input must be set to
2031     * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
2032     * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
2033     * the outpoint confirms, see [BIP
2034     * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
2035     * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
2036     * is reached.
2037     *
2038     * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2039     * it is an output from an old state which we broadcast (which should never happen).
2040     *
2041     * To derive the delayed payment key which is used to sign this input, you must pass the
2042     * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
2043     * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
2044     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The DelayedPaymentKey can be
2045     * generated without the secret key using [`DelayedPaymentKey::from_basepoint`] and only the
2046     * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
2047     *
2048     * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
2049     * used in the witness script generation), you must pass the counterparty
2050     * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
2051     * [`ChannelSigner::provide_channel_parameters`]) and the provided
2052     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
2053     * [`RevocationKey`].
2054     *
2055     * The witness script which is hashed and included in the output `script_pubkey` may be
2056     * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
2057     * as explained above), our delayed payment pubkey (derived as explained above), and the
2058     * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
2059     * [`chan_utils::get_revokeable_redeemscript`].
2060     */
2061    LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2062    /**
2063     * An output spendable exclusively by our payment key (i.e., the private key that corresponds
2064     * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
2065     * channel type negotiated.
2066     *
2067     * On an anchor outputs channel, the witness in the spending input is:
2068     * ```bitcoin
2069     * <BIP 143 signature> <witness script>
2070     * ```
2071     *
2072     * Otherwise, it is:
2073     * ```bitcoin
2074     * <BIP 143 signature> <payment key>
2075     * ```
2076     *
2077     * These are generally the result of our counterparty having broadcast the current state,
2078     * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
2079     * in the case of anchor outputs channels.
2080     */
2081    LDKSpendableOutputDescriptor_StaticPaymentOutput,
2082    /**
2083     * Must be last for serialization purposes
2084     */
2085    LDKSpendableOutputDescriptor_Sentinel,
2086 } LDKSpendableOutputDescriptor_Tag;
2087
2088 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2089    /**
2090     * The outpoint which is spendable.
2091     */
2092    struct LDKOutPoint outpoint;
2093    /**
2094     * The output which is referenced by the given outpoint.
2095     */
2096    struct LDKTxOut output;
2097    /**
2098     * The `channel_keys_id` for the channel which this output came from.
2099     *
2100     * For channels which were generated on LDK 0.0.119 or later, this is the value which was
2101     * passed to the [`SignerProvider::get_destination_script`] call which provided this
2102     * output script.
2103     *
2104     * For channels which were generated prior to LDK 0.0.119, no such argument existed,
2105     * however this field may still be filled in if such data is available.
2106     *
2107     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2108     */
2109    struct LDKThirtyTwoBytes channel_keys_id;
2110 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2111
2112 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2113    LDKSpendableOutputDescriptor_Tag tag;
2114    union {
2115       LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2116       struct {
2117          struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2118       };
2119       struct {
2120          struct LDKStaticPaymentOutputDescriptor static_payment_output;
2121       };
2122    };
2123 } LDKSpendableOutputDescriptor;
2124
2125 /**
2126  * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
2127  */
2128 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2129    /**
2130     * A pointer to the contents in the success state.
2131     * Reading from this pointer when `result_ok` is not set is undefined.
2132     */
2133    struct LDKSpendableOutputDescriptor *result;
2134    /**
2135     * A pointer to the contents in the error state.
2136     * Reading from this pointer when `result_ok` is set is undefined.
2137     */
2138    struct LDKDecodeError *err;
2139 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2140
2141 /**
2142  * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2143  * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2144  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2145  */
2146 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2147    /**
2148     * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2149     * `err` or `result` depending on the state of `result_ok`.
2150     */
2151    union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2152    /**
2153     * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2154     */
2155    bool result_ok;
2156 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2157
2158 /**
2159  * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2160  * This corresponds to std::vector in C++
2161  */
2162 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2163    /**
2164     * The elements in the array.
2165     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2166     */
2167    struct LDKSpendableOutputDescriptor *data;
2168    /**
2169     * The number of elements pointed to by `data`.
2170     */
2171    uintptr_t datalen;
2172 } LDKCVec_SpendableOutputDescriptorZ;
2173
2174 /**
2175  * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2176  * This corresponds to std::vector in C++
2177  */
2178 typedef struct LDKCVec_TxOutZ {
2179    /**
2180     * The elements in the array.
2181     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2182     */
2183    struct LDKTxOut *data;
2184    /**
2185     * The number of elements pointed to by `data`.
2186     */
2187    uintptr_t datalen;
2188 } LDKCVec_TxOutZ;
2189
2190 /**
2191  * An enum which can either contain a u32 or not
2192  */
2193 typedef enum LDKCOption_u32Z_Tag {
2194    /**
2195     * When we're in this state, this COption_u32Z contains a u32
2196     */
2197    LDKCOption_u32Z_Some,
2198    /**
2199     * When we're in this state, this COption_u32Z contains nothing
2200     */
2201    LDKCOption_u32Z_None,
2202    /**
2203     * Must be last for serialization purposes
2204     */
2205    LDKCOption_u32Z_Sentinel,
2206 } LDKCOption_u32Z_Tag;
2207
2208 typedef struct LDKCOption_u32Z {
2209    LDKCOption_u32Z_Tag tag;
2210    union {
2211       struct {
2212          uint32_t some;
2213       };
2214    };
2215 } LDKCOption_u32Z;
2216
2217 /**
2218  * A tuple of 2 elements. See the individual fields for the types contained.
2219  */
2220 typedef struct LDKC2Tuple_CVec_u8Zu64Z {
2221    /**
2222     * The element at position 0
2223     */
2224    struct LDKCVec_u8Z a;
2225    /**
2226     * The element at position 1
2227     */
2228    uint64_t b;
2229 } LDKC2Tuple_CVec_u8Zu64Z;
2230
2231 /**
2232  * The contents of CResult_C2Tuple_CVec_u8Zu64ZNoneZ
2233  */
2234 typedef union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr {
2235    /**
2236     * A pointer to the contents in the success state.
2237     * Reading from this pointer when `result_ok` is not set is undefined.
2238     */
2239    struct LDKC2Tuple_CVec_u8Zu64Z *result;
2240    /**
2241     * Note that this value is always NULL, as there are no contents in the Err variant
2242     */
2243    void *err;
2244 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr;
2245
2246 /**
2247  * A CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents the result of a fallible operation,
2248  * containing a crate::c_types::derived::C2Tuple_CVec_u8Zu64Z on success and a () on failure.
2249  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2250  */
2251 typedef struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ {
2252    /**
2253     * The contents of this CResult_C2Tuple_CVec_u8Zu64ZNoneZ, accessible via either
2254     * `err` or `result` depending on the state of `result_ok`.
2255     */
2256    union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr contents;
2257    /**
2258     * Whether this CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents a success state.
2259     */
2260    bool result_ok;
2261 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ;
2262
2263
2264
2265 /**
2266  * The parameters required to derive a channel signer via [`SignerProvider`].
2267  */
2268 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
2269    /**
2270     * A pointer to the opaque Rust object.
2271     * Nearly everywhere, inner must be non-null, however in places where
2272     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2273     */
2274    LDKnativeChannelDerivationParameters *inner;
2275    /**
2276     * Indicates that this is the only struct which contains the same pointer.
2277     * Rust functions which take ownership of an object provided via an argument require
2278     * this to be true and invalidate the object pointed to by inner.
2279     */
2280    bool is_owned;
2281 } LDKChannelDerivationParameters;
2282
2283 /**
2284  * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
2285  */
2286 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
2287    /**
2288     * A pointer to the contents in the success state.
2289     * Reading from this pointer when `result_ok` is not set is undefined.
2290     */
2291    struct LDKChannelDerivationParameters *result;
2292    /**
2293     * A pointer to the contents in the error state.
2294     * Reading from this pointer when `result_ok` is set is undefined.
2295     */
2296    struct LDKDecodeError *err;
2297 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
2298
2299 /**
2300  * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
2301  * containing a crate::lightning::sign::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2302  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2303  */
2304 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
2305    /**
2306     * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
2307     * `err` or `result` depending on the state of `result_ok`.
2308     */
2309    union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
2310    /**
2311     * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
2312     */
2313    bool result_ok;
2314 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
2315
2316
2317
2318 /**
2319  * A descriptor used to sign for a commitment transaction's HTLC output.
2320  */
2321 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2322    /**
2323     * A pointer to the opaque Rust object.
2324     * Nearly everywhere, inner must be non-null, however in places where
2325     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2326     */
2327    LDKnativeHTLCDescriptor *inner;
2328    /**
2329     * Indicates that this is the only struct which contains the same pointer.
2330     * Rust functions which take ownership of an object provided via an argument require
2331     * this to be true and invalidate the object pointed to by inner.
2332     */
2333    bool is_owned;
2334 } LDKHTLCDescriptor;
2335
2336 /**
2337  * The contents of CResult_HTLCDescriptorDecodeErrorZ
2338  */
2339 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
2340    /**
2341     * A pointer to the contents in the success state.
2342     * Reading from this pointer when `result_ok` is not set is undefined.
2343     */
2344    struct LDKHTLCDescriptor *result;
2345    /**
2346     * A pointer to the contents in the error state.
2347     * Reading from this pointer when `result_ok` is set is undefined.
2348     */
2349    struct LDKDecodeError *err;
2350 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
2351
2352 /**
2353  * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
2354  * containing a crate::lightning::sign::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2355  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2356  */
2357 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
2358    /**
2359     * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
2360     * `err` or `result` depending on the state of `result_ok`.
2361     */
2362    union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
2363    /**
2364     * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
2365     */
2366    bool result_ok;
2367 } LDKCResult_HTLCDescriptorDecodeErrorZ;
2368
2369 /**
2370  * The contents of CResult_NoneNoneZ
2371  */
2372 typedef union LDKCResult_NoneNoneZPtr {
2373    /**
2374     * Note that this value is always NULL, as there are no contents in the OK variant
2375     */
2376    void *result;
2377    /**
2378     * Note that this value is always NULL, as there are no contents in the Err variant
2379     */
2380    void *err;
2381 } LDKCResult_NoneNoneZPtr;
2382
2383 /**
2384  * A CResult_NoneNoneZ represents the result of a fallible operation,
2385  * containing a () on success and a () on failure.
2386  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2387  */
2388 typedef struct LDKCResult_NoneNoneZ {
2389    /**
2390     * The contents of this CResult_NoneNoneZ, accessible via either
2391     * `err` or `result` depending on the state of `result_ok`.
2392     */
2393    union LDKCResult_NoneNoneZPtr contents;
2394    /**
2395     * Whether this CResult_NoneNoneZ represents a success state.
2396     */
2397    bool result_ok;
2398 } LDKCResult_NoneNoneZ;
2399
2400 /**
2401  * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2402  */
2403 typedef struct LDKPublicKey {
2404    /**
2405     * The bytes of the public key
2406     */
2407    uint8_t compressed_form[33];
2408 } LDKPublicKey;
2409
2410 /**
2411  * The contents of CResult_PublicKeyNoneZ
2412  */
2413 typedef union LDKCResult_PublicKeyNoneZPtr {
2414    /**
2415     * A pointer to the contents in the success state.
2416     * Reading from this pointer when `result_ok` is not set is undefined.
2417     */
2418    struct LDKPublicKey *result;
2419    /**
2420     * Note that this value is always NULL, as there are no contents in the Err variant
2421     */
2422    void *err;
2423 } LDKCResult_PublicKeyNoneZPtr;
2424
2425 /**
2426  * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2427  * containing a crate::c_types::PublicKey on success and a () on failure.
2428  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2429  */
2430 typedef struct LDKCResult_PublicKeyNoneZ {
2431    /**
2432     * The contents of this CResult_PublicKeyNoneZ, accessible via either
2433     * `err` or `result` depending on the state of `result_ok`.
2434     */
2435    union LDKCResult_PublicKeyNoneZPtr contents;
2436    /**
2437     * Whether this CResult_PublicKeyNoneZ represents a success state.
2438     */
2439    bool result_ok;
2440 } LDKCResult_PublicKeyNoneZ;
2441
2442 /**
2443  * An enum which can either contain a crate::c_types::BigEndianScalar or not
2444  */
2445 typedef enum LDKCOption_BigEndianScalarZ_Tag {
2446    /**
2447     * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
2448     */
2449    LDKCOption_BigEndianScalarZ_Some,
2450    /**
2451     * When we're in this state, this COption_BigEndianScalarZ contains nothing
2452     */
2453    LDKCOption_BigEndianScalarZ_None,
2454    /**
2455     * Must be last for serialization purposes
2456     */
2457    LDKCOption_BigEndianScalarZ_Sentinel,
2458 } LDKCOption_BigEndianScalarZ_Tag;
2459
2460 typedef struct LDKCOption_BigEndianScalarZ {
2461    LDKCOption_BigEndianScalarZ_Tag tag;
2462    union {
2463       struct {
2464          struct LDKBigEndianScalar some;
2465       };
2466    };
2467 } LDKCOption_BigEndianScalarZ;
2468
2469 /**
2470  * Integer in the range `0..32`
2471  */
2472 typedef struct LDKU5 {
2473    uint8_t _0;
2474 } LDKU5;
2475
2476 /**
2477  * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2478  * This corresponds to std::vector in C++
2479  */
2480 typedef struct LDKCVec_U5Z {
2481    /**
2482     * The elements in the array.
2483     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2484     */
2485    struct LDKU5 *data;
2486    /**
2487     * The number of elements pointed to by `data`.
2488     */
2489    uintptr_t datalen;
2490 } LDKCVec_U5Z;
2491
2492 /**
2493  * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2494  * allows recovering the exact public key which created the signature given the message.
2495  */
2496 typedef struct LDKRecoverableSignature {
2497    /**
2498     * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2499     * recovery.
2500     */
2501    uint8_t serialized_form[68];
2502 } LDKRecoverableSignature;
2503
2504 /**
2505  * The contents of CResult_RecoverableSignatureNoneZ
2506  */
2507 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2508    /**
2509     * A pointer to the contents in the success state.
2510     * Reading from this pointer when `result_ok` is not set is undefined.
2511     */
2512    struct LDKRecoverableSignature *result;
2513    /**
2514     * Note that this value is always NULL, as there are no contents in the Err variant
2515     */
2516    void *err;
2517 } LDKCResult_RecoverableSignatureNoneZPtr;
2518
2519 /**
2520  * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2521  * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2522  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2523  */
2524 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2525    /**
2526     * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2527     * `err` or `result` depending on the state of `result_ok`.
2528     */
2529    union LDKCResult_RecoverableSignatureNoneZPtr contents;
2530    /**
2531     * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
2532     */
2533    bool result_ok;
2534 } LDKCResult_RecoverableSignatureNoneZ;
2535
2536 /**
2537  * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2538  */
2539 typedef struct LDKSchnorrSignature {
2540    /**
2541     * The bytes of the signature as two 32-byte numbers
2542     */
2543    uint8_t compact_form[64];
2544 } LDKSchnorrSignature;
2545
2546 /**
2547  * The contents of CResult_SchnorrSignatureNoneZ
2548  */
2549 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2550    /**
2551     * A pointer to the contents in the success state.
2552     * Reading from this pointer when `result_ok` is not set is undefined.
2553     */
2554    struct LDKSchnorrSignature *result;
2555    /**
2556     * Note that this value is always NULL, as there are no contents in the Err variant
2557     */
2558    void *err;
2559 } LDKCResult_SchnorrSignatureNoneZPtr;
2560
2561 /**
2562  * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2563  * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2564  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2565  */
2566 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2567    /**
2568     * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2569     * `err` or `result` depending on the state of `result_ok`.
2570     */
2571    union LDKCResult_SchnorrSignatureNoneZPtr contents;
2572    /**
2573     * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2574     */
2575    bool result_ok;
2576 } LDKCResult_SchnorrSignatureNoneZ;
2577
2578 /**
2579  * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
2580  */
2581 typedef struct LDKECDSASignature {
2582    /**
2583     * The bytes of the signature in "compact" form
2584     */
2585    uint8_t compact_form[64];
2586 } LDKECDSASignature;
2587
2588 /**
2589  * The contents of CResult_ECDSASignatureNoneZ
2590  */
2591 typedef union LDKCResult_ECDSASignatureNoneZPtr {
2592    /**
2593     * A pointer to the contents in the success state.
2594     * Reading from this pointer when `result_ok` is not set is undefined.
2595     */
2596    struct LDKECDSASignature *result;
2597    /**
2598     * Note that this value is always NULL, as there are no contents in the Err variant
2599     */
2600    void *err;
2601 } LDKCResult_ECDSASignatureNoneZPtr;
2602
2603 /**
2604  * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
2605  * containing a crate::c_types::ECDSASignature on success and a () on failure.
2606  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2607  */
2608 typedef struct LDKCResult_ECDSASignatureNoneZ {
2609    /**
2610     * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
2611     * `err` or `result` depending on the state of `result_ok`.
2612     */
2613    union LDKCResult_ECDSASignatureNoneZPtr contents;
2614    /**
2615     * Whether this CResult_ECDSASignatureNoneZ represents a success state.
2616     */
2617    bool result_ok;
2618 } LDKCResult_ECDSASignatureNoneZ;
2619
2620 /**
2621  * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
2622  * This corresponds to std::vector in C++
2623  */
2624 typedef struct LDKCVec_ECDSASignatureZ {
2625    /**
2626     * The elements in the array.
2627     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2628     */
2629    struct LDKECDSASignature *data;
2630    /**
2631     * The number of elements pointed to by `data`.
2632     */
2633    uintptr_t datalen;
2634 } LDKCVec_ECDSASignatureZ;
2635
2636 /**
2637  * A tuple of 2 elements. See the individual fields for the types contained.
2638  */
2639 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
2640    /**
2641     * The element at position 0
2642     */
2643    struct LDKECDSASignature a;
2644    /**
2645     * The element at position 1
2646     */
2647    struct LDKCVec_ECDSASignatureZ b;
2648 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
2649
2650 /**
2651  * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
2652  */
2653 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
2654    /**
2655     * A pointer to the contents in the success state.
2656     * Reading from this pointer when `result_ok` is not set is undefined.
2657     */
2658    struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
2659    /**
2660     * Note that this value is always NULL, as there are no contents in the Err variant
2661     */
2662    void *err;
2663 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
2664
2665 /**
2666  * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
2667  * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
2668  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2669  */
2670 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
2671    /**
2672     * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
2673     * `err` or `result` depending on the state of `result_ok`.
2674     */
2675    union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
2676    /**
2677     * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
2678     */
2679    bool result_ok;
2680 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
2681
2682
2683
2684 /**
2685  * This class tracks the per-transaction information needed to build a commitment transaction and will
2686  * actually build it and sign.  It is used for holder transactions that we sign only when needed
2687  * and for transactions we sign for the counterparty.
2688  *
2689  * This class can be used inside a signer implementation to generate a signature given the relevant
2690  * secret key.
2691  */
2692 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
2693    /**
2694     * A pointer to the opaque Rust object.
2695     * Nearly everywhere, inner must be non-null, however in places where
2696     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2697     */
2698    LDKnativeCommitmentTransaction *inner;
2699    /**
2700     * Indicates that this is the only struct which contains the same pointer.
2701     * Rust functions which take ownership of an object provided via an argument require
2702     * this to be true and invalidate the object pointed to by inner.
2703     */
2704    bool is_owned;
2705 } LDKCommitmentTransaction;
2706
2707
2708
2709 /**
2710  * Information needed to build and sign a holder's commitment transaction.
2711  *
2712  * The transaction is only signed once we are ready to broadcast.
2713  */
2714 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
2715    /**
2716     * A pointer to the opaque Rust object.
2717     * Nearly everywhere, inner must be non-null, however in places where
2718     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2719     */
2720    LDKnativeHolderCommitmentTransaction *inner;
2721    /**
2722     * Indicates that this is the only struct which contains the same pointer.
2723     * Rust functions which take ownership of an object provided via an argument require
2724     * this to be true and invalidate the object pointed to by inner.
2725     */
2726    bool is_owned;
2727 } LDKHolderCommitmentTransaction;
2728
2729
2730
2731 /**
2732  * Information about an HTLC as it appears in a commitment transaction
2733  */
2734 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
2735    /**
2736     * A pointer to the opaque Rust object.
2737     * Nearly everywhere, inner must be non-null, however in places where
2738     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2739     */
2740    LDKnativeHTLCOutputInCommitment *inner;
2741    /**
2742     * Indicates that this is the only struct which contains the same pointer.
2743     * Rust functions which take ownership of an object provided via an argument require
2744     * this to be true and invalidate the object pointed to by inner.
2745     */
2746    bool is_owned;
2747 } LDKHTLCOutputInCommitment;
2748
2749
2750
2751 /**
2752  * This class tracks the per-transaction information needed to build a closing transaction and will
2753  * actually build it and sign.
2754  *
2755  * This class can be used inside a signer implementation to generate a signature given the relevant
2756  * secret key.
2757  */
2758 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
2759    /**
2760     * A pointer to the opaque Rust object.
2761     * Nearly everywhere, inner must be non-null, however in places where
2762     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2763     */
2764    LDKnativeClosingTransaction *inner;
2765    /**
2766     * Indicates that this is the only struct which contains the same pointer.
2767     * Rust functions which take ownership of an object provided via an argument require
2768     * this to be true and invalidate the object pointed to by inner.
2769     */
2770    bool is_owned;
2771 } LDKClosingTransaction;
2772
2773
2774
2775 /**
2776  * The unsigned part of a [`channel_announcement`] message.
2777  *
2778  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
2779  */
2780 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2781    /**
2782     * A pointer to the opaque Rust object.
2783     * Nearly everywhere, inner must be non-null, however in places where
2784     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2785     */
2786    LDKnativeUnsignedChannelAnnouncement *inner;
2787    /**
2788     * Indicates that this is the only struct which contains the same pointer.
2789     * Rust functions which take ownership of an object provided via an argument require
2790     * this to be true and invalidate the object pointed to by inner.
2791     */
2792    bool is_owned;
2793 } LDKUnsignedChannelAnnouncement;
2794
2795
2796
2797 /**
2798  * One counterparty's public keys which do not change over the life of a channel.
2799  */
2800 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
2801    /**
2802     * A pointer to the opaque Rust object.
2803     * Nearly everywhere, inner must be non-null, however in places where
2804     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2805     */
2806    LDKnativeChannelPublicKeys *inner;
2807    /**
2808     * Indicates that this is the only struct which contains the same pointer.
2809     * Rust functions which take ownership of an object provided via an argument require
2810     * this to be true and invalidate the object pointed to by inner.
2811     */
2812    bool is_owned;
2813 } LDKChannelPublicKeys;
2814
2815
2816
2817 /**
2818  * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
2819  * The fields are organized by holder/counterparty.
2820  *
2821  * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
2822  * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
2823  */
2824 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
2825    /**
2826     * A pointer to the opaque Rust object.
2827     * Nearly everywhere, inner must be non-null, however in places where
2828     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2829     */
2830    LDKnativeChannelTransactionParameters *inner;
2831    /**
2832     * Indicates that this is the only struct which contains the same pointer.
2833     * Rust functions which take ownership of an object provided via an argument require
2834     * this to be true and invalidate the object pointed to by inner.
2835     */
2836    bool is_owned;
2837 } LDKChannelTransactionParameters;
2838
2839 /**
2840  * A trait to handle Lightning channel key material without concretizing the channel type or
2841  * the signature mechanism.
2842  */
2843 typedef struct LDKChannelSigner {
2844    /**
2845     * An opaque pointer which is passed to your function implementations as an argument.
2846     * This has no meaning in the LDK, and can be NULL or any other value.
2847     */
2848    void *this_arg;
2849    /**
2850     * Gets the per-commitment point for a specific commitment number
2851     *
2852     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2853     */
2854    struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2855    /**
2856     * Gets the commitment secret for a specific commitment number as part of the revocation process
2857     *
2858     * An external signer implementation should error here if the commitment was already signed
2859     * and should refuse to sign it in the future.
2860     *
2861     * May be called more than once for the same index.
2862     *
2863     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2864     */
2865    struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2866    /**
2867     * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
2868     *
2869     * This is required in order for the signer to make sure that releasing a commitment
2870     * secret won't leave us without a broadcastable holder transaction.
2871     * Policy checks should be implemented in this function, including checking the amount
2872     * sent to us and checking the HTLCs.
2873     *
2874     * The preimages of outbound HTLCs that were fulfilled since the last commitment are provided.
2875     * A validating signer should ensure that an HTLC output is removed only when the matching
2876     * preimage is provided, or when the value to holder is restored.
2877     *
2878     * Note that all the relevant preimages will be provided, but there may also be additional
2879     * irrelevant or duplicate preimages.
2880     */
2881    struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
2882    /**
2883     * Validate the counterparty's revocation.
2884     *
2885     * This is required in order for the signer to make sure that the state has moved
2886     * forward and it is safe to sign the next counterparty commitment.
2887     */
2888    struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
2889    /**
2890     * Returns the holder's channel public keys and basepoints.
2891     */
2892    struct LDKChannelPublicKeys pubkeys;
2893    /**
2894     * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2895     * Note that this takes a pointer to this object, not the this_ptr like other methods do
2896     * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2897     */
2898    void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
2899    /**
2900     * Returns an arbitrary identifier describing the set of keys which are provided back to you in
2901     * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
2902     * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
2903     */
2904    struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2905    /**
2906     * Set the counterparty static channel data, including basepoints,
2907     * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
2908     *
2909     * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
2910     * instance, LDK will call this method exactly once - either immediately after construction
2911     * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
2912     * information has been generated.
2913     *
2914     * channel_parameters.is_populated() MUST be true.
2915     */
2916    void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2917    /**
2918     * Frees any resources associated with this object given its this_arg pointer.
2919     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2920     */
2921    void (*free)(void *this_arg);
2922 } LDKChannelSigner;
2923
2924 /**
2925  * A trait to sign Lightning channel transactions as described in
2926  * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
2927  *
2928  * Signing services could be implemented on a hardware wallet and should implement signing
2929  * policies in order to be secure. Please refer to the [VLS Policy
2930  * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
2931  * for an example of such policies.
2932  */
2933 typedef struct LDKEcdsaChannelSigner {
2934    /**
2935     * An opaque pointer which is passed to your function implementations as an argument.
2936     * This has no meaning in the LDK, and can be NULL or any other value.
2937     */
2938    void *this_arg;
2939    /**
2940     * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2941     *
2942     * Note that if signing fails or is rejected, the channel will be force-closed.
2943     *
2944     * Policy checks should be implemented in this function, including checking the amount
2945     * sent to us and checking the HTLCs.
2946     *
2947     * The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
2948     * are provided. A validating signer should ensure that an outbound HTLC output is removed
2949     * only when the matching preimage is provided and after the corresponding inbound HTLC has
2950     * been removed for forwarded payments.
2951     *
2952     * Note that all the relevant preimages will be provided, but there may also be additional
2953     * irrelevant or duplicate preimages.
2954     */
2955    struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ inbound_htlc_preimages, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
2956    /**
2957     * Creates a signature for a holder's commitment transaction.
2958     *
2959     * This will be called
2960     * - with a non-revoked `commitment_tx`.
2961     * - with the latest `commitment_tx` when we initiate a force-close.
2962     *
2963     * This may be called multiple times for the same transaction.
2964     *
2965     * An external signer implementation should check that the commitment has not been revoked.
2966     */
2967    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2968    /**
2969     * Create a signature for the given input in a transaction spending an HTLC transaction output
2970     * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
2971     *
2972     * A justice transaction may claim multiple outputs at the same time if timelocks are
2973     * similar, but only a signature for the input at index `input` should be signed for here.
2974     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2975     * to an upcoming timelock expiration.
2976     *
2977     * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2978     *
2979     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2980     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2981     * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
2982     * so).
2983     */
2984    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]);
2985    /**
2986     * Create a signature for the given input in a transaction spending a commitment transaction
2987     * HTLC output when our counterparty broadcasts an old state.
2988     *
2989     * A justice transaction may claim multiple outputs at the same time if timelocks are
2990     * similar, but only a signature for the input at index `input` should be signed for here.
2991     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2992     * to an upcoming timelock expiration.
2993     *
2994     * `amount` is the value of the output spent by this input, committed to in the BIP 143
2995     * signature.
2996     *
2997     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2998     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2999     * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3000     * so).
3001     *
3002     * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
3003     * (which is committed to in the BIP 143 signatures).
3004     */
3005    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);
3006    /**
3007     * Computes the signature for a commitment transaction's HTLC output used as an input within
3008     * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
3009     * must be be computed using [`EcdsaSighashType::All`].
3010     *
3011     * Note that this may be called for HTLCs in the penultimate commitment transaction if a
3012     * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
3013     * broadcasts it before receiving the update for the latest commitment transaction.
3014     *
3015     * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
3016     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3017     */
3018    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);
3019    /**
3020     * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3021     * transaction, either offered or received.
3022     *
3023     * Such a transaction may claim multiples offered outputs at same time if we know the
3024     * preimage for each when we create it, but only the input at index `input` should be
3025     * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3026     * needed with regards to an upcoming timelock expiration.
3027     *
3028     * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
3029     * outputs.
3030     *
3031     * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
3032     *
3033     * `per_commitment_point` is the dynamic point corresponding to the channel state
3034     * detected onchain. It has been generated by our counterparty and is used to derive
3035     * channel state keys, which are then included in the witness script and committed to in the
3036     * BIP 143 signature.
3037     */
3038    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);
3039    /**
3040     * Create a signature for a (proposed) closing transaction.
3041     *
3042     * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3043     * chosen to forgo their output as dust.
3044     */
3045    struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
3046    /**
3047     * Computes the signature for a commitment transaction's anchor output used as an
3048     * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
3049     */
3050    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
3051    /**
3052     * Signs a channel announcement message with our funding key proving it comes from one of the
3053     * channel participants.
3054     *
3055     * Channel announcements also require a signature from each node's network key. Our node
3056     * signature is computed through [`NodeSigner::sign_gossip_message`].
3057     *
3058     * Note that if this fails or is rejected, the channel will not be publicly announced and
3059     * our counterparty may (though likely will not) close the channel on us for violating the
3060     * protocol.
3061     *
3062     * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message
3063     */
3064    struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3065    /**
3066     * Implementation of ChannelSigner for this object.
3067     */
3068    struct LDKChannelSigner ChannelSigner;
3069    /**
3070     * Frees any resources associated with this object given its this_arg pointer.
3071     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3072     */
3073    void (*free)(void *this_arg);
3074 } LDKEcdsaChannelSigner;
3075
3076 /**
3077  * A writeable signer.
3078  *
3079  * There will always be two instances of a signer per channel, one occupied by the
3080  * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
3081  *
3082  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3083  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3084  */
3085 typedef struct LDKWriteableEcdsaChannelSigner {
3086    /**
3087     * An opaque pointer which is passed to your function implementations as an argument.
3088     * This has no meaning in the LDK, and can be NULL or any other value.
3089     */
3090    void *this_arg;
3091    /**
3092     * Implementation of EcdsaChannelSigner for this object.
3093     */
3094    struct LDKEcdsaChannelSigner EcdsaChannelSigner;
3095    /**
3096     * Serialize the object into a byte array
3097     */
3098    struct LDKCVec_u8Z (*write)(const void *this_arg);
3099    /**
3100     * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
3101     * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
3102     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3103     */
3104    void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
3105    /**
3106     * Frees any resources associated with this object given its this_arg pointer.
3107     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3108     */
3109    void (*free)(void *this_arg);
3110 } LDKWriteableEcdsaChannelSigner;
3111
3112 /**
3113  * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
3114  */
3115 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
3116    /**
3117     * A pointer to the contents in the success state.
3118     * Reading from this pointer when `result_ok` is not set is undefined.
3119     */
3120    struct LDKWriteableEcdsaChannelSigner *result;
3121    /**
3122     * A pointer to the contents in the error state.
3123     * Reading from this pointer when `result_ok` is set is undefined.
3124     */
3125    struct LDKDecodeError *err;
3126 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
3127
3128 /**
3129  * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
3130  * containing a crate::lightning::sign::ecdsa::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3131  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3132  */
3133 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
3134    /**
3135     * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
3136     * `err` or `result` depending on the state of `result_ok`.
3137     */
3138    union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
3139    /**
3140     * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
3141     */
3142    bool result_ok;
3143 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
3144
3145 /**
3146  * The contents of CResult_CVec_u8ZNoneZ
3147  */
3148 typedef union LDKCResult_CVec_u8ZNoneZPtr {
3149    /**
3150     * A pointer to the contents in the success state.
3151     * Reading from this pointer when `result_ok` is not set is undefined.
3152     */
3153    struct LDKCVec_u8Z *result;
3154    /**
3155     * Note that this value is always NULL, as there are no contents in the Err variant
3156     */
3157    void *err;
3158 } LDKCResult_CVec_u8ZNoneZPtr;
3159
3160 /**
3161  * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
3162  * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
3163  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3164  */
3165 typedef struct LDKCResult_CVec_u8ZNoneZ {
3166    /**
3167     * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
3168     * `err` or `result` depending on the state of `result_ok`.
3169     */
3170    union LDKCResult_CVec_u8ZNoneZPtr contents;
3171    /**
3172     * Whether this CResult_CVec_u8ZNoneZ represents a success state.
3173     */
3174    bool result_ok;
3175 } LDKCResult_CVec_u8ZNoneZ;
3176
3177 /**
3178  * The contents of CResult_ShutdownScriptNoneZ
3179  */
3180 typedef union LDKCResult_ShutdownScriptNoneZPtr {
3181    /**
3182     * A pointer to the contents in the success state.
3183     * Reading from this pointer when `result_ok` is not set is undefined.
3184     */
3185    struct LDKShutdownScript *result;
3186    /**
3187     * Note that this value is always NULL, as there are no contents in the Err variant
3188     */
3189    void *err;
3190 } LDKCResult_ShutdownScriptNoneZPtr;
3191
3192 /**
3193  * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
3194  * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
3195  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3196  */
3197 typedef struct LDKCResult_ShutdownScriptNoneZ {
3198    /**
3199     * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
3200     * `err` or `result` depending on the state of `result_ok`.
3201     */
3202    union LDKCResult_ShutdownScriptNoneZPtr contents;
3203    /**
3204     * Whether this CResult_ShutdownScriptNoneZ represents a success state.
3205     */
3206    bool result_ok;
3207 } LDKCResult_ShutdownScriptNoneZ;
3208
3209 /**
3210  * An enum which can either contain a u16 or not
3211  */
3212 typedef enum LDKCOption_u16Z_Tag {
3213    /**
3214     * When we're in this state, this COption_u16Z contains a u16
3215     */
3216    LDKCOption_u16Z_Some,
3217    /**
3218     * When we're in this state, this COption_u16Z contains nothing
3219     */
3220    LDKCOption_u16Z_None,
3221    /**
3222     * Must be last for serialization purposes
3223     */
3224    LDKCOption_u16Z_Sentinel,
3225 } LDKCOption_u16Z_Tag;
3226
3227 typedef struct LDKCOption_u16Z {
3228    LDKCOption_u16Z_Tag tag;
3229    union {
3230       struct {
3231          uint16_t some;
3232       };
3233    };
3234 } LDKCOption_u16Z;
3235
3236 /**
3237  * An enum which can either contain a bool or not
3238  */
3239 typedef enum LDKCOption_boolZ_Tag {
3240    /**
3241     * When we're in this state, this COption_boolZ contains a bool
3242     */
3243    LDKCOption_boolZ_Some,
3244    /**
3245     * When we're in this state, this COption_boolZ contains nothing
3246     */
3247    LDKCOption_boolZ_None,
3248    /**
3249     * Must be last for serialization purposes
3250     */
3251    LDKCOption_boolZ_Sentinel,
3252 } LDKCOption_boolZ_Tag;
3253
3254 typedef struct LDKCOption_boolZ {
3255    LDKCOption_boolZ_Tag tag;
3256    union {
3257       struct {
3258          bool some;
3259       };
3260    };
3261 } LDKCOption_boolZ;
3262
3263 /**
3264  * The contents of CResult_WitnessNoneZ
3265  */
3266 typedef union LDKCResult_WitnessNoneZPtr {
3267    /**
3268     * A pointer to the contents in the success state.
3269     * Reading from this pointer when `result_ok` is not set is undefined.
3270     */
3271    struct LDKWitness *result;
3272    /**
3273     * Note that this value is always NULL, as there are no contents in the Err variant
3274     */
3275    void *err;
3276 } LDKCResult_WitnessNoneZPtr;
3277
3278 /**
3279  * A CResult_WitnessNoneZ represents the result of a fallible operation,
3280  * containing a crate::c_types::Witness on success and a () on failure.
3281  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3282  */
3283 typedef struct LDKCResult_WitnessNoneZ {
3284    /**
3285     * The contents of this CResult_WitnessNoneZ, accessible via either
3286     * `err` or `result` depending on the state of `result_ok`.
3287     */
3288    union LDKCResult_WitnessNoneZPtr contents;
3289    /**
3290     * Whether this CResult_WitnessNoneZ represents a success state.
3291     */
3292    bool result_ok;
3293 } LDKCResult_WitnessNoneZ;
3294
3295
3296
3297 /**
3298  * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3299  *
3300  * This implementation performs no policy checks and is insufficient by itself as
3301  * a secure external signer.
3302  */
3303 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3304    /**
3305     * A pointer to the opaque Rust object.
3306     * Nearly everywhere, inner must be non-null, however in places where
3307     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3308     */
3309    LDKnativeInMemorySigner *inner;
3310    /**
3311     * Indicates that this is the only struct which contains the same pointer.
3312     * Rust functions which take ownership of an object provided via an argument require
3313     * this to be true and invalidate the object pointed to by inner.
3314     */
3315    bool is_owned;
3316 } LDKInMemorySigner;
3317
3318 /**
3319  * The contents of CResult_InMemorySignerDecodeErrorZ
3320  */
3321 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3322    /**
3323     * A pointer to the contents in the success state.
3324     * Reading from this pointer when `result_ok` is not set is undefined.
3325     */
3326    struct LDKInMemorySigner *result;
3327    /**
3328     * A pointer to the contents in the error state.
3329     * Reading from this pointer when `result_ok` is set is undefined.
3330     */
3331    struct LDKDecodeError *err;
3332 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3333
3334 /**
3335  * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3336  * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3337  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3338  */
3339 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3340    /**
3341     * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3342     * `err` or `result` depending on the state of `result_ok`.
3343     */
3344    union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3345    /**
3346     * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3347     */
3348    bool result_ok;
3349 } LDKCResult_InMemorySignerDecodeErrorZ;
3350
3351 /**
3352  * The contents of CResult_TransactionNoneZ
3353  */
3354 typedef union LDKCResult_TransactionNoneZPtr {
3355    /**
3356     * A pointer to the contents in the success state.
3357     * Reading from this pointer when `result_ok` is not set is undefined.
3358     */
3359    struct LDKTransaction *result;
3360    /**
3361     * Note that this value is always NULL, as there are no contents in the Err variant
3362     */
3363    void *err;
3364 } LDKCResult_TransactionNoneZPtr;
3365
3366 /**
3367  * A CResult_TransactionNoneZ represents the result of a fallible operation,
3368  * containing a crate::c_types::Transaction on success and a () on failure.
3369  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3370  */
3371 typedef struct LDKCResult_TransactionNoneZ {
3372    /**
3373     * The contents of this CResult_TransactionNoneZ, accessible via either
3374     * `err` or `result` depending on the state of `result_ok`.
3375     */
3376    union LDKCResult_TransactionNoneZPtr contents;
3377    /**
3378     * Whether this CResult_TransactionNoneZ represents a success state.
3379     */
3380    bool result_ok;
3381 } LDKCResult_TransactionNoneZ;
3382
3383
3384
3385 /**
3386  * A [`CandidateRouteHop::FirstHop`] entry.
3387  */
3388 typedef struct MUST_USE_STRUCT LDKFirstHopCandidate {
3389    /**
3390     * A pointer to the opaque Rust object.
3391     * Nearly everywhere, inner must be non-null, however in places where
3392     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3393     */
3394    LDKnativeFirstHopCandidate *inner;
3395    /**
3396     * Indicates that this is the only struct which contains the same pointer.
3397     * Rust functions which take ownership of an object provided via an argument require
3398     * this to be true and invalidate the object pointed to by inner.
3399     */
3400    bool is_owned;
3401 } LDKFirstHopCandidate;
3402
3403
3404
3405 /**
3406  * A [`CandidateRouteHop::PublicHop`] entry.
3407  */
3408 typedef struct MUST_USE_STRUCT LDKPublicHopCandidate {
3409    /**
3410     * A pointer to the opaque Rust object.
3411     * Nearly everywhere, inner must be non-null, however in places where
3412     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3413     */
3414    LDKnativePublicHopCandidate *inner;
3415    /**
3416     * Indicates that this is the only struct which contains the same pointer.
3417     * Rust functions which take ownership of an object provided via an argument require
3418     * this to be true and invalidate the object pointed to by inner.
3419     */
3420    bool is_owned;
3421 } LDKPublicHopCandidate;
3422
3423
3424
3425 /**
3426  * A [`CandidateRouteHop::PrivateHop`] entry.
3427  */
3428 typedef struct MUST_USE_STRUCT LDKPrivateHopCandidate {
3429    /**
3430     * A pointer to the opaque Rust object.
3431     * Nearly everywhere, inner must be non-null, however in places where
3432     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3433     */
3434    LDKnativePrivateHopCandidate *inner;
3435    /**
3436     * Indicates that this is the only struct which contains the same pointer.
3437     * Rust functions which take ownership of an object provided via an argument require
3438     * this to be true and invalidate the object pointed to by inner.
3439     */
3440    bool is_owned;
3441 } LDKPrivateHopCandidate;
3442
3443
3444
3445 /**
3446  * A [`CandidateRouteHop::Blinded`] entry.
3447  */
3448 typedef struct MUST_USE_STRUCT LDKBlindedPathCandidate {
3449    /**
3450     * A pointer to the opaque Rust object.
3451     * Nearly everywhere, inner must be non-null, however in places where
3452     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3453     */
3454    LDKnativeBlindedPathCandidate *inner;
3455    /**
3456     * Indicates that this is the only struct which contains the same pointer.
3457     * Rust functions which take ownership of an object provided via an argument require
3458     * this to be true and invalidate the object pointed to by inner.
3459     */
3460    bool is_owned;
3461 } LDKBlindedPathCandidate;
3462
3463
3464
3465 /**
3466  * A [`CandidateRouteHop::OneHopBlinded`] entry.
3467  */
3468 typedef struct MUST_USE_STRUCT LDKOneHopBlindedPathCandidate {
3469    /**
3470     * A pointer to the opaque Rust object.
3471     * Nearly everywhere, inner must be non-null, however in places where
3472     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3473     */
3474    LDKnativeOneHopBlindedPathCandidate *inner;
3475    /**
3476     * Indicates that this is the only struct which contains the same pointer.
3477     * Rust functions which take ownership of an object provided via an argument require
3478     * this to be true and invalidate the object pointed to by inner.
3479     */
3480    bool is_owned;
3481 } LDKOneHopBlindedPathCandidate;
3482
3483 /**
3484  * A wrapper around the various hop representations.
3485  *
3486  * Can be used to examine the properties of a hop,
3487  * potentially to decide whether to include it in a route.
3488  */
3489 typedef enum LDKCandidateRouteHop_Tag {
3490    /**
3491     * A hop from the payer, where the outbound liquidity is known.
3492     */
3493    LDKCandidateRouteHop_FirstHop,
3494    /**
3495     * A hop found in the [`ReadOnlyNetworkGraph`].
3496     */
3497    LDKCandidateRouteHop_PublicHop,
3498    /**
3499     * A private hop communicated by the payee, generally via a BOLT 11 invoice.
3500     *
3501     * Because BOLT 11 route hints can take multiple hops to get to the destination, this may not
3502     * terminate at the payee.
3503     */
3504    LDKCandidateRouteHop_PrivateHop,
3505    /**
3506     * A blinded path which starts with an introduction point and ultimately terminates with the
3507     * payee.
3508     *
3509     * Because we don't know the payee's identity, [`CandidateRouteHop::target`] will return
3510     * `None` in this state.
3511     *
3512     * Because blinded paths are \"all or nothing\", and we cannot use just one part of a blinded
3513     * path, the full path is treated as a single [`CandidateRouteHop`].
3514     */
3515    LDKCandidateRouteHop_Blinded,
3516    /**
3517     * Similar to [`Self::Blinded`], but the path here only has one hop.
3518     *
3519     * While we treat this similarly to [`CandidateRouteHop::Blinded`] in many respects (e.g.
3520     * returning `None` from [`CandidateRouteHop::target`]), in this case we do actually know the
3521     * payee's identity - it's the introduction point!
3522     *
3523     * [`BlindedPayInfo`] provided for 1-hop blinded paths is ignored because it is meant to apply
3524     * to the hops *between* the introduction node and the destination.
3525     *
3526     * This primarily exists to track that we need to included a blinded path at the end of our
3527     * [`Route`], even though it doesn't actually add an additional hop in the payment.
3528     */
3529    LDKCandidateRouteHop_OneHopBlinded,
3530    /**
3531     * Must be last for serialization purposes
3532     */
3533    LDKCandidateRouteHop_Sentinel,
3534 } LDKCandidateRouteHop_Tag;
3535
3536 typedef struct MUST_USE_STRUCT LDKCandidateRouteHop {
3537    LDKCandidateRouteHop_Tag tag;
3538    union {
3539       struct {
3540          struct LDKFirstHopCandidate first_hop;
3541       };
3542       struct {
3543          struct LDKPublicHopCandidate public_hop;
3544       };
3545       struct {
3546          struct LDKPrivateHopCandidate private_hop;
3547       };
3548       struct {
3549          struct LDKBlindedPathCandidate blinded;
3550       };
3551       struct {
3552          struct LDKOneHopBlindedPathCandidate one_hop_blinded;
3553       };
3554    };
3555 } LDKCandidateRouteHop;
3556
3557
3558
3559 /**
3560  * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
3561  */
3562 typedef struct MUST_USE_STRUCT LDKChannelUsage {
3563    /**
3564     * A pointer to the opaque Rust object.
3565     * Nearly everywhere, inner must be non-null, however in places where
3566     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3567     */
3568    LDKnativeChannelUsage *inner;
3569    /**
3570     * Indicates that this is the only struct which contains the same pointer.
3571     * Rust functions which take ownership of an object provided via an argument require
3572     * this to be true and invalidate the object pointed to by inner.
3573     */
3574    bool is_owned;
3575 } LDKChannelUsage;
3576
3577
3578
3579 /**
3580  * Parameters for configuring [`ProbabilisticScorer`].
3581  *
3582  * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
3583  * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
3584  *
3585  * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
3586  * parameters here.
3587  */
3588 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
3589    /**
3590     * A pointer to the opaque Rust object.
3591     * Nearly everywhere, inner must be non-null, however in places where
3592     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3593     */
3594    LDKnativeProbabilisticScoringFeeParameters *inner;
3595    /**
3596     * Indicates that this is the only struct which contains the same pointer.
3597     * Rust functions which take ownership of an object provided via an argument require
3598     * this to be true and invalidate the object pointed to by inner.
3599     */
3600    bool is_owned;
3601 } LDKProbabilisticScoringFeeParameters;
3602
3603 /**
3604  * An interface used to score payment channels for path finding.
3605  *
3606  * `ScoreLookUp` is used to determine the penalty for a given channel.
3607  *
3608  * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
3609  */
3610 typedef struct LDKScoreLookUp {
3611    /**
3612     * An opaque pointer which is passed to your function implementations as an argument.
3613     * This has no meaning in the LDK, and can be NULL or any other value.
3614     */
3615    void *this_arg;
3616    /**
3617     * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
3618     * given channel in the direction from `source` to `target`.
3619     *
3620     * The channel's capacity (less any other MPP parts that are also being considered for use in
3621     * the same payment) is given by `capacity_msat`. It may be determined from various sources
3622     * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
3623     * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
3624     * Thus, implementations should be overflow-safe.
3625     */
3626    uint64_t (*channel_penalty_msat)(const void *this_arg, const struct LDKCandidateRouteHop *NONNULL_PTR candidate, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
3627    /**
3628     * Frees any resources associated with this object given its this_arg pointer.
3629     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3630     */
3631    void (*free)(void *this_arg);
3632 } LDKScoreLookUp;
3633
3634
3635
3636 /**
3637  * A path in a [`Route`] to the payment recipient. Must always be at least length one.
3638  * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
3639  */
3640 typedef struct MUST_USE_STRUCT LDKPath {
3641    /**
3642     * A pointer to the opaque Rust object.
3643     * Nearly everywhere, inner must be non-null, however in places where
3644     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3645     */
3646    LDKnativePath *inner;
3647    /**
3648     * Indicates that this is the only struct which contains the same pointer.
3649     * Rust functions which take ownership of an object provided via an argument require
3650     * this to be true and invalidate the object pointed to by inner.
3651     */
3652    bool is_owned;
3653 } LDKPath;
3654
3655 /**
3656  * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
3657  */
3658 typedef struct LDKScoreUpdate {
3659    /**
3660     * An opaque pointer which is passed to your function implementations as an argument.
3661     * This has no meaning in the LDK, and can be NULL or any other value.
3662     */
3663    void *this_arg;
3664    /**
3665     * Handles updating channel penalties after failing to route through a channel.
3666     */
3667    void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
3668    /**
3669     * Handles updating channel penalties after successfully routing along a path.
3670     */
3671    void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
3672    /**
3673     * Handles updating channel penalties after a probe over the given path failed.
3674     */
3675    void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
3676    /**
3677     * Handles updating channel penalties after a probe over the given path succeeded.
3678     */
3679    void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
3680    /**
3681     * Scorers may wish to reduce their certainty of channel liquidity information over time.
3682     * Thus, this method is provided to allow scorers to observe the passage of time - the holder
3683     * of this object should call this method regularly (generally via the
3684     * `lightning-background-processor` crate).
3685     */
3686    void (*time_passed)(void *this_arg, uint64_t duration_since_epoch);
3687    /**
3688     * Frees any resources associated with this object given its this_arg pointer.
3689     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3690     */
3691    void (*free)(void *this_arg);
3692 } LDKScoreUpdate;
3693
3694 /**
3695  * A scorer that is accessed under a lock.
3696  *
3697  * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
3698  * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
3699  * implementations. Internal locking would be detrimental to route finding performance and could
3700  * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
3701  *
3702  * [`find_route`]: crate::routing::router::find_route
3703  */
3704 typedef struct LDKLockableScore {
3705    /**
3706     * An opaque pointer which is passed to your function implementations as an argument.
3707     * This has no meaning in the LDK, and can be NULL or any other value.
3708     */
3709    void *this_arg;
3710    /**
3711     * Returns read locked scorer.
3712     */
3713    struct LDKScoreLookUp (*read_lock)(const void *this_arg);
3714    /**
3715     * Returns write locked scorer.
3716     */
3717    struct LDKScoreUpdate (*write_lock)(const void *this_arg);
3718    /**
3719     * Frees any resources associated with this object given its this_arg pointer.
3720     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3721     */
3722    void (*free)(void *this_arg);
3723 } LDKLockableScore;
3724
3725 /**
3726  * Refers to a scorer that is accessible under lock and also writeable to disk
3727  *
3728  * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
3729  * use the Persister to persist it.
3730  */
3731 typedef struct LDKWriteableScore {
3732    /**
3733     * An opaque pointer which is passed to your function implementations as an argument.
3734     * This has no meaning in the LDK, and can be NULL or any other value.
3735     */
3736    void *this_arg;
3737    /**
3738     * Implementation of LockableScore for this object.
3739     */
3740    struct LDKLockableScore LockableScore;
3741    /**
3742     * Serialize the object into a byte array
3743     */
3744    struct LDKCVec_u8Z (*write)(const void *this_arg);
3745    /**
3746     * Frees any resources associated with this object given its this_arg pointer.
3747     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3748     */
3749    void (*free)(void *this_arg);
3750 } LDKWriteableScore;
3751
3752 /**
3753  * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
3754  */
3755 typedef enum LDKCOption_WriteableScoreZ_Tag {
3756    /**
3757     * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
3758     */
3759    LDKCOption_WriteableScoreZ_Some,
3760    /**
3761     * When we're in this state, this COption_WriteableScoreZ contains nothing
3762     */
3763    LDKCOption_WriteableScoreZ_None,
3764    /**
3765     * Must be last for serialization purposes
3766     */
3767    LDKCOption_WriteableScoreZ_Sentinel,
3768 } LDKCOption_WriteableScoreZ_Tag;
3769
3770 typedef struct LDKCOption_WriteableScoreZ {
3771    LDKCOption_WriteableScoreZ_Tag tag;
3772    union {
3773       struct {
3774          struct LDKWriteableScore some;
3775       };
3776    };
3777 } LDKCOption_WriteableScoreZ;
3778
3779 /**
3780  * The contents of CResult_NoneIOErrorZ
3781  */
3782 typedef union LDKCResult_NoneIOErrorZPtr {
3783    /**
3784     * Note that this value is always NULL, as there are no contents in the OK variant
3785     */
3786    void *result;
3787    /**
3788     * A pointer to the contents in the error state.
3789     * Reading from this pointer when `result_ok` is set is undefined.
3790     */
3791    enum LDKIOError *err;
3792 } LDKCResult_NoneIOErrorZPtr;
3793
3794 /**
3795  * A CResult_NoneIOErrorZ represents the result of a fallible operation,
3796  * containing a () on success and a crate::c_types::IOError on failure.
3797  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3798  */
3799 typedef struct LDKCResult_NoneIOErrorZ {
3800    /**
3801     * The contents of this CResult_NoneIOErrorZ, accessible via either
3802     * `err` or `result` depending on the state of `result_ok`.
3803     */
3804    union LDKCResult_NoneIOErrorZPtr contents;
3805    /**
3806     * Whether this CResult_NoneIOErrorZ represents a success state.
3807     */
3808    bool result_ok;
3809 } LDKCResult_NoneIOErrorZ;
3810
3811
3812
3813 /**
3814  * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
3815  */
3816 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3817    /**
3818     * A pointer to the opaque Rust object.
3819     * Nearly everywhere, inner must be non-null, however in places where
3820     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3821     */
3822    LDKnativeChannelDetails *inner;
3823    /**
3824     * Indicates that this is the only struct which contains the same pointer.
3825     * Rust functions which take ownership of an object provided via an argument require
3826     * this to be true and invalidate the object pointed to by inner.
3827     */
3828    bool is_owned;
3829 } LDKChannelDetails;
3830
3831 /**
3832  * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3833  * This corresponds to std::vector in C++
3834  */
3835 typedef struct LDKCVec_ChannelDetailsZ {
3836    /**
3837     * The elements in the array.
3838     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3839     */
3840    struct LDKChannelDetails *data;
3841    /**
3842     * The number of elements pointed to by `data`.
3843     */
3844    uintptr_t datalen;
3845 } LDKCVec_ChannelDetailsZ;
3846
3847
3848
3849 /**
3850  * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3851  * it can take multiple paths. Each path is composed of one or more hops through the network.
3852  */
3853 typedef struct MUST_USE_STRUCT LDKRoute {
3854    /**
3855     * A pointer to the opaque Rust object.
3856     * Nearly everywhere, inner must be non-null, however in places where
3857     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3858     */
3859    LDKnativeRoute *inner;
3860    /**
3861     * Indicates that this is the only struct which contains the same pointer.
3862     * Rust functions which take ownership of an object provided via an argument require
3863     * this to be true and invalidate the object pointed to by inner.
3864     */
3865    bool is_owned;
3866 } LDKRoute;
3867
3868
3869
3870 /**
3871  * An Err type for failure to process messages.
3872  */
3873 typedef struct MUST_USE_STRUCT LDKLightningError {
3874    /**
3875     * A pointer to the opaque Rust object.
3876     * Nearly everywhere, inner must be non-null, however in places where
3877     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3878     */
3879    LDKnativeLightningError *inner;
3880    /**
3881     * Indicates that this is the only struct which contains the same pointer.
3882     * Rust functions which take ownership of an object provided via an argument require
3883     * this to be true and invalidate the object pointed to by inner.
3884     */
3885    bool is_owned;
3886 } LDKLightningError;
3887
3888 /**
3889  * The contents of CResult_RouteLightningErrorZ
3890  */
3891 typedef union LDKCResult_RouteLightningErrorZPtr {
3892    /**
3893     * A pointer to the contents in the success state.
3894     * Reading from this pointer when `result_ok` is not set is undefined.
3895     */
3896    struct LDKRoute *result;
3897    /**
3898     * A pointer to the contents in the error state.
3899     * Reading from this pointer when `result_ok` is set is undefined.
3900     */
3901    struct LDKLightningError *err;
3902 } LDKCResult_RouteLightningErrorZPtr;
3903
3904 /**
3905  * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3906  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3907  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3908  */
3909 typedef struct LDKCResult_RouteLightningErrorZ {
3910    /**
3911     * The contents of this CResult_RouteLightningErrorZ, accessible via either
3912     * `err` or `result` depending on the state of `result_ok`.
3913     */
3914    union LDKCResult_RouteLightningErrorZPtr contents;
3915    /**
3916     * Whether this CResult_RouteLightningErrorZ represents a success state.
3917     */
3918    bool result_ok;
3919 } LDKCResult_RouteLightningErrorZ;
3920
3921 /**
3922  * A tuple of 2 elements. See the individual fields for the types contained.
3923  */
3924 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
3925    /**
3926     * The element at position 0
3927     */
3928    struct LDKBlindedPayInfo a;
3929    /**
3930     * The element at position 1
3931     */
3932    struct LDKBlindedPath b;
3933 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
3934
3935 /**
3936  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
3937  * This corresponds to std::vector in C++
3938  */
3939 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
3940    /**
3941     * The elements in the array.
3942     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3943     */
3944    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
3945    /**
3946     * The number of elements pointed to by `data`.
3947     */
3948    uintptr_t datalen;
3949 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
3950
3951 /**
3952  * The contents of CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ
3953  */
3954 typedef union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr {
3955    /**
3956     * A pointer to the contents in the success state.
3957     * Reading from this pointer when `result_ok` is not set is undefined.
3958     */
3959    struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *result;
3960    /**
3961     * Note that this value is always NULL, as there are no contents in the Err variant
3962     */
3963    void *err;
3964 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr;
3965
3966 /**
3967  * A CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents the result of a fallible operation,
3968  * containing a crate::c_types::derived::CVec_C2Tuple_BlindedPayInfoBlindedPathZZ on success and a () on failure.
3969  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3970  */
3971 typedef struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
3972    /**
3973     * The contents of this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ, accessible via either
3974     * `err` or `result` depending on the state of `result_ok`.
3975     */
3976    union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr contents;
3977    /**
3978     * Whether this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents a success state.
3979     */
3980    bool result_ok;
3981 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ;
3982
3983 /**
3984  * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
3985  * This corresponds to std::vector in C++
3986  */
3987 typedef struct LDKCVec_PublicKeyZ {
3988    /**
3989     * The elements in the array.
3990     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3991     */
3992    struct LDKPublicKey *data;
3993    /**
3994     * The number of elements pointed to by `data`.
3995     */
3996    uintptr_t datalen;
3997 } LDKCVec_PublicKeyZ;
3998
3999
4000
4001 /**
4002  * A path for sending an [`OnionMessage`].
4003  */
4004 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
4005    /**
4006     * A pointer to the opaque Rust object.
4007     * Nearly everywhere, inner must be non-null, however in places where
4008     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4009     */
4010    LDKnativeOnionMessagePath *inner;
4011    /**
4012     * Indicates that this is the only struct which contains the same pointer.
4013     * Rust functions which take ownership of an object provided via an argument require
4014     * this to be true and invalidate the object pointed to by inner.
4015     */
4016    bool is_owned;
4017 } LDKOnionMessagePath;
4018
4019 /**
4020  * The contents of CResult_OnionMessagePathNoneZ
4021  */
4022 typedef union LDKCResult_OnionMessagePathNoneZPtr {
4023    /**
4024     * A pointer to the contents in the success state.
4025     * Reading from this pointer when `result_ok` is not set is undefined.
4026     */
4027    struct LDKOnionMessagePath *result;
4028    /**
4029     * Note that this value is always NULL, as there are no contents in the Err variant
4030     */
4031    void *err;
4032 } LDKCResult_OnionMessagePathNoneZPtr;
4033
4034 /**
4035  * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
4036  * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
4037  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4038  */
4039 typedef struct LDKCResult_OnionMessagePathNoneZ {
4040    /**
4041     * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
4042     * `err` or `result` depending on the state of `result_ok`.
4043     */
4044    union LDKCResult_OnionMessagePathNoneZPtr contents;
4045    /**
4046     * Whether this CResult_OnionMessagePathNoneZ represents a success state.
4047     */
4048    bool result_ok;
4049 } LDKCResult_OnionMessagePathNoneZ;
4050
4051 /**
4052  * The contents of CResult_CVec_BlindedPathZNoneZ
4053  */
4054 typedef union LDKCResult_CVec_BlindedPathZNoneZPtr {
4055    /**
4056     * A pointer to the contents in the success state.
4057     * Reading from this pointer when `result_ok` is not set is undefined.
4058     */
4059    struct LDKCVec_BlindedPathZ *result;
4060    /**
4061     * Note that this value is always NULL, as there are no contents in the Err variant
4062     */
4063    void *err;
4064 } LDKCResult_CVec_BlindedPathZNoneZPtr;
4065
4066 /**
4067  * A CResult_CVec_BlindedPathZNoneZ represents the result of a fallible operation,
4068  * containing a crate::c_types::derived::CVec_BlindedPathZ on success and a () on failure.
4069  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4070  */
4071 typedef struct LDKCResult_CVec_BlindedPathZNoneZ {
4072    /**
4073     * The contents of this CResult_CVec_BlindedPathZNoneZ, accessible via either
4074     * `err` or `result` depending on the state of `result_ok`.
4075     */
4076    union LDKCResult_CVec_BlindedPathZNoneZPtr contents;
4077    /**
4078     * Whether this CResult_CVec_BlindedPathZNoneZ represents a success state.
4079     */
4080    bool result_ok;
4081 } LDKCResult_CVec_BlindedPathZNoneZ;
4082
4083
4084
4085 /**
4086  * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
4087  * in-use channel liquidity.
4088  */
4089 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
4090    /**
4091     * A pointer to the opaque Rust object.
4092     * Nearly everywhere, inner must be non-null, however in places where
4093     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4094     */
4095    LDKnativeInFlightHtlcs *inner;
4096    /**
4097     * Indicates that this is the only struct which contains the same pointer.
4098     * Rust functions which take ownership of an object provided via an argument require
4099     * this to be true and invalidate the object pointed to by inner.
4100     */
4101    bool is_owned;
4102 } LDKInFlightHtlcs;
4103
4104 /**
4105  * The contents of CResult_InFlightHtlcsDecodeErrorZ
4106  */
4107 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
4108    /**
4109     * A pointer to the contents in the success state.
4110     * Reading from this pointer when `result_ok` is not set is undefined.
4111     */
4112    struct LDKInFlightHtlcs *result;
4113    /**
4114     * A pointer to the contents in the error state.
4115     * Reading from this pointer when `result_ok` is set is undefined.
4116     */
4117    struct LDKDecodeError *err;
4118 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
4119
4120 /**
4121  * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
4122  * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
4123  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4124  */
4125 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
4126    /**
4127     * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
4128     * `err` or `result` depending on the state of `result_ok`.
4129     */
4130    union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
4131    /**
4132     * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
4133     */
4134    bool result_ok;
4135 } LDKCResult_InFlightHtlcsDecodeErrorZ;
4136
4137
4138
4139 /**
4140  * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
4141  * that leads to it.
4142  */
4143 typedef struct MUST_USE_STRUCT LDKRouteHop {
4144    /**
4145     * A pointer to the opaque Rust object.
4146     * Nearly everywhere, inner must be non-null, however in places where
4147     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4148     */
4149    LDKnativeRouteHop *inner;
4150    /**
4151     * Indicates that this is the only struct which contains the same pointer.
4152     * Rust functions which take ownership of an object provided via an argument require
4153     * this to be true and invalidate the object pointed to by inner.
4154     */
4155    bool is_owned;
4156 } LDKRouteHop;
4157
4158 /**
4159  * The contents of CResult_RouteHopDecodeErrorZ
4160  */
4161 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
4162    /**
4163     * A pointer to the contents in the success state.
4164     * Reading from this pointer when `result_ok` is not set is undefined.
4165     */
4166    struct LDKRouteHop *result;
4167    /**
4168     * A pointer to the contents in the error state.
4169     * Reading from this pointer when `result_ok` is set is undefined.
4170     */
4171    struct LDKDecodeError *err;
4172 } LDKCResult_RouteHopDecodeErrorZPtr;
4173
4174 /**
4175  * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
4176  * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4177  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4178  */
4179 typedef struct LDKCResult_RouteHopDecodeErrorZ {
4180    /**
4181     * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
4182     * `err` or `result` depending on the state of `result_ok`.
4183     */
4184    union LDKCResult_RouteHopDecodeErrorZPtr contents;
4185    /**
4186     * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
4187     */
4188    bool result_ok;
4189 } LDKCResult_RouteHopDecodeErrorZ;
4190
4191
4192
4193 /**
4194  * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
4195  * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
4196  * and thus can be used to hide the identity of the recipient.
4197  */
4198 typedef struct MUST_USE_STRUCT LDKBlindedHop {
4199    /**
4200     * A pointer to the opaque Rust object.
4201     * Nearly everywhere, inner must be non-null, however in places where
4202     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4203     */
4204    LDKnativeBlindedHop *inner;
4205    /**
4206     * Indicates that this is the only struct which contains the same pointer.
4207     * Rust functions which take ownership of an object provided via an argument require
4208     * this to be true and invalidate the object pointed to by inner.
4209     */
4210    bool is_owned;
4211 } LDKBlindedHop;
4212
4213 /**
4214  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
4215  * This corresponds to std::vector in C++
4216  */
4217 typedef struct LDKCVec_BlindedHopZ {
4218    /**
4219     * The elements in the array.
4220     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4221     */
4222    struct LDKBlindedHop *data;
4223    /**
4224     * The number of elements pointed to by `data`.
4225     */
4226    uintptr_t datalen;
4227 } LDKCVec_BlindedHopZ;
4228
4229
4230
4231 /**
4232  * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
4233  * their [`Bolt12Invoice`].
4234  *
4235  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
4236  */
4237 typedef struct MUST_USE_STRUCT LDKBlindedTail {
4238    /**
4239     * A pointer to the opaque Rust object.
4240     * Nearly everywhere, inner must be non-null, however in places where
4241     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4242     */
4243    LDKnativeBlindedTail *inner;
4244    /**
4245     * Indicates that this is the only struct which contains the same pointer.
4246     * Rust functions which take ownership of an object provided via an argument require
4247     * this to be true and invalidate the object pointed to by inner.
4248     */
4249    bool is_owned;
4250 } LDKBlindedTail;
4251
4252 /**
4253  * The contents of CResult_BlindedTailDecodeErrorZ
4254  */
4255 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
4256    /**
4257     * A pointer to the contents in the success state.
4258     * Reading from this pointer when `result_ok` is not set is undefined.
4259     */
4260    struct LDKBlindedTail *result;
4261    /**
4262     * A pointer to the contents in the error state.
4263     * Reading from this pointer when `result_ok` is set is undefined.
4264     */
4265    struct LDKDecodeError *err;
4266 } LDKCResult_BlindedTailDecodeErrorZPtr;
4267
4268 /**
4269  * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
4270  * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
4271  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4272  */
4273 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
4274    /**
4275     * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
4276     * `err` or `result` depending on the state of `result_ok`.
4277     */
4278    union LDKCResult_BlindedTailDecodeErrorZPtr contents;
4279    /**
4280     * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
4281     */
4282    bool result_ok;
4283 } LDKCResult_BlindedTailDecodeErrorZ;
4284
4285 /**
4286  * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
4287  * This corresponds to std::vector in C++
4288  */
4289 typedef struct LDKCVec_RouteHopZ {
4290    /**
4291     * The elements in the array.
4292     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4293     */
4294    struct LDKRouteHop *data;
4295    /**
4296     * The number of elements pointed to by `data`.
4297     */
4298    uintptr_t datalen;
4299 } LDKCVec_RouteHopZ;
4300
4301 /**
4302  * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
4303  * This corresponds to std::vector in C++
4304  */
4305 typedef struct LDKCVec_PathZ {
4306    /**
4307     * The elements in the array.
4308     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4309     */
4310    struct LDKPath *data;
4311    /**
4312     * The number of elements pointed to by `data`.
4313     */
4314    uintptr_t datalen;
4315 } LDKCVec_PathZ;
4316
4317 /**
4318  * The contents of CResult_RouteDecodeErrorZ
4319  */
4320 typedef union LDKCResult_RouteDecodeErrorZPtr {
4321    /**
4322     * A pointer to the contents in the success state.
4323     * Reading from this pointer when `result_ok` is not set is undefined.
4324     */
4325    struct LDKRoute *result;
4326    /**
4327     * A pointer to the contents in the error state.
4328     * Reading from this pointer when `result_ok` is set is undefined.
4329     */
4330    struct LDKDecodeError *err;
4331 } LDKCResult_RouteDecodeErrorZPtr;
4332
4333 /**
4334  * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
4335  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
4336  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4337  */
4338 typedef struct LDKCResult_RouteDecodeErrorZ {
4339    /**
4340     * The contents of this CResult_RouteDecodeErrorZ, accessible via either
4341     * `err` or `result` depending on the state of `result_ok`.
4342     */
4343    union LDKCResult_RouteDecodeErrorZPtr contents;
4344    /**
4345     * Whether this CResult_RouteDecodeErrorZ represents a success state.
4346     */
4347    bool result_ok;
4348 } LDKCResult_RouteDecodeErrorZ;
4349
4350
4351
4352 /**
4353  * Parameters needed to find a [`Route`].
4354  *
4355  * Passed to [`find_route`] and [`build_route_from_hops`].
4356  */
4357 typedef struct MUST_USE_STRUCT LDKRouteParameters {
4358    /**
4359     * A pointer to the opaque Rust object.
4360     * Nearly everywhere, inner must be non-null, however in places where
4361     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4362     */
4363    LDKnativeRouteParameters *inner;
4364    /**
4365     * Indicates that this is the only struct which contains the same pointer.
4366     * Rust functions which take ownership of an object provided via an argument require
4367     * this to be true and invalidate the object pointed to by inner.
4368     */
4369    bool is_owned;
4370 } LDKRouteParameters;
4371
4372 /**
4373  * The contents of CResult_RouteParametersDecodeErrorZ
4374  */
4375 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
4376    /**
4377     * A pointer to the contents in the success state.
4378     * Reading from this pointer when `result_ok` is not set is undefined.
4379     */
4380    struct LDKRouteParameters *result;
4381    /**
4382     * A pointer to the contents in the error state.
4383     * Reading from this pointer when `result_ok` is set is undefined.
4384     */
4385    struct LDKDecodeError *err;
4386 } LDKCResult_RouteParametersDecodeErrorZPtr;
4387
4388 /**
4389  * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
4390  * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4391  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4392  */
4393 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
4394    /**
4395     * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
4396     * `err` or `result` depending on the state of `result_ok`.
4397     */
4398    union LDKCResult_RouteParametersDecodeErrorZPtr contents;
4399    /**
4400     * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
4401     */
4402    bool result_ok;
4403 } LDKCResult_RouteParametersDecodeErrorZ;
4404
4405 /**
4406  * A dynamically-allocated array of u64s of arbitrary size.
4407  * This corresponds to std::vector in C++
4408  */
4409 typedef struct LDKCVec_u64Z {
4410    /**
4411     * The elements in the array.
4412     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4413     */
4414    uint64_t *data;
4415    /**
4416     * The number of elements pointed to by `data`.
4417     */
4418    uintptr_t datalen;
4419 } LDKCVec_u64Z;
4420
4421
4422
4423 /**
4424  * Information used to route a payment.
4425  */
4426 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
4427    /**
4428     * A pointer to the opaque Rust object.
4429     * Nearly everywhere, inner must be non-null, however in places where
4430     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4431     */
4432    LDKnativePaymentParameters *inner;
4433    /**
4434     * Indicates that this is the only struct which contains the same pointer.
4435     * Rust functions which take ownership of an object provided via an argument require
4436     * this to be true and invalidate the object pointed to by inner.
4437     */
4438    bool is_owned;
4439 } LDKPaymentParameters;
4440
4441 /**
4442  * The contents of CResult_PaymentParametersDecodeErrorZ
4443  */
4444 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
4445    /**
4446     * A pointer to the contents in the success state.
4447     * Reading from this pointer when `result_ok` is not set is undefined.
4448     */
4449    struct LDKPaymentParameters *result;
4450    /**
4451     * A pointer to the contents in the error state.
4452     * Reading from this pointer when `result_ok` is set is undefined.
4453     */
4454    struct LDKDecodeError *err;
4455 } LDKCResult_PaymentParametersDecodeErrorZPtr;
4456
4457 /**
4458  * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
4459  * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4460  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4461  */
4462 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
4463    /**
4464     * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
4465     * `err` or `result` depending on the state of `result_ok`.
4466     */
4467    union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
4468    /**
4469     * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
4470     */
4471    bool result_ok;
4472 } LDKCResult_PaymentParametersDecodeErrorZ;
4473
4474
4475
4476 /**
4477  * A list of hops along a payment path terminating with a channel to the recipient.
4478  */
4479 typedef struct MUST_USE_STRUCT LDKRouteHint {
4480    /**
4481     * A pointer to the opaque Rust object.
4482     * Nearly everywhere, inner must be non-null, however in places where
4483     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4484     */
4485    LDKnativeRouteHint *inner;
4486    /**
4487     * Indicates that this is the only struct which contains the same pointer.
4488     * Rust functions which take ownership of an object provided via an argument require
4489     * this to be true and invalidate the object pointed to by inner.
4490     */
4491    bool is_owned;
4492 } LDKRouteHint;
4493
4494 /**
4495  * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
4496  * This corresponds to std::vector in C++
4497  */
4498 typedef struct LDKCVec_RouteHintZ {
4499    /**
4500     * The elements in the array.
4501     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4502     */
4503    struct LDKRouteHint *data;
4504    /**
4505     * The number of elements pointed to by `data`.
4506     */
4507    uintptr_t datalen;
4508 } LDKCVec_RouteHintZ;
4509
4510
4511
4512 /**
4513  * A channel descriptor for a hop along a payment path.
4514  *
4515  * While this generally comes from BOLT 11's `r` field, this struct includes more fields than are
4516  * available in BOLT 11. Thus, encoding and decoding this via `lightning-invoice` is lossy, as
4517  * fields not supported in BOLT 11 will be stripped.
4518  */
4519 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
4520    /**
4521     * A pointer to the opaque Rust object.
4522     * Nearly everywhere, inner must be non-null, however in places where
4523     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4524     */
4525    LDKnativeRouteHintHop *inner;
4526    /**
4527     * Indicates that this is the only struct which contains the same pointer.
4528     * Rust functions which take ownership of an object provided via an argument require
4529     * this to be true and invalidate the object pointed to by inner.
4530     */
4531    bool is_owned;
4532 } LDKRouteHintHop;
4533
4534 /**
4535  * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
4536  * This corresponds to std::vector in C++
4537  */
4538 typedef struct LDKCVec_RouteHintHopZ {
4539    /**
4540     * The elements in the array.
4541     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4542     */
4543    struct LDKRouteHintHop *data;
4544    /**
4545     * The number of elements pointed to by `data`.
4546     */
4547    uintptr_t datalen;
4548 } LDKCVec_RouteHintHopZ;
4549
4550 /**
4551  * The contents of CResult_RouteHintDecodeErrorZ
4552  */
4553 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
4554    /**
4555     * A pointer to the contents in the success state.
4556     * Reading from this pointer when `result_ok` is not set is undefined.
4557     */
4558    struct LDKRouteHint *result;
4559    /**
4560     * A pointer to the contents in the error state.
4561     * Reading from this pointer when `result_ok` is set is undefined.
4562     */
4563    struct LDKDecodeError *err;
4564 } LDKCResult_RouteHintDecodeErrorZPtr;
4565
4566 /**
4567  * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
4568  * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4569  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4570  */
4571 typedef struct LDKCResult_RouteHintDecodeErrorZ {
4572    /**
4573     * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
4574     * `err` or `result` depending on the state of `result_ok`.
4575     */
4576    union LDKCResult_RouteHintDecodeErrorZPtr contents;
4577    /**
4578     * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
4579     */
4580    bool result_ok;
4581 } LDKCResult_RouteHintDecodeErrorZ;
4582
4583 /**
4584  * The contents of CResult_RouteHintHopDecodeErrorZ
4585  */
4586 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
4587    /**
4588     * A pointer to the contents in the success state.
4589     * Reading from this pointer when `result_ok` is not set is undefined.
4590     */
4591    struct LDKRouteHintHop *result;
4592    /**
4593     * A pointer to the contents in the error state.
4594     * Reading from this pointer when `result_ok` is set is undefined.
4595     */
4596    struct LDKDecodeError *err;
4597 } LDKCResult_RouteHintHopDecodeErrorZPtr;
4598
4599 /**
4600  * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
4601  * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4602  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4603  */
4604 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
4605    /**
4606     * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
4607     * `err` or `result` depending on the state of `result_ok`.
4608     */
4609    union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
4610    /**
4611     * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
4612     */
4613    bool result_ok;
4614 } LDKCResult_RouteHintHopDecodeErrorZ;
4615
4616
4617
4618 /**
4619  * [`ScoreLookUp`] implementation that uses a fixed penalty.
4620  */
4621 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4622    /**
4623     * A pointer to the opaque Rust object.
4624     * Nearly everywhere, inner must be non-null, however in places where
4625     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4626     */
4627    LDKnativeFixedPenaltyScorer *inner;
4628    /**
4629     * Indicates that this is the only struct which contains the same pointer.
4630     * Rust functions which take ownership of an object provided via an argument require
4631     * this to be true and invalidate the object pointed to by inner.
4632     */
4633    bool is_owned;
4634 } LDKFixedPenaltyScorer;
4635
4636 /**
4637  * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4638  */
4639 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4640    /**
4641     * A pointer to the contents in the success state.
4642     * Reading from this pointer when `result_ok` is not set is undefined.
4643     */
4644    struct LDKFixedPenaltyScorer *result;
4645    /**
4646     * A pointer to the contents in the error state.
4647     * Reading from this pointer when `result_ok` is set is undefined.
4648     */
4649    struct LDKDecodeError *err;
4650 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4651
4652 /**
4653  * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4654  * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4655  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4656  */
4657 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4658    /**
4659     * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4660     * `err` or `result` depending on the state of `result_ok`.
4661     */
4662    union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4663    /**
4664     * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4665     */
4666    bool result_ok;
4667 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4668
4669
4670
4671 /**
4672  * Represents the compressed public key of a node
4673  */
4674 typedef struct MUST_USE_STRUCT LDKNodeId {
4675    /**
4676     * A pointer to the opaque Rust object.
4677     * Nearly everywhere, inner must be non-null, however in places where
4678     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4679     */
4680    LDKnativeNodeId *inner;
4681    /**
4682     * Indicates that this is the only struct which contains the same pointer.
4683     * Rust functions which take ownership of an object provided via an argument require
4684     * this to be true and invalidate the object pointed to by inner.
4685     */
4686    bool is_owned;
4687 } LDKNodeId;
4688
4689 /**
4690  * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4691  * This corresponds to std::vector in C++
4692  */
4693 typedef struct LDKCVec_NodeIdZ {
4694    /**
4695     * The elements in the array.
4696     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4697     */
4698    struct LDKNodeId *data;
4699    /**
4700     * The number of elements pointed to by `data`.
4701     */
4702    uintptr_t datalen;
4703 } LDKCVec_NodeIdZ;
4704
4705 /**
4706  * A tuple of 2 elements. See the individual fields for the types contained.
4707  */
4708 typedef struct LDKC2Tuple_u64u64Z {
4709    /**
4710     * The element at position 0
4711     */
4712    uint64_t a;
4713    /**
4714     * The element at position 1
4715     */
4716    uint64_t b;
4717 } LDKC2Tuple_u64u64Z;
4718
4719 /**
4720  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4721  */
4722 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4723    /**
4724     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4725     */
4726    LDKCOption_C2Tuple_u64u64ZZ_Some,
4727    /**
4728     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4729     */
4730    LDKCOption_C2Tuple_u64u64ZZ_None,
4731    /**
4732     * Must be last for serialization purposes
4733     */
4734    LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4735 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4736
4737 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4738    LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4739    union {
4740       struct {
4741          struct LDKC2Tuple_u64u64Z some;
4742       };
4743    };
4744 } LDKCOption_C2Tuple_u64u64ZZ;
4745
4746 /**
4747  * 32 u16s
4748  */
4749 typedef struct LDKThirtyTwoU16s {
4750    /**
4751     * The thirty-two 16-bit integers
4752     */
4753    uint16_t data[32];
4754 } LDKThirtyTwoU16s;
4755
4756 /**
4757  * A tuple of 2 elements. See the individual fields for the types contained.
4758  */
4759 typedef struct LDKC2Tuple_Z {
4760    /**
4761     * The element at position 0
4762     */
4763    struct LDKThirtyTwoU16s a;
4764    /**
4765     * The element at position 1
4766     */
4767    struct LDKThirtyTwoU16s b;
4768 } LDKC2Tuple_Z;
4769
4770 /**
4771  * A tuple of 2 elements. See the individual fields for the types contained.
4772  */
4773 typedef struct LDKC2Tuple__u1632_u1632Z {
4774    /**
4775     * The element at position 0
4776     */
4777    struct LDKThirtyTwoU16s a;
4778    /**
4779     * The element at position 1
4780     */
4781    struct LDKThirtyTwoU16s b;
4782 } LDKC2Tuple__u1632_u1632Z;
4783
4784 /**
4785  * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
4786  */
4787 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
4788    /**
4789     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
4790     */
4791    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
4792    /**
4793     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
4794     */
4795    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
4796    /**
4797     * Must be last for serialization purposes
4798     */
4799    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
4800 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
4801
4802 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
4803    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
4804    union {
4805       struct {
4806          struct LDKC2Tuple__u1632_u1632Z some;
4807       };
4808    };
4809 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
4810
4811 /**
4812  * An enum which can either contain a f64 or not
4813  */
4814 typedef enum LDKCOption_f64Z_Tag {
4815    /**
4816     * When we're in this state, this COption_f64Z contains a f64
4817     */
4818    LDKCOption_f64Z_Some,
4819    /**
4820     * When we're in this state, this COption_f64Z contains nothing
4821     */
4822    LDKCOption_f64Z_None,
4823    /**
4824     * Must be last for serialization purposes
4825     */
4826    LDKCOption_f64Z_Sentinel,
4827 } LDKCOption_f64Z_Tag;
4828
4829 typedef struct LDKCOption_f64Z {
4830    LDKCOption_f64Z_Tag tag;
4831    union {
4832       struct {
4833          double some;
4834       };
4835    };
4836 } LDKCOption_f64Z;
4837
4838
4839
4840 /**
4841  * A Record, unit of logging output with Metadata to enable filtering
4842  * Module_path, file, line to inform on log's source
4843  */
4844 typedef struct MUST_USE_STRUCT LDKRecord {
4845    /**
4846     * A pointer to the opaque Rust object.
4847     * Nearly everywhere, inner must be non-null, however in places where
4848     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4849     */
4850    LDKnativeRecord *inner;
4851    /**
4852     * Indicates that this is the only struct which contains the same pointer.
4853     * Rust functions which take ownership of an object provided via an argument require
4854     * this to be true and invalidate the object pointed to by inner.
4855     */
4856    bool is_owned;
4857 } LDKRecord;
4858
4859 /**
4860  * A trait encapsulating the operations required of a logger.
4861  */
4862 typedef struct LDKLogger {
4863    /**
4864     * An opaque pointer which is passed to your function implementations as an argument.
4865     * This has no meaning in the LDK, and can be NULL or any other value.
4866     */
4867    void *this_arg;
4868    /**
4869     * Logs the [`Record`].
4870     */
4871    void (*log)(const void *this_arg, struct LDKRecord record);
4872    /**
4873     * Frees any resources associated with this object given its this_arg pointer.
4874     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4875     */
4876    void (*free)(void *this_arg);
4877 } LDKLogger;
4878
4879
4880
4881 /**
4882  * Represents the network as nodes and channels between them
4883  */
4884 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4885    /**
4886     * A pointer to the opaque Rust object.
4887     * Nearly everywhere, inner must be non-null, however in places where
4888     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4889     */
4890    LDKnativeNetworkGraph *inner;
4891    /**
4892     * Indicates that this is the only struct which contains the same pointer.
4893     * Rust functions which take ownership of an object provided via an argument require
4894     * this to be true and invalidate the object pointed to by inner.
4895     */
4896    bool is_owned;
4897 } LDKNetworkGraph;
4898
4899
4900
4901 /**
4902  * [`ScoreLookUp`] implementation using channel success probability distributions.
4903  *
4904  * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
4905  * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
4906  * When a payment is forwarded through a channel (but fails later in the route), we learn the
4907  * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
4908  *
4909  * These bounds are then used to determine a success probability using the formula from
4910  * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4911  * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
4912  *
4913  * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
4914  * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
4915  * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
4916  * terms of the entire path's success probability. This allows the router to directly compare
4917  * penalties for different paths. See the documentation of those parameters for the exact formulas.
4918  *
4919  * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
4920  *
4921  * Further, we track the history of our upper and lower liquidity bounds for each channel,
4922  * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
4923  * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
4924  * formula, but using the history of a channel rather than our latest estimates for the liquidity
4925  * bounds.
4926  *
4927  * [1]: https://arxiv.org/abs/2107.05322
4928  * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
4929  * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
4930  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
4931  * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
4932  * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
4933  */
4934 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4935    /**
4936     * A pointer to the opaque Rust object.
4937     * Nearly everywhere, inner must be non-null, however in places where
4938     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4939     */
4940    LDKnativeProbabilisticScorer *inner;
4941    /**
4942     * Indicates that this is the only struct which contains the same pointer.
4943     * Rust functions which take ownership of an object provided via an argument require
4944     * this to be true and invalidate the object pointed to by inner.
4945     */
4946    bool is_owned;
4947 } LDKProbabilisticScorer;
4948
4949 /**
4950  * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4951  */
4952 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4953    /**
4954     * A pointer to the contents in the success state.
4955     * Reading from this pointer when `result_ok` is not set is undefined.
4956     */
4957    struct LDKProbabilisticScorer *result;
4958    /**
4959     * A pointer to the contents in the error state.
4960     * Reading from this pointer when `result_ok` is set is undefined.
4961     */
4962    struct LDKDecodeError *err;
4963 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4964
4965 /**
4966  * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4967  * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4968  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4969  */
4970 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4971    /**
4972     * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4973     * `err` or `result` depending on the state of `result_ok`.
4974     */
4975    union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4976    /**
4977     * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4978     */
4979    bool result_ok;
4980 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4981
4982 /**
4983  * A tuple of 2 elements. See the individual fields for the types contained.
4984  */
4985 typedef struct LDKC2Tuple_usizeTransactionZ {
4986    /**
4987     * The element at position 0
4988     */
4989    uintptr_t a;
4990    /**
4991     * The element at position 1
4992     */
4993    struct LDKTransaction b;
4994 } LDKC2Tuple_usizeTransactionZ;
4995
4996 /**
4997  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4998  * This corresponds to std::vector in C++
4999  */
5000 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
5001    /**
5002     * The elements in the array.
5003     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5004     */
5005    struct LDKC2Tuple_usizeTransactionZ *data;
5006    /**
5007     * The number of elements pointed to by `data`.
5008     */
5009    uintptr_t datalen;
5010 } LDKCVec_C2Tuple_usizeTransactionZZ;
5011
5012 /**
5013  * A tuple of 3 elements. See the individual fields for the types contained.
5014  */
5015 typedef struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ {
5016    /**
5017     * The element at position 0
5018     */
5019    struct LDKThirtyTwoBytes a;
5020    /**
5021     * The element at position 1
5022     */
5023    uint32_t b;
5024    /**
5025     * The element at position 2
5026     */
5027    struct LDKCOption_ThirtyTwoBytesZ c;
5028 } LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ;
5029
5030 /**
5031  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZs of arbitrary size.
5032  * This corresponds to std::vector in C++
5033  */
5034 typedef struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ {
5035    /**
5036     * The elements in the array.
5037     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5038     */
5039    struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *data;
5040    /**
5041     * The number of elements pointed to by `data`.
5042     */
5043    uintptr_t datalen;
5044 } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ;
5045
5046 /**
5047  * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
5048  */
5049 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
5050    /**
5051     * A pointer to the contents in the success state.
5052     * Reading from this pointer when `result_ok` is not set is undefined.
5053     */
5054    enum LDKChannelMonitorUpdateStatus *result;
5055    /**
5056     * Note that this value is always NULL, as there are no contents in the Err variant
5057     */
5058    void *err;
5059 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
5060
5061 /**
5062  * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
5063  * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
5064  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5065  */
5066 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
5067    /**
5068     * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
5069     * `err` or `result` depending on the state of `result_ok`.
5070     */
5071    union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
5072    /**
5073     * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
5074     */
5075    bool result_ok;
5076 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
5077
5078
5079
5080 /**
5081  * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
5082  * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
5083  * preimage claim backward will lead to loss of funds.
5084  */
5085 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
5086    /**
5087     * A pointer to the opaque Rust object.
5088     * Nearly everywhere, inner must be non-null, however in places where
5089     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5090     */
5091    LDKnativeHTLCUpdate *inner;
5092    /**
5093     * Indicates that this is the only struct which contains the same pointer.
5094     * Rust functions which take ownership of an object provided via an argument require
5095     * this to be true and invalidate the object pointed to by inner.
5096     */
5097    bool is_owned;
5098 } LDKHTLCUpdate;
5099
5100 /**
5101  * An event to be processed by the ChannelManager.
5102  */
5103 typedef enum LDKMonitorEvent_Tag {
5104    /**
5105     * A monitor event containing an HTLCUpdate.
5106     */
5107    LDKMonitorEvent_HTLCEvent,
5108    /**
5109     * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5110     * channel.
5111     */
5112    LDKMonitorEvent_HolderForceClosed,
5113    /**
5114     * Indicates a [`ChannelMonitor`] update has completed. See
5115     * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
5116     *
5117     * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
5118     */
5119    LDKMonitorEvent_Completed,
5120    /**
5121     * Must be last for serialization purposes
5122     */
5123    LDKMonitorEvent_Sentinel,
5124 } LDKMonitorEvent_Tag;
5125
5126 typedef struct LDKMonitorEvent_LDKCompleted_Body {
5127    /**
5128     * The funding outpoint of the [`ChannelMonitor`] that was updated
5129     */
5130    struct LDKOutPoint funding_txo;
5131    /**
5132     * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
5133     * [`ChannelMonitor::get_latest_update_id`].
5134     *
5135     * Note that this should only be set to a given update's ID if all previous updates for the
5136     * same [`ChannelMonitor`] have been applied and persisted.
5137     */
5138    uint64_t monitor_update_id;
5139 } LDKMonitorEvent_LDKCompleted_Body;
5140
5141 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
5142    LDKMonitorEvent_Tag tag;
5143    union {
5144       struct {
5145          struct LDKHTLCUpdate htlc_event;
5146       };
5147       struct {
5148          struct LDKOutPoint holder_force_closed;
5149       };
5150       LDKMonitorEvent_LDKCompleted_Body completed;
5151    };
5152 } LDKMonitorEvent;
5153
5154 /**
5155  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
5156  * This corresponds to std::vector in C++
5157  */
5158 typedef struct LDKCVec_MonitorEventZ {
5159    /**
5160     * The elements in the array.
5161     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5162     */
5163    struct LDKMonitorEvent *data;
5164    /**
5165     * The number of elements pointed to by `data`.
5166     */
5167    uintptr_t datalen;
5168 } LDKCVec_MonitorEventZ;
5169
5170 /**
5171  * A tuple of 3 elements. See the individual fields for the types contained.
5172  */
5173 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
5174    /**
5175     * The element at position 0
5176     */
5177    struct LDKOutPoint a;
5178    /**
5179     * The element at position 1
5180     */
5181    struct LDKCVec_MonitorEventZ b;
5182    /**
5183     * The element at position 2
5184     */
5185    struct LDKPublicKey c;
5186 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
5187
5188 /**
5189  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
5190  * This corresponds to std::vector in C++
5191  */
5192 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
5193    /**
5194     * The elements in the array.
5195     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5196     */
5197    struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
5198    /**
5199     * The number of elements pointed to by `data`.
5200     */
5201    uintptr_t datalen;
5202 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
5203
5204
5205
5206 /**
5207  * Features used within an `init` message.
5208  */
5209 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5210    /**
5211     * A pointer to the opaque Rust object.
5212     * Nearly everywhere, inner must be non-null, however in places where
5213     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5214     */
5215    LDKnativeInitFeatures *inner;
5216    /**
5217     * Indicates that this is the only struct which contains the same pointer.
5218     * Rust functions which take ownership of an object provided via an argument require
5219     * this to be true and invalidate the object pointed to by inner.
5220     */
5221    bool is_owned;
5222 } LDKInitFeatures;
5223
5224 /**
5225  * The contents of CResult_InitFeaturesDecodeErrorZ
5226  */
5227 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5228    /**
5229     * A pointer to the contents in the success state.
5230     * Reading from this pointer when `result_ok` is not set is undefined.
5231     */
5232    struct LDKInitFeatures *result;
5233    /**
5234     * A pointer to the contents in the error state.
5235     * Reading from this pointer when `result_ok` is set is undefined.
5236     */
5237    struct LDKDecodeError *err;
5238 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5239
5240 /**
5241  * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5242  * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5243  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5244  */
5245 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5246    /**
5247     * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5248     * `err` or `result` depending on the state of `result_ok`.
5249     */
5250    union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5251    /**
5252     * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5253     */
5254    bool result_ok;
5255 } LDKCResult_InitFeaturesDecodeErrorZ;
5256
5257
5258
5259 /**
5260  * Features used within a `channel_announcement` message.
5261  */
5262 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5263    /**
5264     * A pointer to the opaque Rust object.
5265     * Nearly everywhere, inner must be non-null, however in places where
5266     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5267     */
5268    LDKnativeChannelFeatures *inner;
5269    /**
5270     * Indicates that this is the only struct which contains the same pointer.
5271     * Rust functions which take ownership of an object provided via an argument require
5272     * this to be true and invalidate the object pointed to by inner.
5273     */
5274    bool is_owned;
5275 } LDKChannelFeatures;
5276
5277 /**
5278  * The contents of CResult_ChannelFeaturesDecodeErrorZ
5279  */
5280 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5281    /**
5282     * A pointer to the contents in the success state.
5283     * Reading from this pointer when `result_ok` is not set is undefined.
5284     */
5285    struct LDKChannelFeatures *result;
5286    /**
5287     * A pointer to the contents in the error state.
5288     * Reading from this pointer when `result_ok` is set is undefined.
5289     */
5290    struct LDKDecodeError *err;
5291 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5292
5293 /**
5294  * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5295  * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5296  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5297  */
5298 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5299    /**
5300     * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5301     * `err` or `result` depending on the state of `result_ok`.
5302     */
5303    union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5304    /**
5305     * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5306     */
5307    bool result_ok;
5308 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5309
5310
5311
5312 /**
5313  * Features used within a `node_announcement` message.
5314  */
5315 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5316    /**
5317     * A pointer to the opaque Rust object.
5318     * Nearly everywhere, inner must be non-null, however in places where
5319     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5320     */
5321    LDKnativeNodeFeatures *inner;
5322    /**
5323     * Indicates that this is the only struct which contains the same pointer.
5324     * Rust functions which take ownership of an object provided via an argument require
5325     * this to be true and invalidate the object pointed to by inner.
5326     */
5327    bool is_owned;
5328 } LDKNodeFeatures;
5329
5330 /**
5331  * The contents of CResult_NodeFeaturesDecodeErrorZ
5332  */
5333 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5334    /**
5335     * A pointer to the contents in the success state.
5336     * Reading from this pointer when `result_ok` is not set is undefined.
5337     */
5338    struct LDKNodeFeatures *result;
5339    /**
5340     * A pointer to the contents in the error state.
5341     * Reading from this pointer when `result_ok` is set is undefined.
5342     */
5343    struct LDKDecodeError *err;
5344 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5345
5346 /**
5347  * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5348  * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5349  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5350  */
5351 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5352    /**
5353     * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5354     * `err` or `result` depending on the state of `result_ok`.
5355     */
5356    union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5357    /**
5358     * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5359     */
5360    bool result_ok;
5361 } LDKCResult_NodeFeaturesDecodeErrorZ;
5362
5363
5364
5365 /**
5366  * Features used within an invoice.
5367  */
5368 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
5369    /**
5370     * A pointer to the opaque Rust object.
5371     * Nearly everywhere, inner must be non-null, however in places where
5372     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5373     */
5374    LDKnativeBolt11InvoiceFeatures *inner;
5375    /**
5376     * Indicates that this is the only struct which contains the same pointer.
5377     * Rust functions which take ownership of an object provided via an argument require
5378     * this to be true and invalidate the object pointed to by inner.
5379     */
5380    bool is_owned;
5381 } LDKBolt11InvoiceFeatures;
5382
5383 /**
5384  * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
5385  */
5386 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
5387    /**
5388     * A pointer to the contents in the success state.
5389     * Reading from this pointer when `result_ok` is not set is undefined.
5390     */
5391    struct LDKBolt11InvoiceFeatures *result;
5392    /**
5393     * A pointer to the contents in the error state.
5394     * Reading from this pointer when `result_ok` is set is undefined.
5395     */
5396    struct LDKDecodeError *err;
5397 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
5398
5399 /**
5400  * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5401  * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5402  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5403  */
5404 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
5405    /**
5406     * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
5407     * `err` or `result` depending on the state of `result_ok`.
5408     */
5409    union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
5410    /**
5411     * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
5412     */
5413    bool result_ok;
5414 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
5415
5416
5417
5418 /**
5419  * Features used within an `invoice`.
5420  */
5421 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
5422    /**
5423     * A pointer to the opaque Rust object.
5424     * Nearly everywhere, inner must be non-null, however in places where
5425     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5426     */
5427    LDKnativeBolt12InvoiceFeatures *inner;
5428    /**
5429     * Indicates that this is the only struct which contains the same pointer.
5430     * Rust functions which take ownership of an object provided via an argument require
5431     * this to be true and invalidate the object pointed to by inner.
5432     */
5433    bool is_owned;
5434 } LDKBolt12InvoiceFeatures;
5435
5436 /**
5437  * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
5438  */
5439 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
5440    /**
5441     * A pointer to the contents in the success state.
5442     * Reading from this pointer when `result_ok` is not set is undefined.
5443     */
5444    struct LDKBolt12InvoiceFeatures *result;
5445    /**
5446     * A pointer to the contents in the error state.
5447     * Reading from this pointer when `result_ok` is set is undefined.
5448     */
5449    struct LDKDecodeError *err;
5450 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
5451
5452 /**
5453  * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5454  * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5455  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5456  */
5457 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
5458    /**
5459     * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
5460     * `err` or `result` depending on the state of `result_ok`.
5461     */
5462    union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
5463    /**
5464     * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
5465     */
5466    bool result_ok;
5467 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
5468
5469
5470
5471 /**
5472  * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
5473  */
5474 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
5475    /**
5476     * A pointer to the opaque Rust object.
5477     * Nearly everywhere, inner must be non-null, however in places where
5478     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5479     */
5480    LDKnativeBlindedHopFeatures *inner;
5481    /**
5482     * Indicates that this is the only struct which contains the same pointer.
5483     * Rust functions which take ownership of an object provided via an argument require
5484     * this to be true and invalidate the object pointed to by inner.
5485     */
5486    bool is_owned;
5487 } LDKBlindedHopFeatures;
5488
5489 /**
5490  * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
5491  */
5492 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
5493    /**
5494     * A pointer to the contents in the success state.
5495     * Reading from this pointer when `result_ok` is not set is undefined.
5496     */
5497    struct LDKBlindedHopFeatures *result;
5498    /**
5499     * A pointer to the contents in the error state.
5500     * Reading from this pointer when `result_ok` is set is undefined.
5501     */
5502    struct LDKDecodeError *err;
5503 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
5504
5505 /**
5506  * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
5507  * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5508  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5509  */
5510 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
5511    /**
5512     * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
5513     * `err` or `result` depending on the state of `result_ok`.
5514     */
5515    union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
5516    /**
5517     * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
5518     */
5519    bool result_ok;
5520 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
5521
5522
5523
5524 /**
5525  * Features used within the channel_type field in an OpenChannel message.
5526  *
5527  * A channel is always of some known \"type\", describing the transaction formats used and the exact
5528  * semantics of our interaction with our peer.
5529  *
5530  * Note that because a channel is a specific type which is proposed by the opener and accepted by
5531  * the counterparty, only required features are allowed here.
5532  *
5533  * This is serialized differently from other feature types - it is not prefixed by a length, and
5534  * thus must only appear inside a TLV where its length is known in advance.
5535  */
5536 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
5537    /**
5538     * A pointer to the opaque Rust object.
5539     * Nearly everywhere, inner must be non-null, however in places where
5540     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5541     */
5542    LDKnativeChannelTypeFeatures *inner;
5543    /**
5544     * Indicates that this is the only struct which contains the same pointer.
5545     * Rust functions which take ownership of an object provided via an argument require
5546     * this to be true and invalidate the object pointed to by inner.
5547     */
5548    bool is_owned;
5549 } LDKChannelTypeFeatures;
5550
5551 /**
5552  * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5553  */
5554 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5555    /**
5556     * A pointer to the contents in the success state.
5557     * Reading from this pointer when `result_ok` is not set is undefined.
5558     */
5559    struct LDKChannelTypeFeatures *result;
5560    /**
5561     * A pointer to the contents in the error state.
5562     * Reading from this pointer when `result_ok` is set is undefined.
5563     */
5564    struct LDKDecodeError *err;
5565 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5566
5567 /**
5568  * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5569  * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5570  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5571  */
5572 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5573    /**
5574     * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5575     * `err` or `result` depending on the state of `result_ok`.
5576     */
5577    union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5578    /**
5579     * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5580     */
5581    bool result_ok;
5582 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5583
5584
5585
5586 /**
5587  * An `Offer` is a potentially long-lived proposal for payment of a good or service.
5588  *
5589  * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
5590  * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
5591  * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
5592  *
5593  * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
5594  * latter.
5595  *
5596  * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
5597  *
5598  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
5599  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
5600  */
5601 typedef struct MUST_USE_STRUCT LDKOffer {
5602    /**
5603     * A pointer to the opaque Rust object.
5604     * Nearly everywhere, inner must be non-null, however in places where
5605     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5606     */
5607    LDKnativeOffer *inner;
5608    /**
5609     * Indicates that this is the only struct which contains the same pointer.
5610     * Rust functions which take ownership of an object provided via an argument require
5611     * this to be true and invalidate the object pointed to by inner.
5612     */
5613    bool is_owned;
5614 } LDKOffer;
5615
5616 /**
5617  * The contents of CResult_OfferBolt12ParseErrorZ
5618  */
5619 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
5620    /**
5621     * A pointer to the contents in the success state.
5622     * Reading from this pointer when `result_ok` is not set is undefined.
5623     */
5624    struct LDKOffer *result;
5625    /**
5626     * A pointer to the contents in the error state.
5627     * Reading from this pointer when `result_ok` is set is undefined.
5628     */
5629    struct LDKBolt12ParseError *err;
5630 } LDKCResult_OfferBolt12ParseErrorZPtr;
5631
5632 /**
5633  * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
5634  * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
5635  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5636  */
5637 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
5638    /**
5639     * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
5640     * `err` or `result` depending on the state of `result_ok`.
5641     */
5642    union LDKCResult_OfferBolt12ParseErrorZPtr contents;
5643    /**
5644     * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
5645     */
5646    bool result_ok;
5647 } LDKCResult_OfferBolt12ParseErrorZ;
5648
5649 /**
5650  * The contents of CResult_PublicKeySecp256k1ErrorZ
5651  */
5652 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
5653    /**
5654     * A pointer to the contents in the success state.
5655     * Reading from this pointer when `result_ok` is not set is undefined.
5656     */
5657    struct LDKPublicKey *result;
5658    /**
5659     * A pointer to the contents in the error state.
5660     * Reading from this pointer when `result_ok` is set is undefined.
5661     */
5662    enum LDKSecp256k1Error *err;
5663 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
5664
5665 /**
5666  * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
5667  * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
5668  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5669  */
5670 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
5671    /**
5672     * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
5673     * `err` or `result` depending on the state of `result_ok`.
5674     */
5675    union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
5676    /**
5677     * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
5678     */
5679    bool result_ok;
5680 } LDKCResult_PublicKeySecp256k1ErrorZ;
5681
5682 /**
5683  * The contents of CResult_NodeIdDecodeErrorZ
5684  */
5685 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5686    /**
5687     * A pointer to the contents in the success state.
5688     * Reading from this pointer when `result_ok` is not set is undefined.
5689     */
5690    struct LDKNodeId *result;
5691    /**
5692     * A pointer to the contents in the error state.
5693     * Reading from this pointer when `result_ok` is set is undefined.
5694     */
5695    struct LDKDecodeError *err;
5696 } LDKCResult_NodeIdDecodeErrorZPtr;
5697
5698 /**
5699  * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5700  * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5701  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5702  */
5703 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5704    /**
5705     * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5706     * `err` or `result` depending on the state of `result_ok`.
5707     */
5708    union LDKCResult_NodeIdDecodeErrorZPtr contents;
5709    /**
5710     * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5711     */
5712    bool result_ok;
5713 } LDKCResult_NodeIdDecodeErrorZ;
5714
5715
5716
5717 /**
5718  * A [`channel_update`] message to be sent to or received from a peer.
5719  *
5720  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
5721  */
5722 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
5723    /**
5724     * A pointer to the opaque Rust object.
5725     * Nearly everywhere, inner must be non-null, however in places where
5726     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5727     */
5728    LDKnativeChannelUpdate *inner;
5729    /**
5730     * Indicates that this is the only struct which contains the same pointer.
5731     * Rust functions which take ownership of an object provided via an argument require
5732     * this to be true and invalidate the object pointed to by inner.
5733     */
5734    bool is_owned;
5735 } LDKChannelUpdate;
5736
5737 /**
5738  * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
5739  * return packet by a node along the route. See [BOLT #4] for details.
5740  *
5741  * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
5742  */
5743 typedef enum LDKNetworkUpdate_Tag {
5744    /**
5745     * An error indicating a `channel_update` messages should be applied via
5746     * [`NetworkGraph::update_channel`].
5747     */
5748    LDKNetworkUpdate_ChannelUpdateMessage,
5749    /**
5750     * An error indicating that a channel failed to route a payment, which should be applied via
5751     * [`NetworkGraph::channel_failed_permanent`] if permanent.
5752     */
5753    LDKNetworkUpdate_ChannelFailure,
5754    /**
5755     * An error indicating that a node failed to route a payment, which should be applied via
5756     * [`NetworkGraph::node_failed_permanent`] if permanent.
5757     */
5758    LDKNetworkUpdate_NodeFailure,
5759    /**
5760     * Must be last for serialization purposes
5761     */
5762    LDKNetworkUpdate_Sentinel,
5763 } LDKNetworkUpdate_Tag;
5764
5765 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
5766    /**
5767     * The update to apply via [`NetworkGraph::update_channel`].
5768     */
5769    struct LDKChannelUpdate msg;
5770 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
5771
5772 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
5773    /**
5774     * The short channel id of the closed channel.
5775     */
5776    uint64_t short_channel_id;
5777    /**
5778     * Whether the channel should be permanently removed or temporarily disabled until a new
5779     * `channel_update` message is received.
5780     */
5781    bool is_permanent;
5782 } LDKNetworkUpdate_LDKChannelFailure_Body;
5783
5784 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
5785    /**
5786     * The node id of the failed node.
5787     */
5788    struct LDKPublicKey node_id;
5789    /**
5790     * Whether the node should be permanently removed from consideration or can be restored
5791     * when a new `channel_update` message is received.
5792     */
5793    bool is_permanent;
5794 } LDKNetworkUpdate_LDKNodeFailure_Body;
5795
5796 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
5797    LDKNetworkUpdate_Tag tag;
5798    union {
5799       LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
5800       LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
5801       LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
5802    };
5803 } LDKNetworkUpdate;
5804
5805 /**
5806  * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
5807  */
5808 typedef enum LDKCOption_NetworkUpdateZ_Tag {
5809    /**
5810     * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
5811     */
5812    LDKCOption_NetworkUpdateZ_Some,
5813    /**
5814     * When we're in this state, this COption_NetworkUpdateZ contains nothing
5815     */
5816    LDKCOption_NetworkUpdateZ_None,
5817    /**
5818     * Must be last for serialization purposes
5819     */
5820    LDKCOption_NetworkUpdateZ_Sentinel,
5821 } LDKCOption_NetworkUpdateZ_Tag;
5822
5823 typedef struct LDKCOption_NetworkUpdateZ {
5824    LDKCOption_NetworkUpdateZ_Tag tag;
5825    union {
5826       struct {
5827          struct LDKNetworkUpdate some;
5828       };
5829    };
5830 } LDKCOption_NetworkUpdateZ;
5831
5832 /**
5833  * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5834  */
5835 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5836    /**
5837     * A pointer to the contents in the success state.
5838     * Reading from this pointer when `result_ok` is not set is undefined.
5839     */
5840    struct LDKCOption_NetworkUpdateZ *result;
5841    /**
5842     * A pointer to the contents in the error state.
5843     * Reading from this pointer when `result_ok` is set is undefined.
5844     */
5845    struct LDKDecodeError *err;
5846 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5847
5848 /**
5849  * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5850  * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5851  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5852  */
5853 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5854    /**
5855     * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5856     * `err` or `result` depending on the state of `result_ok`.
5857     */
5858    union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5859    /**
5860     * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5861     */
5862    bool result_ok;
5863 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5864
5865 /**
5866  * The contents of CResult_TxOutUtxoLookupErrorZ
5867  */
5868 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
5869    /**
5870     * A pointer to the contents in the success state.
5871     * Reading from this pointer when `result_ok` is not set is undefined.
5872     */
5873    struct LDKTxOut *result;
5874    /**
5875     * A pointer to the contents in the error state.
5876     * Reading from this pointer when `result_ok` is set is undefined.
5877     */
5878    enum LDKUtxoLookupError *err;
5879 } LDKCResult_TxOutUtxoLookupErrorZPtr;
5880
5881 /**
5882  * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
5883  * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
5884  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5885  */
5886 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
5887    /**
5888     * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
5889     * `err` or `result` depending on the state of `result_ok`.
5890     */
5891    union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
5892    /**
5893     * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
5894     */
5895    bool result_ok;
5896 } LDKCResult_TxOutUtxoLookupErrorZ;
5897
5898
5899
5900 /**
5901  * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
5902  *
5903  * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
5904  */
5905 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
5906    /**
5907     * A pointer to the opaque Rust object.
5908     * Nearly everywhere, inner must be non-null, however in places where
5909     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5910     */
5911    LDKnativeUtxoFuture *inner;
5912    /**
5913     * Indicates that this is the only struct which contains the same pointer.
5914     * Rust functions which take ownership of an object provided via an argument require
5915     * this to be true and invalidate the object pointed to by inner.
5916     */
5917    bool is_owned;
5918 } LDKUtxoFuture;
5919
5920 /**
5921  * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
5922  * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
5923  * variant.
5924  */
5925 typedef enum LDKUtxoResult_Tag {
5926    /**
5927     * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
5928     * requested or a [`UtxoLookupError`].
5929     */
5930    LDKUtxoResult_Sync,
5931    /**
5932     * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
5933     * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
5934     *
5935     * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
5936     * but only fairly loosely. Because a pending checks block all message processing, leaving
5937     * checks pending for an extended time may cause DoS of other functions. It is recommended you
5938     * keep a tight timeout on lookups, on the order of a few seconds.
5939     */
5940    LDKUtxoResult_Async,
5941    /**
5942     * Must be last for serialization purposes
5943     */
5944    LDKUtxoResult_Sentinel,
5945 } LDKUtxoResult_Tag;
5946
5947 typedef struct MUST_USE_STRUCT LDKUtxoResult {
5948    LDKUtxoResult_Tag tag;
5949    union {
5950       struct {
5951          struct LDKCResult_TxOutUtxoLookupErrorZ sync;
5952       };
5953       struct {
5954          struct LDKUtxoFuture async;
5955       };
5956    };
5957 } LDKUtxoResult;
5958
5959 /**
5960  * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
5961  */
5962 typedef struct LDKUtxoLookup {
5963    /**
5964     * An opaque pointer which is passed to your function implementations as an argument.
5965     * This has no meaning in the LDK, and can be NULL or any other value.
5966     */
5967    void *this_arg;
5968    /**
5969     * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5970     * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
5971     * unknown.
5972     *
5973     * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5974     */
5975    struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
5976    /**
5977     * Frees any resources associated with this object given its this_arg pointer.
5978     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5979     */
5980    void (*free)(void *this_arg);
5981 } LDKUtxoLookup;
5982
5983 /**
5984  * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
5985  */
5986 typedef enum LDKCOption_UtxoLookupZ_Tag {
5987    /**
5988     * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
5989     */
5990    LDKCOption_UtxoLookupZ_Some,
5991    /**
5992     * When we're in this state, this COption_UtxoLookupZ contains nothing
5993     */
5994    LDKCOption_UtxoLookupZ_None,
5995    /**
5996     * Must be last for serialization purposes
5997     */
5998    LDKCOption_UtxoLookupZ_Sentinel,
5999 } LDKCOption_UtxoLookupZ_Tag;
6000
6001 typedef struct LDKCOption_UtxoLookupZ {
6002    LDKCOption_UtxoLookupZ_Tag tag;
6003    union {
6004       struct {
6005          struct LDKUtxoLookup some;
6006       };
6007    };
6008 } LDKCOption_UtxoLookupZ;
6009
6010 /**
6011  * The contents of CResult_NoneLightningErrorZ
6012  */
6013 typedef union LDKCResult_NoneLightningErrorZPtr {
6014    /**
6015     * Note that this value is always NULL, as there are no contents in the OK variant
6016     */
6017    void *result;
6018    /**
6019     * A pointer to the contents in the error state.
6020     * Reading from this pointer when `result_ok` is set is undefined.
6021     */
6022    struct LDKLightningError *err;
6023 } LDKCResult_NoneLightningErrorZPtr;
6024
6025 /**
6026  * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
6027  * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
6028  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6029  */
6030 typedef struct LDKCResult_NoneLightningErrorZ {
6031    /**
6032     * The contents of this CResult_NoneLightningErrorZ, accessible via either
6033     * `err` or `result` depending on the state of `result_ok`.
6034     */
6035    union LDKCResult_NoneLightningErrorZPtr contents;
6036    /**
6037     * Whether this CResult_NoneLightningErrorZ represents a success state.
6038     */
6039    bool result_ok;
6040 } LDKCResult_NoneLightningErrorZ;
6041
6042 /**
6043  * The contents of CResult_boolLightningErrorZ
6044  */
6045 typedef union LDKCResult_boolLightningErrorZPtr {
6046    /**
6047     * A pointer to the contents in the success state.
6048     * Reading from this pointer when `result_ok` is not set is undefined.
6049     */
6050    bool *result;
6051    /**
6052     * A pointer to the contents in the error state.
6053     * Reading from this pointer when `result_ok` is set is undefined.
6054     */
6055    struct LDKLightningError *err;
6056 } LDKCResult_boolLightningErrorZPtr;
6057
6058 /**
6059  * A CResult_boolLightningErrorZ represents the result of a fallible operation,
6060  * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
6061  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6062  */
6063 typedef struct LDKCResult_boolLightningErrorZ {
6064    /**
6065     * The contents of this CResult_boolLightningErrorZ, accessible via either
6066     * `err` or `result` depending on the state of `result_ok`.
6067     */
6068    union LDKCResult_boolLightningErrorZPtr contents;
6069    /**
6070     * Whether this CResult_boolLightningErrorZ represents a success state.
6071     */
6072    bool result_ok;
6073 } LDKCResult_boolLightningErrorZ;
6074
6075
6076
6077 /**
6078  * A [`channel_announcement`] message to be sent to or received from a peer.
6079  *
6080  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
6081  */
6082 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
6083    /**
6084     * A pointer to the opaque Rust object.
6085     * Nearly everywhere, inner must be non-null, however in places where
6086     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6087     */
6088    LDKnativeChannelAnnouncement *inner;
6089    /**
6090     * Indicates that this is the only struct which contains the same pointer.
6091     * Rust functions which take ownership of an object provided via an argument require
6092     * this to be true and invalidate the object pointed to by inner.
6093     */
6094    bool is_owned;
6095 } LDKChannelAnnouncement;
6096
6097 /**
6098  * A tuple of 3 elements. See the individual fields for the types contained.
6099  */
6100 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
6101    /**
6102     * The element at position 0
6103     */
6104    struct LDKChannelAnnouncement a;
6105    /**
6106     * The element at position 1
6107     */
6108    struct LDKChannelUpdate b;
6109    /**
6110     * The element at position 2
6111     */
6112    struct LDKChannelUpdate c;
6113 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
6114
6115 /**
6116  * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
6117  */
6118 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
6119    /**
6120     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
6121     */
6122    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
6123    /**
6124     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
6125     */
6126    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
6127    /**
6128     * Must be last for serialization purposes
6129     */
6130    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
6131 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
6132
6133 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
6134    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
6135    union {
6136       struct {
6137          struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
6138       };
6139    };
6140 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
6141
6142
6143
6144 /**
6145  * An [`accept_channel`] message to be sent to or received from a peer.
6146  *
6147  * Used in V1 channel establishment
6148  *
6149  * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
6150  */
6151 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
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    LDKnativeAcceptChannel *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 } LDKAcceptChannel;
6165
6166
6167
6168 /**
6169  * An accept_channel2 message to be sent by or received from the channel accepter.
6170  *
6171  * Used in V2 channel establishment
6172  *
6173  */
6174 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
6175    /**
6176     * A pointer to the opaque Rust object.
6177     * Nearly everywhere, inner must be non-null, however in places where
6178     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6179     */
6180    LDKnativeAcceptChannelV2 *inner;
6181    /**
6182     * Indicates that this is the only struct which contains the same pointer.
6183     * Rust functions which take ownership of an object provided via an argument require
6184     * this to be true and invalidate the object pointed to by inner.
6185     */
6186    bool is_owned;
6187 } LDKAcceptChannelV2;
6188
6189
6190
6191 /**
6192  * An [`open_channel`] message to be sent to or received from a peer.
6193  *
6194  * Used in V1 channel establishment
6195  *
6196  * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
6197  */
6198 typedef struct MUST_USE_STRUCT LDKOpenChannel {
6199    /**
6200     * A pointer to the opaque Rust object.
6201     * Nearly everywhere, inner must be non-null, however in places where
6202     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6203     */
6204    LDKnativeOpenChannel *inner;
6205    /**
6206     * Indicates that this is the only struct which contains the same pointer.
6207     * Rust functions which take ownership of an object provided via an argument require
6208     * this to be true and invalidate the object pointed to by inner.
6209     */
6210    bool is_owned;
6211 } LDKOpenChannel;
6212
6213
6214
6215 /**
6216  * An open_channel2 message to be sent by or received from the channel initiator.
6217  *
6218  * Used in V2 channel establishment
6219  *
6220  */
6221 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
6222    /**
6223     * A pointer to the opaque Rust object.
6224     * Nearly everywhere, inner must be non-null, however in places where
6225     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6226     */
6227    LDKnativeOpenChannelV2 *inner;
6228    /**
6229     * Indicates that this is the only struct which contains the same pointer.
6230     * Rust functions which take ownership of an object provided via an argument require
6231     * this to be true and invalidate the object pointed to by inner.
6232     */
6233    bool is_owned;
6234 } LDKOpenChannelV2;
6235
6236
6237
6238 /**
6239  * A [`funding_created`] message to be sent to or received from a peer.
6240  *
6241  * Used in V1 channel establishment
6242  *
6243  * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
6244  */
6245 typedef struct MUST_USE_STRUCT LDKFundingCreated {
6246    /**
6247     * A pointer to the opaque Rust object.
6248     * Nearly everywhere, inner must be non-null, however in places where
6249     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6250     */
6251    LDKnativeFundingCreated *inner;
6252    /**
6253     * Indicates that this is the only struct which contains the same pointer.
6254     * Rust functions which take ownership of an object provided via an argument require
6255     * this to be true and invalidate the object pointed to by inner.
6256     */
6257    bool is_owned;
6258 } LDKFundingCreated;
6259
6260
6261
6262 /**
6263  * A [`funding_signed`] message to be sent to or received from a peer.
6264  *
6265  * Used in V1 channel establishment
6266  *
6267  * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
6268  */
6269 typedef struct MUST_USE_STRUCT LDKFundingSigned {
6270    /**
6271     * A pointer to the opaque Rust object.
6272     * Nearly everywhere, inner must be non-null, however in places where
6273     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6274     */
6275    LDKnativeFundingSigned *inner;
6276    /**
6277     * Indicates that this is the only struct which contains the same pointer.
6278     * Rust functions which take ownership of an object provided via an argument require
6279     * this to be true and invalidate the object pointed to by inner.
6280     */
6281    bool is_owned;
6282 } LDKFundingSigned;
6283
6284
6285
6286 /**
6287  * An stfu (quiescence) message to be sent by or received from the stfu initiator.
6288  */
6289 typedef struct MUST_USE_STRUCT LDKStfu {
6290    /**
6291     * A pointer to the opaque Rust object.
6292     * Nearly everywhere, inner must be non-null, however in places where
6293     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6294     */
6295    LDKnativeStfu *inner;
6296    /**
6297     * Indicates that this is the only struct which contains the same pointer.
6298     * Rust functions which take ownership of an object provided via an argument require
6299     * this to be true and invalidate the object pointed to by inner.
6300     */
6301    bool is_owned;
6302 } LDKStfu;
6303
6304
6305
6306 /**
6307  * A splice message to be sent by or received from the stfu initiator (splice initiator).
6308  */
6309 typedef struct MUST_USE_STRUCT LDKSplice {
6310    /**
6311     * A pointer to the opaque Rust object.
6312     * Nearly everywhere, inner must be non-null, however in places where
6313     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6314     */
6315    LDKnativeSplice *inner;
6316    /**
6317     * Indicates that this is the only struct which contains the same pointer.
6318     * Rust functions which take ownership of an object provided via an argument require
6319     * this to be true and invalidate the object pointed to by inner.
6320     */
6321    bool is_owned;
6322 } LDKSplice;
6323
6324
6325
6326 /**
6327  * A splice_ack message to be received by or sent to the splice initiator.
6328  *
6329  */
6330 typedef struct MUST_USE_STRUCT LDKSpliceAck {
6331    /**
6332     * A pointer to the opaque Rust object.
6333     * Nearly everywhere, inner must be non-null, however in places where
6334     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6335     */
6336    LDKnativeSpliceAck *inner;
6337    /**
6338     * Indicates that this is the only struct which contains the same pointer.
6339     * Rust functions which take ownership of an object provided via an argument require
6340     * this to be true and invalidate the object pointed to by inner.
6341     */
6342    bool is_owned;
6343 } LDKSpliceAck;
6344
6345
6346
6347 /**
6348  * A splice_locked message to be sent to or received from a peer.
6349  *
6350  */
6351 typedef struct MUST_USE_STRUCT LDKSpliceLocked {
6352    /**
6353     * A pointer to the opaque Rust object.
6354     * Nearly everywhere, inner must be non-null, however in places where
6355     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6356     */
6357    LDKnativeSpliceLocked *inner;
6358    /**
6359     * Indicates that this is the only struct which contains the same pointer.
6360     * Rust functions which take ownership of an object provided via an argument require
6361     * this to be true and invalidate the object pointed to by inner.
6362     */
6363    bool is_owned;
6364 } LDKSpliceLocked;
6365
6366
6367
6368 /**
6369  * A tx_add_input message for adding an input during interactive transaction construction
6370  *
6371  */
6372 typedef struct MUST_USE_STRUCT LDKTxAddInput {
6373    /**
6374     * A pointer to the opaque Rust object.
6375     * Nearly everywhere, inner must be non-null, however in places where
6376     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6377     */
6378    LDKnativeTxAddInput *inner;
6379    /**
6380     * Indicates that this is the only struct which contains the same pointer.
6381     * Rust functions which take ownership of an object provided via an argument require
6382     * this to be true and invalidate the object pointed to by inner.
6383     */
6384    bool is_owned;
6385 } LDKTxAddInput;
6386
6387
6388
6389 /**
6390  * A tx_add_output message for adding an output during interactive transaction construction.
6391  *
6392  */
6393 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
6394    /**
6395     * A pointer to the opaque Rust object.
6396     * Nearly everywhere, inner must be non-null, however in places where
6397     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6398     */
6399    LDKnativeTxAddOutput *inner;
6400    /**
6401     * Indicates that this is the only struct which contains the same pointer.
6402     * Rust functions which take ownership of an object provided via an argument require
6403     * this to be true and invalidate the object pointed to by inner.
6404     */
6405    bool is_owned;
6406 } LDKTxAddOutput;
6407
6408
6409
6410 /**
6411  * A tx_remove_input message for removing an input during interactive transaction construction.
6412  *
6413  */
6414 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
6415    /**
6416     * A pointer to the opaque Rust object.
6417     * Nearly everywhere, inner must be non-null, however in places where
6418     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6419     */
6420    LDKnativeTxRemoveInput *inner;
6421    /**
6422     * Indicates that this is the only struct which contains the same pointer.
6423     * Rust functions which take ownership of an object provided via an argument require
6424     * this to be true and invalidate the object pointed to by inner.
6425     */
6426    bool is_owned;
6427 } LDKTxRemoveInput;
6428
6429
6430
6431 /**
6432  * A tx_remove_output message for removing an output during interactive transaction construction.
6433  *
6434  */
6435 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
6436    /**
6437     * A pointer to the opaque Rust object.
6438     * Nearly everywhere, inner must be non-null, however in places where
6439     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6440     */
6441    LDKnativeTxRemoveOutput *inner;
6442    /**
6443     * Indicates that this is the only struct which contains the same pointer.
6444     * Rust functions which take ownership of an object provided via an argument require
6445     * this to be true and invalidate the object pointed to by inner.
6446     */
6447    bool is_owned;
6448 } LDKTxRemoveOutput;
6449
6450
6451
6452 /**
6453  * A tx_complete message signalling the conclusion of a peer's transaction contributions during
6454  * interactive transaction construction.
6455  *
6456  */
6457 typedef struct MUST_USE_STRUCT LDKTxComplete {
6458    /**
6459     * A pointer to the opaque Rust object.
6460     * Nearly everywhere, inner must be non-null, however in places where
6461     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6462     */
6463    LDKnativeTxComplete *inner;
6464    /**
6465     * Indicates that this is the only struct which contains the same pointer.
6466     * Rust functions which take ownership of an object provided via an argument require
6467     * this to be true and invalidate the object pointed to by inner.
6468     */
6469    bool is_owned;
6470 } LDKTxComplete;
6471
6472
6473
6474 /**
6475  * A tx_signatures message containing the sender's signatures for a transaction constructed with
6476  * interactive transaction construction.
6477  *
6478  */
6479 typedef struct MUST_USE_STRUCT LDKTxSignatures {
6480    /**
6481     * A pointer to the opaque Rust object.
6482     * Nearly everywhere, inner must be non-null, however in places where
6483     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6484     */
6485    LDKnativeTxSignatures *inner;
6486    /**
6487     * Indicates that this is the only struct which contains the same pointer.
6488     * Rust functions which take ownership of an object provided via an argument require
6489     * this to be true and invalidate the object pointed to by inner.
6490     */
6491    bool is_owned;
6492 } LDKTxSignatures;
6493
6494
6495
6496 /**
6497  * A tx_init_rbf message which initiates a replacement of the transaction after it's been
6498  * completed.
6499  *
6500  */
6501 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
6502    /**
6503     * A pointer to the opaque Rust object.
6504     * Nearly everywhere, inner must be non-null, however in places where
6505     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6506     */
6507    LDKnativeTxInitRbf *inner;
6508    /**
6509     * Indicates that this is the only struct which contains the same pointer.
6510     * Rust functions which take ownership of an object provided via an argument require
6511     * this to be true and invalidate the object pointed to by inner.
6512     */
6513    bool is_owned;
6514 } LDKTxInitRbf;
6515
6516
6517
6518 /**
6519  * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
6520  * completed.
6521  *
6522  */
6523 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
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    LDKnativeTxAckRbf *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 } LDKTxAckRbf;
6537
6538
6539
6540 /**
6541  * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
6542  *
6543  */
6544 typedef struct MUST_USE_STRUCT LDKTxAbort {
6545    /**
6546     * A pointer to the opaque Rust object.
6547     * Nearly everywhere, inner must be non-null, however in places where
6548     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6549     */
6550    LDKnativeTxAbort *inner;
6551    /**
6552     * Indicates that this is the only struct which contains the same pointer.
6553     * Rust functions which take ownership of an object provided via an argument require
6554     * this to be true and invalidate the object pointed to by inner.
6555     */
6556    bool is_owned;
6557 } LDKTxAbort;
6558
6559
6560
6561 /**
6562  * A [`channel_ready`] message to be sent to or received from a peer.
6563  *
6564  * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
6565  */
6566 typedef struct MUST_USE_STRUCT LDKChannelReady {
6567    /**
6568     * A pointer to the opaque Rust object.
6569     * Nearly everywhere, inner must be non-null, however in places where
6570     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6571     */
6572    LDKnativeChannelReady *inner;
6573    /**
6574     * Indicates that this is the only struct which contains the same pointer.
6575     * Rust functions which take ownership of an object provided via an argument require
6576     * this to be true and invalidate the object pointed to by inner.
6577     */
6578    bool is_owned;
6579 } LDKChannelReady;
6580
6581
6582
6583 /**
6584  * An [`announcement_signatures`] message to be sent to or received from a peer.
6585  *
6586  * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
6587  */
6588 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
6589    /**
6590     * A pointer to the opaque Rust object.
6591     * Nearly everywhere, inner must be non-null, however in places where
6592     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6593     */
6594    LDKnativeAnnouncementSignatures *inner;
6595    /**
6596     * Indicates that this is the only struct which contains the same pointer.
6597     * Rust functions which take ownership of an object provided via an argument require
6598     * this to be true and invalidate the object pointed to by inner.
6599     */
6600    bool is_owned;
6601 } LDKAnnouncementSignatures;
6602
6603
6604
6605 /**
6606  * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
6607  * transaction updates if they were pending.
6608  */
6609 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
6610    /**
6611     * A pointer to the opaque Rust object.
6612     * Nearly everywhere, inner must be non-null, however in places where
6613     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6614     */
6615    LDKnativeCommitmentUpdate *inner;
6616    /**
6617     * Indicates that this is the only struct which contains the same pointer.
6618     * Rust functions which take ownership of an object provided via an argument require
6619     * this to be true and invalidate the object pointed to by inner.
6620     */
6621    bool is_owned;
6622 } LDKCommitmentUpdate;
6623
6624
6625
6626 /**
6627  * A [`revoke_and_ack`] message to be sent to or received from a peer.
6628  *
6629  * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
6630  */
6631 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
6632    /**
6633     * A pointer to the opaque Rust object.
6634     * Nearly everywhere, inner must be non-null, however in places where
6635     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6636     */
6637    LDKnativeRevokeAndACK *inner;
6638    /**
6639     * Indicates that this is the only struct which contains the same pointer.
6640     * Rust functions which take ownership of an object provided via an argument require
6641     * this to be true and invalidate the object pointed to by inner.
6642     */
6643    bool is_owned;
6644 } LDKRevokeAndACK;
6645
6646
6647
6648 /**
6649  * A [`closing_signed`] message to be sent to or received from a peer.
6650  *
6651  * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
6652  */
6653 typedef struct MUST_USE_STRUCT LDKClosingSigned {
6654    /**
6655     * A pointer to the opaque Rust object.
6656     * Nearly everywhere, inner must be non-null, however in places where
6657     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6658     */
6659    LDKnativeClosingSigned *inner;
6660    /**
6661     * Indicates that this is the only struct which contains the same pointer.
6662     * Rust functions which take ownership of an object provided via an argument require
6663     * this to be true and invalidate the object pointed to by inner.
6664     */
6665    bool is_owned;
6666 } LDKClosingSigned;
6667
6668
6669
6670 /**
6671  * A [`shutdown`] message to be sent to or received from a peer.
6672  *
6673  * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
6674  */
6675 typedef struct MUST_USE_STRUCT LDKShutdown {
6676    /**
6677     * A pointer to the opaque Rust object.
6678     * Nearly everywhere, inner must be non-null, however in places where
6679     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6680     */
6681    LDKnativeShutdown *inner;
6682    /**
6683     * Indicates that this is the only struct which contains the same pointer.
6684     * Rust functions which take ownership of an object provided via an argument require
6685     * this to be true and invalidate the object pointed to by inner.
6686     */
6687    bool is_owned;
6688 } LDKShutdown;
6689
6690
6691
6692 /**
6693  * A [`channel_reestablish`] message to be sent to or received from a peer.
6694  *
6695  * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
6696  */
6697 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
6698    /**
6699     * A pointer to the opaque Rust object.
6700     * Nearly everywhere, inner must be non-null, however in places where
6701     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6702     */
6703    LDKnativeChannelReestablish *inner;
6704    /**
6705     * Indicates that this is the only struct which contains the same pointer.
6706     * Rust functions which take ownership of an object provided via an argument require
6707     * this to be true and invalidate the object pointed to by inner.
6708     */
6709    bool is_owned;
6710 } LDKChannelReestablish;
6711
6712
6713
6714 /**
6715  * A [`node_announcement`] message to be sent to or received from a peer.
6716  *
6717  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
6718  */
6719 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
6720    /**
6721     * A pointer to the opaque Rust object.
6722     * Nearly everywhere, inner must be non-null, however in places where
6723     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6724     */
6725    LDKnativeNodeAnnouncement *inner;
6726    /**
6727     * Indicates that this is the only struct which contains the same pointer.
6728     * Rust functions which take ownership of an object provided via an argument require
6729     * this to be true and invalidate the object pointed to by inner.
6730     */
6731    bool is_owned;
6732 } LDKNodeAnnouncement;
6733
6734
6735
6736 /**
6737  * An [`error`] message to be sent to or received from a peer.
6738  *
6739  * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6740  */
6741 typedef struct MUST_USE_STRUCT LDKErrorMessage {
6742    /**
6743     * A pointer to the opaque Rust object.
6744     * Nearly everywhere, inner must be non-null, however in places where
6745     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6746     */
6747    LDKnativeErrorMessage *inner;
6748    /**
6749     * Indicates that this is the only struct which contains the same pointer.
6750     * Rust functions which take ownership of an object provided via an argument require
6751     * this to be true and invalidate the object pointed to by inner.
6752     */
6753    bool is_owned;
6754 } LDKErrorMessage;
6755
6756
6757
6758 /**
6759  * A [`warning`] message to be sent to or received from a peer.
6760  *
6761  * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6762  */
6763 typedef struct MUST_USE_STRUCT LDKWarningMessage {
6764    /**
6765     * A pointer to the opaque Rust object.
6766     * Nearly everywhere, inner must be non-null, however in places where
6767     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6768     */
6769    LDKnativeWarningMessage *inner;
6770    /**
6771     * Indicates that this is the only struct which contains the same pointer.
6772     * Rust functions which take ownership of an object provided via an argument require
6773     * this to be true and invalidate the object pointed to by inner.
6774     */
6775    bool is_owned;
6776 } LDKWarningMessage;
6777
6778 /**
6779  * Used to put an error message in a [`LightningError`].
6780  */
6781 typedef enum LDKErrorAction_Tag {
6782    /**
6783     * The peer took some action which made us think they were useless. Disconnect them.
6784     */
6785    LDKErrorAction_DisconnectPeer,
6786    /**
6787     * The peer did something incorrect. Tell them without closing any channels and disconnect them.
6788     */
6789    LDKErrorAction_DisconnectPeerWithWarning,
6790    /**
6791     * The peer did something harmless that we weren't able to process, just log and ignore
6792     */
6793    LDKErrorAction_IgnoreError,
6794    /**
6795     * The peer did something harmless that we weren't able to meaningfully process.
6796     * If the error is logged, log it at the given level.
6797     */
6798    LDKErrorAction_IgnoreAndLog,
6799    /**
6800     * The peer provided us with a gossip message which we'd already seen. In most cases this
6801     * should be ignored, but it may result in the message being forwarded if it is a duplicate of
6802     * our own channel announcements.
6803     */
6804    LDKErrorAction_IgnoreDuplicateGossip,
6805    /**
6806     * The peer did something incorrect. Tell them.
6807     */
6808    LDKErrorAction_SendErrorMessage,
6809    /**
6810     * The peer did something incorrect. Tell them without closing any channels.
6811     */
6812    LDKErrorAction_SendWarningMessage,
6813    /**
6814     * Must be last for serialization purposes
6815     */
6816    LDKErrorAction_Sentinel,
6817 } LDKErrorAction_Tag;
6818
6819 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
6820    /**
6821     * An error message which we should make an effort to send before we disconnect.
6822     *
6823     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6824     */
6825    struct LDKErrorMessage msg;
6826 } LDKErrorAction_LDKDisconnectPeer_Body;
6827
6828 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
6829    /**
6830     * A warning message which we should make an effort to send before we disconnect.
6831     */
6832    struct LDKWarningMessage msg;
6833 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
6834
6835 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
6836    /**
6837     * The message to send.
6838     */
6839    struct LDKErrorMessage msg;
6840 } LDKErrorAction_LDKSendErrorMessage_Body;
6841
6842 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
6843    /**
6844     * The message to send.
6845     */
6846    struct LDKWarningMessage msg;
6847    /**
6848     * The peer may have done something harmless that we weren't able to meaningfully process,
6849     * though we should still tell them about it.
6850     * If this event is logged, log it at the given level.
6851     */
6852    enum LDKLevel log_level;
6853 } LDKErrorAction_LDKSendWarningMessage_Body;
6854
6855 typedef struct MUST_USE_STRUCT LDKErrorAction {
6856    LDKErrorAction_Tag tag;
6857    union {
6858       LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
6859       LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
6860       struct {
6861          enum LDKLevel ignore_and_log;
6862       };
6863       LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
6864       LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
6865    };
6866 } LDKErrorAction;
6867
6868
6869
6870 /**
6871  * A [`query_channel_range`] message is used to query a peer for channel
6872  * UTXOs in a range of blocks. The recipient of a query makes a best
6873  * effort to reply to the query using one or more [`ReplyChannelRange`]
6874  * messages.
6875  *
6876  * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6877  */
6878 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
6879    /**
6880     * A pointer to the opaque Rust object.
6881     * Nearly everywhere, inner must be non-null, however in places where
6882     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6883     */
6884    LDKnativeQueryChannelRange *inner;
6885    /**
6886     * Indicates that this is the only struct which contains the same pointer.
6887     * Rust functions which take ownership of an object provided via an argument require
6888     * this to be true and invalidate the object pointed to by inner.
6889     */
6890    bool is_owned;
6891 } LDKQueryChannelRange;
6892
6893
6894
6895 /**
6896  * A [`query_short_channel_ids`] message is used to query a peer for
6897  * routing gossip messages related to one or more `short_channel_id`s.
6898  *
6899  * The query recipient will reply with the latest, if available,
6900  * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
6901  * it maintains for the requested `short_channel_id`s followed by a
6902  * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
6903  * this query are encoded. We only support `encoding_type=0` uncompressed
6904  * serialization and do not support `encoding_type=1` zlib serialization.
6905  *
6906  * [`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
6907  */
6908 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
6909    /**
6910     * A pointer to the opaque Rust object.
6911     * Nearly everywhere, inner must be non-null, however in places where
6912     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6913     */
6914    LDKnativeQueryShortChannelIds *inner;
6915    /**
6916     * Indicates that this is the only struct which contains the same pointer.
6917     * Rust functions which take ownership of an object provided via an argument require
6918     * this to be true and invalidate the object pointed to by inner.
6919     */
6920    bool is_owned;
6921 } LDKQueryShortChannelIds;
6922
6923
6924
6925 /**
6926  * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
6927  * message.
6928  *
6929  * Multiple `reply_channel_range` messages can be sent in reply
6930  * to a single [`QueryChannelRange`] message. The query recipient makes a
6931  * best effort to respond based on their local network view which may
6932  * not be a perfect view of the network. The `short_channel_id`s in the
6933  * reply are encoded. We only support `encoding_type=0` uncompressed
6934  * serialization and do not support `encoding_type=1` zlib serialization.
6935  *
6936  * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6937  */
6938 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
6939    /**
6940     * A pointer to the opaque Rust object.
6941     * Nearly everywhere, inner must be non-null, however in places where
6942     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6943     */
6944    LDKnativeReplyChannelRange *inner;
6945    /**
6946     * Indicates that this is the only struct which contains the same pointer.
6947     * Rust functions which take ownership of an object provided via an argument require
6948     * this to be true and invalidate the object pointed to by inner.
6949     */
6950    bool is_owned;
6951 } LDKReplyChannelRange;
6952
6953
6954
6955 /**
6956  * A [`gossip_timestamp_filter`] message is used by a node to request
6957  * gossip relay for messages in the requested time range when the
6958  * `gossip_queries` feature has been negotiated.
6959  *
6960  * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
6961  */
6962 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6963    /**
6964     * A pointer to the opaque Rust object.
6965     * Nearly everywhere, inner must be non-null, however in places where
6966     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6967     */
6968    LDKnativeGossipTimestampFilter *inner;
6969    /**
6970     * Indicates that this is the only struct which contains the same pointer.
6971     * Rust functions which take ownership of an object provided via an argument require
6972     * this to be true and invalidate the object pointed to by inner.
6973     */
6974    bool is_owned;
6975 } LDKGossipTimestampFilter;
6976
6977 /**
6978  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
6979  * broadcast to most peers).
6980  * These events are handled by PeerManager::process_events if you are using a PeerManager.
6981  */
6982 typedef enum LDKMessageSendEvent_Tag {
6983    /**
6984     * Used to indicate that we've accepted a channel open and should send the accept_channel
6985     * message provided to the given peer.
6986     */
6987    LDKMessageSendEvent_SendAcceptChannel,
6988    /**
6989     * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
6990     * message provided to the given peer.
6991     */
6992    LDKMessageSendEvent_SendAcceptChannelV2,
6993    /**
6994     * Used to indicate that we've initiated a channel open and should send the open_channel
6995     * message provided to the given peer.
6996     */
6997    LDKMessageSendEvent_SendOpenChannel,
6998    /**
6999     * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
7000     * message provided to the given peer.
7001     */
7002    LDKMessageSendEvent_SendOpenChannelV2,
7003    /**
7004     * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
7005     */
7006    LDKMessageSendEvent_SendFundingCreated,
7007    /**
7008     * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
7009     */
7010    LDKMessageSendEvent_SendFundingSigned,
7011    /**
7012     * Used to indicate that a stfu message should be sent to the peer with the given node id.
7013     */
7014    LDKMessageSendEvent_SendStfu,
7015    /**
7016     * Used to indicate that a splice message should be sent to the peer with the given node id.
7017     */
7018    LDKMessageSendEvent_SendSplice,
7019    /**
7020     * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
7021     */
7022    LDKMessageSendEvent_SendSpliceAck,
7023    /**
7024     * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
7025     */
7026    LDKMessageSendEvent_SendSpliceLocked,
7027    /**
7028     * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
7029     */
7030    LDKMessageSendEvent_SendTxAddInput,
7031    /**
7032     * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
7033     */
7034    LDKMessageSendEvent_SendTxAddOutput,
7035    /**
7036     * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
7037     */
7038    LDKMessageSendEvent_SendTxRemoveInput,
7039    /**
7040     * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
7041     */
7042    LDKMessageSendEvent_SendTxRemoveOutput,
7043    /**
7044     * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
7045     */
7046    LDKMessageSendEvent_SendTxComplete,
7047    /**
7048     * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
7049     */
7050    LDKMessageSendEvent_SendTxSignatures,
7051    /**
7052     * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
7053     */
7054    LDKMessageSendEvent_SendTxInitRbf,
7055    /**
7056     * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
7057     */
7058    LDKMessageSendEvent_SendTxAckRbf,
7059    /**
7060     * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
7061     */
7062    LDKMessageSendEvent_SendTxAbort,
7063    /**
7064     * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
7065     */
7066    LDKMessageSendEvent_SendChannelReady,
7067    /**
7068     * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
7069     */
7070    LDKMessageSendEvent_SendAnnouncementSignatures,
7071    /**
7072     * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
7073     * message should be sent to the peer with the given node_id.
7074     */
7075    LDKMessageSendEvent_UpdateHTLCs,
7076    /**
7077     * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
7078     */
7079    LDKMessageSendEvent_SendRevokeAndACK,
7080    /**
7081     * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
7082     */
7083    LDKMessageSendEvent_SendClosingSigned,
7084    /**
7085     * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
7086     */
7087    LDKMessageSendEvent_SendShutdown,
7088    /**
7089     * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
7090     */
7091    LDKMessageSendEvent_SendChannelReestablish,
7092    /**
7093     * Used to send a channel_announcement and channel_update to a specific peer, likely on
7094     * initial connection to ensure our peers know about our channels.
7095     */
7096    LDKMessageSendEvent_SendChannelAnnouncement,
7097    /**
7098     * Used to indicate that a channel_announcement and channel_update should be broadcast to all
7099     * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
7100     *
7101     * Note that after doing so, you very likely (unless you did so very recently) want to
7102     * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
7103     * ensures that any nodes which see our channel_announcement also have a relevant
7104     * node_announcement, including relevant feature flags which may be important for routing
7105     * through or to us.
7106     *
7107     * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
7108     */
7109    LDKMessageSendEvent_BroadcastChannelAnnouncement,
7110    /**
7111     * Used to indicate that a channel_update should be broadcast to all peers.
7112     */
7113    LDKMessageSendEvent_BroadcastChannelUpdate,
7114    /**
7115     * Used to indicate that a node_announcement should be broadcast to all peers.
7116     */
7117    LDKMessageSendEvent_BroadcastNodeAnnouncement,
7118    /**
7119     * Used to indicate that a channel_update should be sent to a single peer.
7120     * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
7121     * private channel and we shouldn't be informing all of our peers of channel parameters.
7122     */
7123    LDKMessageSendEvent_SendChannelUpdate,
7124    /**
7125     * Broadcast an error downstream to be handled
7126     */
7127    LDKMessageSendEvent_HandleError,
7128    /**
7129     * Query a peer for channels with funding transaction UTXOs in a block range.
7130     */
7131    LDKMessageSendEvent_SendChannelRangeQuery,
7132    /**
7133     * Request routing gossip messages from a peer for a list of channels identified by
7134     * their short_channel_ids.
7135     */
7136    LDKMessageSendEvent_SendShortIdsQuery,
7137    /**
7138     * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
7139     * emitted during processing of the query.
7140     */
7141    LDKMessageSendEvent_SendReplyChannelRange,
7142    /**
7143     * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
7144     * enable receiving gossip messages from the peer.
7145     */
7146    LDKMessageSendEvent_SendGossipTimestampFilter,
7147    /**
7148     * Must be last for serialization purposes
7149     */
7150    LDKMessageSendEvent_Sentinel,
7151 } LDKMessageSendEvent_Tag;
7152
7153 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
7154    /**
7155     * The node_id of the node which should receive this message
7156     */
7157    struct LDKPublicKey node_id;
7158    /**
7159     * The message which should be sent.
7160     */
7161    struct LDKAcceptChannel msg;
7162 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
7163
7164 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
7165    /**
7166     * The node_id of the node which should receive this message
7167     */
7168    struct LDKPublicKey node_id;
7169    /**
7170     * The message which should be sent.
7171     */
7172    struct LDKAcceptChannelV2 msg;
7173 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
7174
7175 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
7176    /**
7177     * The node_id of the node which should receive this message
7178     */
7179    struct LDKPublicKey node_id;
7180    /**
7181     * The message which should be sent.
7182     */
7183    struct LDKOpenChannel msg;
7184 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
7185
7186 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
7187    /**
7188     * The node_id of the node which should receive this message
7189     */
7190    struct LDKPublicKey node_id;
7191    /**
7192     * The message which should be sent.
7193     */
7194    struct LDKOpenChannelV2 msg;
7195 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
7196
7197 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
7198    /**
7199     * The node_id of the node which should receive this message
7200     */
7201    struct LDKPublicKey node_id;
7202    /**
7203     * The message which should be sent.
7204     */
7205    struct LDKFundingCreated msg;
7206 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
7207
7208 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
7209    /**
7210     * The node_id of the node which should receive this message
7211     */
7212    struct LDKPublicKey node_id;
7213    /**
7214     * The message which should be sent.
7215     */
7216    struct LDKFundingSigned msg;
7217 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
7218
7219 typedef struct LDKMessageSendEvent_LDKSendStfu_Body {
7220    /**
7221     * The node_id of the node which should receive this message
7222     */
7223    struct LDKPublicKey node_id;
7224    /**
7225     * The message which should be sent.
7226     */
7227    struct LDKStfu msg;
7228 } LDKMessageSendEvent_LDKSendStfu_Body;
7229
7230 typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
7231    /**
7232     * The node_id of the node which should receive this message
7233     */
7234    struct LDKPublicKey node_id;
7235    /**
7236     * The message which should be sent.
7237     */
7238    struct LDKSplice msg;
7239 } LDKMessageSendEvent_LDKSendSplice_Body;
7240
7241 typedef struct LDKMessageSendEvent_LDKSendSpliceAck_Body {
7242    /**
7243     * The node_id of the node which should receive this message
7244     */
7245    struct LDKPublicKey node_id;
7246    /**
7247     * The message which should be sent.
7248     */
7249    struct LDKSpliceAck msg;
7250 } LDKMessageSendEvent_LDKSendSpliceAck_Body;
7251
7252 typedef struct LDKMessageSendEvent_LDKSendSpliceLocked_Body {
7253    /**
7254     * The node_id of the node which should receive this message
7255     */
7256    struct LDKPublicKey node_id;
7257    /**
7258     * The message which should be sent.
7259     */
7260    struct LDKSpliceLocked msg;
7261 } LDKMessageSendEvent_LDKSendSpliceLocked_Body;
7262
7263 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
7264    /**
7265     * The node_id of the node which should receive this message
7266     */
7267    struct LDKPublicKey node_id;
7268    /**
7269     * The message which should be sent.
7270     */
7271    struct LDKTxAddInput msg;
7272 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
7273
7274 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
7275    /**
7276     * The node_id of the node which should receive this message
7277     */
7278    struct LDKPublicKey node_id;
7279    /**
7280     * The message which should be sent.
7281     */
7282    struct LDKTxAddOutput msg;
7283 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
7284
7285 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
7286    /**
7287     * The node_id of the node which should receive this message
7288     */
7289    struct LDKPublicKey node_id;
7290    /**
7291     * The message which should be sent.
7292     */
7293    struct LDKTxRemoveInput msg;
7294 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
7295
7296 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
7297    /**
7298     * The node_id of the node which should receive this message
7299     */
7300    struct LDKPublicKey node_id;
7301    /**
7302     * The message which should be sent.
7303     */
7304    struct LDKTxRemoveOutput msg;
7305 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
7306
7307 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
7308    /**
7309     * The node_id of the node which should receive this message
7310     */
7311    struct LDKPublicKey node_id;
7312    /**
7313     * The message which should be sent.
7314     */
7315    struct LDKTxComplete msg;
7316 } LDKMessageSendEvent_LDKSendTxComplete_Body;
7317
7318 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
7319    /**
7320     * The node_id of the node which should receive this message
7321     */
7322    struct LDKPublicKey node_id;
7323    /**
7324     * The message which should be sent.
7325     */
7326    struct LDKTxSignatures msg;
7327 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
7328
7329 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
7330    /**
7331     * The node_id of the node which should receive this message
7332     */
7333    struct LDKPublicKey node_id;
7334    /**
7335     * The message which should be sent.
7336     */
7337    struct LDKTxInitRbf msg;
7338 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
7339
7340 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
7341    /**
7342     * The node_id of the node which should receive this message
7343     */
7344    struct LDKPublicKey node_id;
7345    /**
7346     * The message which should be sent.
7347     */
7348    struct LDKTxAckRbf msg;
7349 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
7350
7351 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
7352    /**
7353     * The node_id of the node which should receive this message
7354     */
7355    struct LDKPublicKey node_id;
7356    /**
7357     * The message which should be sent.
7358     */
7359    struct LDKTxAbort msg;
7360 } LDKMessageSendEvent_LDKSendTxAbort_Body;
7361
7362 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
7363    /**
7364     * The node_id of the node which should receive these message(s)
7365     */
7366    struct LDKPublicKey node_id;
7367    /**
7368     * The channel_ready message which should be sent.
7369     */
7370    struct LDKChannelReady msg;
7371 } LDKMessageSendEvent_LDKSendChannelReady_Body;
7372
7373 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
7374    /**
7375     * The node_id of the node which should receive these message(s)
7376     */
7377    struct LDKPublicKey node_id;
7378    /**
7379     * The announcement_signatures message which should be sent.
7380     */
7381    struct LDKAnnouncementSignatures msg;
7382 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
7383
7384 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
7385    /**
7386     * The node_id of the node which should receive these message(s)
7387     */
7388    struct LDKPublicKey node_id;
7389    /**
7390     * The update messages which should be sent. ALL messages in the struct should be sent!
7391     */
7392    struct LDKCommitmentUpdate updates;
7393 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
7394
7395 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
7396    /**
7397     * The node_id of the node which should receive this message
7398     */
7399    struct LDKPublicKey node_id;
7400    /**
7401     * The message which should be sent.
7402     */
7403    struct LDKRevokeAndACK msg;
7404 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
7405
7406 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
7407    /**
7408     * The node_id of the node which should receive this message
7409     */
7410    struct LDKPublicKey node_id;
7411    /**
7412     * The message which should be sent.
7413     */
7414    struct LDKClosingSigned msg;
7415 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
7416
7417 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
7418    /**
7419     * The node_id of the node which should receive this message
7420     */
7421    struct LDKPublicKey node_id;
7422    /**
7423     * The message which should be sent.
7424     */
7425    struct LDKShutdown msg;
7426 } LDKMessageSendEvent_LDKSendShutdown_Body;
7427
7428 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
7429    /**
7430     * The node_id of the node which should receive this message
7431     */
7432    struct LDKPublicKey node_id;
7433    /**
7434     * The message which should be sent.
7435     */
7436    struct LDKChannelReestablish msg;
7437 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
7438
7439 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
7440    /**
7441     * The node_id of the node which should receive this message
7442     */
7443    struct LDKPublicKey node_id;
7444    /**
7445     * The channel_announcement which should be sent.
7446     */
7447    struct LDKChannelAnnouncement msg;
7448    /**
7449     * The followup channel_update which should be sent.
7450     */
7451    struct LDKChannelUpdate update_msg;
7452 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
7453
7454 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
7455    /**
7456     * The channel_announcement which should be sent.
7457     */
7458    struct LDKChannelAnnouncement msg;
7459    /**
7460     * The followup channel_update which should be sent.
7461     *
7462     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7463     */
7464    struct LDKChannelUpdate update_msg;
7465 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
7466
7467 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
7468    /**
7469     * The channel_update which should be sent.
7470     */
7471    struct LDKChannelUpdate msg;
7472 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
7473
7474 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
7475    /**
7476     * The node_announcement which should be sent.
7477     */
7478    struct LDKNodeAnnouncement msg;
7479 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
7480
7481 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
7482    /**
7483     * The node_id of the node which should receive this message
7484     */
7485    struct LDKPublicKey node_id;
7486    /**
7487     * The channel_update which should be sent.
7488     */
7489    struct LDKChannelUpdate msg;
7490 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
7491
7492 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
7493    /**
7494     * The node_id of the node which should receive this message
7495     */
7496    struct LDKPublicKey node_id;
7497    /**
7498     * The action which should be taken.
7499     */
7500    struct LDKErrorAction action;
7501 } LDKMessageSendEvent_LDKHandleError_Body;
7502
7503 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
7504    /**
7505     * The node_id of this message recipient
7506     */
7507    struct LDKPublicKey node_id;
7508    /**
7509     * The query_channel_range which should be sent.
7510     */
7511    struct LDKQueryChannelRange msg;
7512 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
7513
7514 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
7515    /**
7516     * The node_id of this message recipient
7517     */
7518    struct LDKPublicKey node_id;
7519    /**
7520     * The query_short_channel_ids which should be sent.
7521     */
7522    struct LDKQueryShortChannelIds msg;
7523 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
7524
7525 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
7526    /**
7527     * The node_id of this message recipient
7528     */
7529    struct LDKPublicKey node_id;
7530    /**
7531     * The reply_channel_range which should be sent.
7532     */
7533    struct LDKReplyChannelRange msg;
7534 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
7535
7536 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
7537    /**
7538     * The node_id of this message recipient
7539     */
7540    struct LDKPublicKey node_id;
7541    /**
7542     * The gossip_timestamp_filter which should be sent.
7543     */
7544    struct LDKGossipTimestampFilter msg;
7545 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
7546
7547 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
7548    LDKMessageSendEvent_Tag tag;
7549    union {
7550       LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
7551       LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
7552       LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
7553       LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
7554       LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
7555       LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
7556       LDKMessageSendEvent_LDKSendStfu_Body send_stfu;
7557       LDKMessageSendEvent_LDKSendSplice_Body send_splice;
7558       LDKMessageSendEvent_LDKSendSpliceAck_Body send_splice_ack;
7559       LDKMessageSendEvent_LDKSendSpliceLocked_Body send_splice_locked;
7560       LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
7561       LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
7562       LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
7563       LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
7564       LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
7565       LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
7566       LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
7567       LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
7568       LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
7569       LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
7570       LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
7571       LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
7572       LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
7573       LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
7574       LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
7575       LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
7576       LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
7577       LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
7578       LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
7579       LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
7580       LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
7581       LDKMessageSendEvent_LDKHandleError_Body handle_error;
7582       LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
7583       LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
7584       LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
7585       LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
7586    };
7587 } LDKMessageSendEvent;
7588
7589 /**
7590  * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
7591  * This corresponds to std::vector in C++
7592  */
7593 typedef struct LDKCVec_MessageSendEventZ {
7594    /**
7595     * The elements in the array.
7596     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7597     */
7598    struct LDKMessageSendEvent *data;
7599    /**
7600     * The number of elements pointed to by `data`.
7601     */
7602    uintptr_t datalen;
7603 } LDKCVec_MessageSendEventZ;
7604
7605
7606
7607 /**
7608  * Details about one direction of a channel as received within a [`ChannelUpdate`].
7609  */
7610 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
7611    /**
7612     * A pointer to the opaque Rust object.
7613     * Nearly everywhere, inner must be non-null, however in places where
7614     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7615     */
7616    LDKnativeChannelUpdateInfo *inner;
7617    /**
7618     * Indicates that this is the only struct which contains the same pointer.
7619     * Rust functions which take ownership of an object provided via an argument require
7620     * this to be true and invalidate the object pointed to by inner.
7621     */
7622    bool is_owned;
7623 } LDKChannelUpdateInfo;
7624
7625 /**
7626  * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
7627  */
7628 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
7629    /**
7630     * A pointer to the contents in the success state.
7631     * Reading from this pointer when `result_ok` is not set is undefined.
7632     */
7633    struct LDKChannelUpdateInfo *result;
7634    /**
7635     * A pointer to the contents in the error state.
7636     * Reading from this pointer when `result_ok` is set is undefined.
7637     */
7638    struct LDKDecodeError *err;
7639 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
7640
7641 /**
7642  * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
7643  * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7644  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7645  */
7646 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
7647    /**
7648     * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
7649     * `err` or `result` depending on the state of `result_ok`.
7650     */
7651    union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
7652    /**
7653     * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
7654     */
7655    bool result_ok;
7656 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
7657
7658
7659
7660 /**
7661  * Details about a channel (both directions).
7662  * Received within a channel announcement.
7663  */
7664 typedef struct MUST_USE_STRUCT LDKChannelInfo {
7665    /**
7666     * A pointer to the opaque Rust object.
7667     * Nearly everywhere, inner must be non-null, however in places where
7668     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7669     */
7670    LDKnativeChannelInfo *inner;
7671    /**
7672     * Indicates that this is the only struct which contains the same pointer.
7673     * Rust functions which take ownership of an object provided via an argument require
7674     * this to be true and invalidate the object pointed to by inner.
7675     */
7676    bool is_owned;
7677 } LDKChannelInfo;
7678
7679 /**
7680  * The contents of CResult_ChannelInfoDecodeErrorZ
7681  */
7682 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
7683    /**
7684     * A pointer to the contents in the success state.
7685     * Reading from this pointer when `result_ok` is not set is undefined.
7686     */
7687    struct LDKChannelInfo *result;
7688    /**
7689     * A pointer to the contents in the error state.
7690     * Reading from this pointer when `result_ok` is set is undefined.
7691     */
7692    struct LDKDecodeError *err;
7693 } LDKCResult_ChannelInfoDecodeErrorZPtr;
7694
7695 /**
7696  * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
7697  * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7698  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7699  */
7700 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
7701    /**
7702     * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
7703     * `err` or `result` depending on the state of `result_ok`.
7704     */
7705    union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
7706    /**
7707     * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
7708     */
7709    bool result_ok;
7710 } LDKCResult_ChannelInfoDecodeErrorZ;
7711
7712
7713
7714 /**
7715  * Fees for routing via a given channel or a node
7716  */
7717 typedef struct MUST_USE_STRUCT LDKRoutingFees {
7718    /**
7719     * A pointer to the opaque Rust object.
7720     * Nearly everywhere, inner must be non-null, however in places where
7721     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7722     */
7723    LDKnativeRoutingFees *inner;
7724    /**
7725     * Indicates that this is the only struct which contains the same pointer.
7726     * Rust functions which take ownership of an object provided via an argument require
7727     * this to be true and invalidate the object pointed to by inner.
7728     */
7729    bool is_owned;
7730 } LDKRoutingFees;
7731
7732 /**
7733  * The contents of CResult_RoutingFeesDecodeErrorZ
7734  */
7735 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
7736    /**
7737     * A pointer to the contents in the success state.
7738     * Reading from this pointer when `result_ok` is not set is undefined.
7739     */
7740    struct LDKRoutingFees *result;
7741    /**
7742     * A pointer to the contents in the error state.
7743     * Reading from this pointer when `result_ok` is set is undefined.
7744     */
7745    struct LDKDecodeError *err;
7746 } LDKCResult_RoutingFeesDecodeErrorZPtr;
7747
7748 /**
7749  * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
7750  * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
7751  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7752  */
7753 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
7754    /**
7755     * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
7756     * `err` or `result` depending on the state of `result_ok`.
7757     */
7758    union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
7759    /**
7760     * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
7761     */
7762    bool result_ok;
7763 } LDKCResult_RoutingFeesDecodeErrorZ;
7764
7765 /**
7766  * A 4-byte byte array.
7767  */
7768 typedef struct LDKFourBytes {
7769    /**
7770     * The four bytes
7771     */
7772    uint8_t data[4];
7773 } LDKFourBytes;
7774
7775 /**
7776  * A 12-byte byte array.
7777  */
7778 typedef struct LDKTwelveBytes {
7779    /**
7780     * The twelve bytes
7781     */
7782    uint8_t data[12];
7783 } LDKTwelveBytes;
7784
7785
7786
7787 /**
7788  * Represents a hostname for serialization purposes.
7789  * Only the character set and length will be validated.
7790  * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
7791  * Its length is guaranteed to be representable by a single byte.
7792  * This serialization is used by [`BOLT 7`] hostnames.
7793  *
7794  * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
7795  */
7796 typedef struct MUST_USE_STRUCT LDKHostname {
7797    /**
7798     * A pointer to the opaque Rust object.
7799     * Nearly everywhere, inner must be non-null, however in places where
7800     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7801     */
7802    LDKnativeHostname *inner;
7803    /**
7804     * Indicates that this is the only struct which contains the same pointer.
7805     * Rust functions which take ownership of an object provided via an argument require
7806     * this to be true and invalidate the object pointed to by inner.
7807     */
7808    bool is_owned;
7809 } LDKHostname;
7810
7811 /**
7812  * An address which can be used to connect to a remote peer.
7813  */
7814 typedef enum LDKSocketAddress_Tag {
7815    /**
7816     * An IPv4 address and port on which the peer is listening.
7817     */
7818    LDKSocketAddress_TcpIpV4,
7819    /**
7820     * An IPv6 address and port on which the peer is listening.
7821     */
7822    LDKSocketAddress_TcpIpV6,
7823    /**
7824     * An old-style Tor onion address/port on which the peer is listening.
7825     *
7826     * This field is deprecated and the Tor network generally no longer supports V2 Onion
7827     * addresses. Thus, the details are not parsed here.
7828     */
7829    LDKSocketAddress_OnionV2,
7830    /**
7831     * A new-style Tor onion address/port on which the peer is listening.
7832     *
7833     * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
7834     * wrap as base32 and append \".onion\".
7835     */
7836    LDKSocketAddress_OnionV3,
7837    /**
7838     * A hostname/port on which the peer is listening.
7839     */
7840    LDKSocketAddress_Hostname,
7841    /**
7842     * Must be last for serialization purposes
7843     */
7844    LDKSocketAddress_Sentinel,
7845 } LDKSocketAddress_Tag;
7846
7847 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
7848    /**
7849     * The 4-byte IPv4 address
7850     */
7851    struct LDKFourBytes addr;
7852    /**
7853     * The port on which the node is listening
7854     */
7855    uint16_t port;
7856 } LDKSocketAddress_LDKTcpIpV4_Body;
7857
7858 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
7859    /**
7860     * The 16-byte IPv6 address
7861     */
7862    struct LDKSixteenBytes addr;
7863    /**
7864     * The port on which the node is listening
7865     */
7866    uint16_t port;
7867 } LDKSocketAddress_LDKTcpIpV6_Body;
7868
7869 typedef struct LDKSocketAddress_LDKOnionV3_Body {
7870    /**
7871     * The ed25519 long-term public key of the peer
7872     */
7873    struct LDKThirtyTwoBytes ed25519_pubkey;
7874    /**
7875     * The checksum of the pubkey and version, as included in the onion address
7876     */
7877    uint16_t checksum;
7878    /**
7879     * The version byte, as defined by the Tor Onion v3 spec.
7880     */
7881    uint8_t version;
7882    /**
7883     * The port on which the node is listening
7884     */
7885    uint16_t port;
7886 } LDKSocketAddress_LDKOnionV3_Body;
7887
7888 typedef struct LDKSocketAddress_LDKHostname_Body {
7889    /**
7890     * The hostname on which the node is listening.
7891     */
7892    struct LDKHostname hostname;
7893    /**
7894     * The port on which the node is listening.
7895     */
7896    uint16_t port;
7897 } LDKSocketAddress_LDKHostname_Body;
7898
7899 typedef struct MUST_USE_STRUCT LDKSocketAddress {
7900    LDKSocketAddress_Tag tag;
7901    union {
7902       LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
7903       LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
7904       struct {
7905          struct LDKTwelveBytes onion_v2;
7906       };
7907       LDKSocketAddress_LDKOnionV3_Body onion_v3;
7908       LDKSocketAddress_LDKHostname_Body hostname;
7909    };
7910 } LDKSocketAddress;
7911
7912 /**
7913  * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
7914  * This corresponds to std::vector in C++
7915  */
7916 typedef struct LDKCVec_SocketAddressZ {
7917    /**
7918     * The elements in the array.
7919     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7920     */
7921    struct LDKSocketAddress *data;
7922    /**
7923     * The number of elements pointed to by `data`.
7924     */
7925    uintptr_t datalen;
7926 } LDKCVec_SocketAddressZ;
7927
7928
7929
7930 /**
7931  * Information received in the latest node_announcement from this node.
7932  */
7933 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
7934    /**
7935     * A pointer to the opaque Rust object.
7936     * Nearly everywhere, inner must be non-null, however in places where
7937     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7938     */
7939    LDKnativeNodeAnnouncementInfo *inner;
7940    /**
7941     * Indicates that this is the only struct which contains the same pointer.
7942     * Rust functions which take ownership of an object provided via an argument require
7943     * this to be true and invalidate the object pointed to by inner.
7944     */
7945    bool is_owned;
7946 } LDKNodeAnnouncementInfo;
7947
7948 /**
7949  * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
7950  */
7951 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
7952    /**
7953     * A pointer to the contents in the success state.
7954     * Reading from this pointer when `result_ok` is not set is undefined.
7955     */
7956    struct LDKNodeAnnouncementInfo *result;
7957    /**
7958     * A pointer to the contents in the error state.
7959     * Reading from this pointer when `result_ok` is set is undefined.
7960     */
7961    struct LDKDecodeError *err;
7962 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
7963
7964 /**
7965  * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
7966  * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7967  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7968  */
7969 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
7970    /**
7971     * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
7972     * `err` or `result` depending on the state of `result_ok`.
7973     */
7974    union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
7975    /**
7976     * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
7977     */
7978    bool result_ok;
7979 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
7980
7981
7982
7983 /**
7984  * A user-defined name for a node, which may be used when displaying the node in a graph.
7985  *
7986  * Since node aliases are provided by third parties, they are a potential avenue for injection
7987  * attacks. Care must be taken when processing.
7988  */
7989 typedef struct MUST_USE_STRUCT LDKNodeAlias {
7990    /**
7991     * A pointer to the opaque Rust object.
7992     * Nearly everywhere, inner must be non-null, however in places where
7993     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7994     */
7995    LDKnativeNodeAlias *inner;
7996    /**
7997     * Indicates that this is the only struct which contains the same pointer.
7998     * Rust functions which take ownership of an object provided via an argument require
7999     * this to be true and invalidate the object pointed to by inner.
8000     */
8001    bool is_owned;
8002 } LDKNodeAlias;
8003
8004 /**
8005  * The contents of CResult_NodeAliasDecodeErrorZ
8006  */
8007 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
8008    /**
8009     * A pointer to the contents in the success state.
8010     * Reading from this pointer when `result_ok` is not set is undefined.
8011     */
8012    struct LDKNodeAlias *result;
8013    /**
8014     * A pointer to the contents in the error state.
8015     * Reading from this pointer when `result_ok` is set is undefined.
8016     */
8017    struct LDKDecodeError *err;
8018 } LDKCResult_NodeAliasDecodeErrorZPtr;
8019
8020 /**
8021  * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
8022  * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
8023  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8024  */
8025 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
8026    /**
8027     * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
8028     * `err` or `result` depending on the state of `result_ok`.
8029     */
8030    union LDKCResult_NodeAliasDecodeErrorZPtr contents;
8031    /**
8032     * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
8033     */
8034    bool result_ok;
8035 } LDKCResult_NodeAliasDecodeErrorZ;
8036
8037
8038
8039 /**
8040  * Details about a node in the network, known from the network announcement.
8041  */
8042 typedef struct MUST_USE_STRUCT LDKNodeInfo {
8043    /**
8044     * A pointer to the opaque Rust object.
8045     * Nearly everywhere, inner must be non-null, however in places where
8046     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8047     */
8048    LDKnativeNodeInfo *inner;
8049    /**
8050     * Indicates that this is the only struct which contains the same pointer.
8051     * Rust functions which take ownership of an object provided via an argument require
8052     * this to be true and invalidate the object pointed to by inner.
8053     */
8054    bool is_owned;
8055 } LDKNodeInfo;
8056
8057 /**
8058  * The contents of CResult_NodeInfoDecodeErrorZ
8059  */
8060 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
8061    /**
8062     * A pointer to the contents in the success state.
8063     * Reading from this pointer when `result_ok` is not set is undefined.
8064     */
8065    struct LDKNodeInfo *result;
8066    /**
8067     * A pointer to the contents in the error state.
8068     * Reading from this pointer when `result_ok` is set is undefined.
8069     */
8070    struct LDKDecodeError *err;
8071 } LDKCResult_NodeInfoDecodeErrorZPtr;
8072
8073 /**
8074  * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
8075  * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8076  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8077  */
8078 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
8079    /**
8080     * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
8081     * `err` or `result` depending on the state of `result_ok`.
8082     */
8083    union LDKCResult_NodeInfoDecodeErrorZPtr contents;
8084    /**
8085     * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
8086     */
8087    bool result_ok;
8088 } LDKCResult_NodeInfoDecodeErrorZ;
8089
8090 /**
8091  * The contents of CResult_NetworkGraphDecodeErrorZ
8092  */
8093 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
8094    /**
8095     * A pointer to the contents in the success state.
8096     * Reading from this pointer when `result_ok` is not set is undefined.
8097     */
8098    struct LDKNetworkGraph *result;
8099    /**
8100     * A pointer to the contents in the error state.
8101     * Reading from this pointer when `result_ok` is set is undefined.
8102     */
8103    struct LDKDecodeError *err;
8104 } LDKCResult_NetworkGraphDecodeErrorZPtr;
8105
8106 /**
8107  * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
8108  * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
8109  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8110  */
8111 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
8112    /**
8113     * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
8114     * `err` or `result` depending on the state of `result_ok`.
8115     */
8116    union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
8117    /**
8118     * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
8119     */
8120    bool result_ok;
8121 } LDKCResult_NetworkGraphDecodeErrorZ;
8122
8123 /**
8124  * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
8125  */
8126 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
8127    /**
8128     * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
8129     */
8130    LDKCOption_CVec_SocketAddressZZ_Some,
8131    /**
8132     * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
8133     */
8134    LDKCOption_CVec_SocketAddressZZ_None,
8135    /**
8136     * Must be last for serialization purposes
8137     */
8138    LDKCOption_CVec_SocketAddressZZ_Sentinel,
8139 } LDKCOption_CVec_SocketAddressZZ_Tag;
8140
8141 typedef struct LDKCOption_CVec_SocketAddressZZ {
8142    LDKCOption_CVec_SocketAddressZZ_Tag tag;
8143    union {
8144       struct {
8145          struct LDKCVec_SocketAddressZ some;
8146       };
8147    };
8148 } LDKCOption_CVec_SocketAddressZZ;
8149
8150
8151
8152 /**
8153  * Information about an incoming HTLC, including the [`PendingHTLCRouting`] describing where it
8154  * should go next.
8155  */
8156 typedef struct MUST_USE_STRUCT LDKPendingHTLCInfo {
8157    /**
8158     * A pointer to the opaque Rust object.
8159     * Nearly everywhere, inner must be non-null, however in places where
8160     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8161     */
8162    LDKnativePendingHTLCInfo *inner;
8163    /**
8164     * Indicates that this is the only struct which contains the same pointer.
8165     * Rust functions which take ownership of an object provided via an argument require
8166     * this to be true and invalidate the object pointed to by inner.
8167     */
8168    bool is_owned;
8169 } LDKPendingHTLCInfo;
8170
8171
8172
8173 /**
8174  * Invalid inbound onion payment.
8175  */
8176 typedef struct MUST_USE_STRUCT LDKInboundHTLCErr {
8177    /**
8178     * A pointer to the opaque Rust object.
8179     * Nearly everywhere, inner must be non-null, however in places where
8180     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8181     */
8182    LDKnativeInboundHTLCErr *inner;
8183    /**
8184     * Indicates that this is the only struct which contains the same pointer.
8185     * Rust functions which take ownership of an object provided via an argument require
8186     * this to be true and invalidate the object pointed to by inner.
8187     */
8188    bool is_owned;
8189 } LDKInboundHTLCErr;
8190
8191 /**
8192  * The contents of CResult_PendingHTLCInfoInboundHTLCErrZ
8193  */
8194 typedef union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr {
8195    /**
8196     * A pointer to the contents in the success state.
8197     * Reading from this pointer when `result_ok` is not set is undefined.
8198     */
8199    struct LDKPendingHTLCInfo *result;
8200    /**
8201     * A pointer to the contents in the error state.
8202     * Reading from this pointer when `result_ok` is set is undefined.
8203     */
8204    struct LDKInboundHTLCErr *err;
8205 } LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr;
8206
8207 /**
8208  * A CResult_PendingHTLCInfoInboundHTLCErrZ represents the result of a fallible operation,
8209  * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::onion_payment::InboundHTLCErr on failure.
8210  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8211  */
8212 typedef struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ {
8213    /**
8214     * The contents of this CResult_PendingHTLCInfoInboundHTLCErrZ, accessible via either
8215     * `err` or `result` depending on the state of `result_ok`.
8216     */
8217    union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr contents;
8218    /**
8219     * Whether this CResult_PendingHTLCInfoInboundHTLCErrZ represents a success state.
8220     */
8221    bool result_ok;
8222 } LDKCResult_PendingHTLCInfoInboundHTLCErrZ;
8223
8224 /**
8225  * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
8226  * This corresponds to std::vector in C++
8227  */
8228 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
8229    /**
8230     * The elements in the array.
8231     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8232     */
8233    struct LDKHTLCOutputInCommitment *data;
8234    /**
8235     * The number of elements pointed to by `data`.
8236     */
8237    uintptr_t datalen;
8238 } LDKCVec_HTLCOutputInCommitmentZ;
8239
8240 /**
8241  * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
8242  * This corresponds to std::vector in C++
8243  */
8244 typedef struct LDKCVec_HTLCDescriptorZ {
8245    /**
8246     * The elements in the array.
8247     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8248     */
8249    struct LDKHTLCDescriptor *data;
8250    /**
8251     * The number of elements pointed to by `data`.
8252     */
8253    uintptr_t datalen;
8254 } LDKCVec_HTLCDescriptorZ;
8255
8256
8257
8258 /**
8259  * An unspent transaction output that is available to spend resulting from a successful
8260  * [`CoinSelection`] attempt.
8261  */
8262 typedef struct MUST_USE_STRUCT LDKUtxo {
8263    /**
8264     * A pointer to the opaque Rust object.
8265     * Nearly everywhere, inner must be non-null, however in places where
8266     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8267     */
8268    LDKnativeUtxo *inner;
8269    /**
8270     * Indicates that this is the only struct which contains the same pointer.
8271     * Rust functions which take ownership of an object provided via an argument require
8272     * this to be true and invalidate the object pointed to by inner.
8273     */
8274    bool is_owned;
8275 } LDKUtxo;
8276
8277 /**
8278  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
8279  * This corresponds to std::vector in C++
8280  */
8281 typedef struct LDKCVec_UtxoZ {
8282    /**
8283     * The elements in the array.
8284     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8285     */
8286    struct LDKUtxo *data;
8287    /**
8288     * The number of elements pointed to by `data`.
8289     */
8290    uintptr_t datalen;
8291 } LDKCVec_UtxoZ;
8292
8293 /**
8294  * An enum which can either contain a crate::c_types::TxOut or not
8295  */
8296 typedef enum LDKCOption_TxOutZ_Tag {
8297    /**
8298     * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
8299     */
8300    LDKCOption_TxOutZ_Some,
8301    /**
8302     * When we're in this state, this COption_TxOutZ contains nothing
8303     */
8304    LDKCOption_TxOutZ_None,
8305    /**
8306     * Must be last for serialization purposes
8307     */
8308    LDKCOption_TxOutZ_Sentinel,
8309 } LDKCOption_TxOutZ_Tag;
8310
8311 typedef struct LDKCOption_TxOutZ {
8312    LDKCOption_TxOutZ_Tag tag;
8313    union {
8314       struct {
8315          struct LDKTxOut some;
8316       };
8317    };
8318 } LDKCOption_TxOutZ;
8319
8320
8321
8322 /**
8323  * An input that must be included in a transaction when performing coin selection through
8324  * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
8325  * must have an empty [`TxIn::script_sig`] when spent.
8326  */
8327 typedef struct MUST_USE_STRUCT LDKInput {
8328    /**
8329     * A pointer to the opaque Rust object.
8330     * Nearly everywhere, inner must be non-null, however in places where
8331     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8332     */
8333    LDKnativeInput *inner;
8334    /**
8335     * Indicates that this is the only struct which contains the same pointer.
8336     * Rust functions which take ownership of an object provided via an argument require
8337     * this to be true and invalidate the object pointed to by inner.
8338     */
8339    bool is_owned;
8340 } LDKInput;
8341
8342 /**
8343  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
8344  * This corresponds to std::vector in C++
8345  */
8346 typedef struct LDKCVec_InputZ {
8347    /**
8348     * The elements in the array.
8349     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8350     */
8351    struct LDKInput *data;
8352    /**
8353     * The number of elements pointed to by `data`.
8354     */
8355    uintptr_t datalen;
8356 } LDKCVec_InputZ;
8357
8358
8359
8360 /**
8361  * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
8362  * to cover its fees.
8363  */
8364 typedef struct MUST_USE_STRUCT LDKCoinSelection {
8365    /**
8366     * A pointer to the opaque Rust object.
8367     * Nearly everywhere, inner must be non-null, however in places where
8368     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8369     */
8370    LDKnativeCoinSelection *inner;
8371    /**
8372     * Indicates that this is the only struct which contains the same pointer.
8373     * Rust functions which take ownership of an object provided via an argument require
8374     * this to be true and invalidate the object pointed to by inner.
8375     */
8376    bool is_owned;
8377 } LDKCoinSelection;
8378
8379 /**
8380  * The contents of CResult_CoinSelectionNoneZ
8381  */
8382 typedef union LDKCResult_CoinSelectionNoneZPtr {
8383    /**
8384     * A pointer to the contents in the success state.
8385     * Reading from this pointer when `result_ok` is not set is undefined.
8386     */
8387    struct LDKCoinSelection *result;
8388    /**
8389     * Note that this value is always NULL, as there are no contents in the Err variant
8390     */
8391    void *err;
8392 } LDKCResult_CoinSelectionNoneZPtr;
8393
8394 /**
8395  * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
8396  * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
8397  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8398  */
8399 typedef struct LDKCResult_CoinSelectionNoneZ {
8400    /**
8401     * The contents of this CResult_CoinSelectionNoneZ, accessible via either
8402     * `err` or `result` depending on the state of `result_ok`.
8403     */
8404    union LDKCResult_CoinSelectionNoneZPtr contents;
8405    /**
8406     * Whether this CResult_CoinSelectionNoneZ represents a success state.
8407     */
8408    bool result_ok;
8409 } LDKCResult_CoinSelectionNoneZ;
8410
8411 /**
8412  * The contents of CResult_CVec_UtxoZNoneZ
8413  */
8414 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
8415    /**
8416     * A pointer to the contents in the success state.
8417     * Reading from this pointer when `result_ok` is not set is undefined.
8418     */
8419    struct LDKCVec_UtxoZ *result;
8420    /**
8421     * Note that this value is always NULL, as there are no contents in the Err variant
8422     */
8423    void *err;
8424 } LDKCResult_CVec_UtxoZNoneZPtr;
8425
8426 /**
8427  * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
8428  * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
8429  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8430  */
8431 typedef struct LDKCResult_CVec_UtxoZNoneZ {
8432    /**
8433     * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
8434     * `err` or `result` depending on the state of `result_ok`.
8435     */
8436    union LDKCResult_CVec_UtxoZNoneZPtr contents;
8437    /**
8438     * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
8439     */
8440    bool result_ok;
8441 } LDKCResult_CVec_UtxoZNoneZ;
8442
8443 /**
8444  * A tuple of 2 elements. See the individual fields for the types contained.
8445  */
8446 typedef struct LDKC2Tuple_u64u16Z {
8447    /**
8448     * The element at position 0
8449     */
8450    uint64_t a;
8451    /**
8452     * The element at position 1
8453     */
8454    uint16_t b;
8455 } LDKC2Tuple_u64u16Z;
8456
8457 /**
8458  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
8459  */
8460 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
8461    /**
8462     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
8463     */
8464    LDKCOption_C2Tuple_u64u16ZZ_Some,
8465    /**
8466     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
8467     */
8468    LDKCOption_C2Tuple_u64u16ZZ_None,
8469    /**
8470     * Must be last for serialization purposes
8471     */
8472    LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
8473 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
8474
8475 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
8476    LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
8477    union {
8478       struct {
8479          struct LDKC2Tuple_u64u16Z some;
8480       };
8481    };
8482 } LDKCOption_C2Tuple_u64u16ZZ;
8483
8484 /**
8485  * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
8486  */
8487 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
8488    /**
8489     * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
8490     */
8491    LDKCOption_ChannelShutdownStateZ_Some,
8492    /**
8493     * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
8494     */
8495    LDKCOption_ChannelShutdownStateZ_None,
8496    /**
8497     * Must be last for serialization purposes
8498     */
8499    LDKCOption_ChannelShutdownStateZ_Sentinel,
8500 } LDKCOption_ChannelShutdownStateZ_Tag;
8501
8502 typedef struct LDKCOption_ChannelShutdownStateZ {
8503    LDKCOption_ChannelShutdownStateZ_Tag tag;
8504    union {
8505       struct {
8506          enum LDKChannelShutdownState some;
8507       };
8508    };
8509 } LDKCOption_ChannelShutdownStateZ;
8510
8511 /**
8512  * The contents of CResult_ThirtyTwoBytesAPIErrorZ
8513  */
8514 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
8515    /**
8516     * A pointer to the contents in the success state.
8517     * Reading from this pointer when `result_ok` is not set is undefined.
8518     */
8519    struct LDKThirtyTwoBytes *result;
8520    /**
8521     * A pointer to the contents in the error state.
8522     * Reading from this pointer when `result_ok` is set is undefined.
8523     */
8524    struct LDKAPIError *err;
8525 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
8526
8527 /**
8528  * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
8529  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8530  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8531  */
8532 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
8533    /**
8534     * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
8535     * `err` or `result` depending on the state of `result_ok`.
8536     */
8537    union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
8538    /**
8539     * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
8540     */
8541    bool result_ok;
8542 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
8543
8544 /**
8545  * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
8546  * These include payments that have yet to find a successful path, or have unresolved HTLCs.
8547  */
8548 typedef enum LDKRecentPaymentDetails_Tag {
8549    /**
8550     * When an invoice was requested and thus a payment has not yet been sent.
8551     */
8552    LDKRecentPaymentDetails_AwaitingInvoice,
8553    /**
8554     * When a payment is still being sent and awaiting successful delivery.
8555     */
8556    LDKRecentPaymentDetails_Pending,
8557    /**
8558     * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
8559     * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
8560     * payment is removed from tracking.
8561     */
8562    LDKRecentPaymentDetails_Fulfilled,
8563    /**
8564     * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
8565     * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
8566     * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
8567     */
8568    LDKRecentPaymentDetails_Abandoned,
8569    /**
8570     * Must be last for serialization purposes
8571     */
8572    LDKRecentPaymentDetails_Sentinel,
8573 } LDKRecentPaymentDetails_Tag;
8574
8575 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
8576    /**
8577     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8578     * a payment and ensure idempotency in LDK.
8579     */
8580    struct LDKThirtyTwoBytes payment_id;
8581 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
8582
8583 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
8584    /**
8585     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8586     * a payment and ensure idempotency in LDK.
8587     */
8588    struct LDKThirtyTwoBytes payment_id;
8589    /**
8590     * Hash of the payment that is currently being sent but has yet to be fulfilled or
8591     * abandoned.
8592     */
8593    struct LDKThirtyTwoBytes payment_hash;
8594    /**
8595     * Total amount (in msat, excluding fees) across all paths for this payment,
8596     * not just the amount currently inflight.
8597     */
8598    uint64_t total_msat;
8599 } LDKRecentPaymentDetails_LDKPending_Body;
8600
8601 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
8602    /**
8603     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8604     * a payment and ensure idempotency in LDK.
8605     */
8606    struct LDKThirtyTwoBytes payment_id;
8607    /**
8608     * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
8609     * made before LDK version 0.0.104.
8610     */
8611    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
8612 } LDKRecentPaymentDetails_LDKFulfilled_Body;
8613
8614 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
8615    /**
8616     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8617     * a payment and ensure idempotency in LDK.
8618     */
8619    struct LDKThirtyTwoBytes payment_id;
8620    /**
8621     * Hash of the payment that we have given up trying to send.
8622     */
8623    struct LDKThirtyTwoBytes payment_hash;
8624 } LDKRecentPaymentDetails_LDKAbandoned_Body;
8625
8626 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
8627    LDKRecentPaymentDetails_Tag tag;
8628    union {
8629       LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
8630       LDKRecentPaymentDetails_LDKPending_Body pending;
8631       LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
8632       LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
8633    };
8634 } LDKRecentPaymentDetails;
8635
8636 /**
8637  * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
8638  * This corresponds to std::vector in C++
8639  */
8640 typedef struct LDKCVec_RecentPaymentDetailsZ {
8641    /**
8642     * The elements in the array.
8643     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8644     */
8645    struct LDKRecentPaymentDetails *data;
8646    /**
8647     * The number of elements pointed to by `data`.
8648     */
8649    uintptr_t datalen;
8650 } LDKCVec_RecentPaymentDetailsZ;
8651
8652 /**
8653  * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
8654  * of several states. This enum is returned as the Err() type describing which state the payment
8655  * is in, see the description of individual enum states for more.
8656  *
8657  * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
8658  */
8659 typedef enum LDKPaymentSendFailure_Tag {
8660    /**
8661     * A parameter which was passed to send_payment was invalid, preventing us from attempting to
8662     * send the payment at all.
8663     *
8664     * You can freely resend the payment in full (with the parameter error fixed).
8665     *
8666     * Because the payment failed outright, no payment tracking is done and no
8667     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8668     *
8669     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8670     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8671     */
8672    LDKPaymentSendFailure_ParameterError,
8673    /**
8674     * A parameter in a single path which was passed to send_payment was invalid, preventing us
8675     * from attempting to send the payment at all.
8676     *
8677     * You can freely resend the payment in full (with the parameter error fixed).
8678     *
8679     * Because the payment failed outright, no payment tracking is done and no
8680     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8681     *
8682     * The results here are ordered the same as the paths in the route object which was passed to
8683     * send_payment.
8684     *
8685     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8686     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8687     */
8688    LDKPaymentSendFailure_PathParameterError,
8689    /**
8690     * All paths which were attempted failed to send, with no channel state change taking place.
8691     * You can freely resend the payment in full (though you probably want to do so over different
8692     * paths than the ones selected).
8693     *
8694     * Because the payment failed outright, no payment tracking is done and no
8695     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8696     *
8697     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8698     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8699     */
8700    LDKPaymentSendFailure_AllFailedResendSafe,
8701    /**
8702     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
8703     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
8704     *
8705     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
8706     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
8707     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8708     */
8709    LDKPaymentSendFailure_DuplicatePayment,
8710    /**
8711     * Some paths that were attempted failed to send, though some paths may have succeeded. At least
8712     * some paths have irrevocably committed to the HTLC.
8713     *
8714     * The results here are ordered the same as the paths in the route object that was passed to
8715     * send_payment.
8716     *
8717     * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
8718     * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
8719     *
8720     * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
8721     */
8722    LDKPaymentSendFailure_PartialFailure,
8723    /**
8724     * Must be last for serialization purposes
8725     */
8726    LDKPaymentSendFailure_Sentinel,
8727 } LDKPaymentSendFailure_Tag;
8728
8729 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
8730    /**
8731     * The errors themselves, in the same order as the paths from the route.
8732     */
8733    struct LDKCVec_CResult_NoneAPIErrorZZ results;
8734    /**
8735     * If some paths failed without irrevocably committing to the new HTLC(s), this will
8736     * contain a [`RouteParameters`] object for the failing paths.
8737     *
8738     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8739     */
8740    struct LDKRouteParameters failed_paths_retry;
8741    /**
8742     * The payment id for the payment, which is now at least partially pending.
8743     */
8744    struct LDKThirtyTwoBytes payment_id;
8745 } LDKPaymentSendFailure_LDKPartialFailure_Body;
8746
8747 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
8748    LDKPaymentSendFailure_Tag tag;
8749    union {
8750       struct {
8751          struct LDKAPIError parameter_error;
8752       };
8753       struct {
8754          struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
8755       };
8756       struct {
8757          struct LDKCVec_APIErrorZ all_failed_resend_safe;
8758       };
8759       LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
8760    };
8761 } LDKPaymentSendFailure;
8762
8763 /**
8764  * The contents of CResult_NonePaymentSendFailureZ
8765  */
8766 typedef union LDKCResult_NonePaymentSendFailureZPtr {
8767    /**
8768     * Note that this value is always NULL, as there are no contents in the OK variant
8769     */
8770    void *result;
8771    /**
8772     * A pointer to the contents in the error state.
8773     * Reading from this pointer when `result_ok` is set is undefined.
8774     */
8775    struct LDKPaymentSendFailure *err;
8776 } LDKCResult_NonePaymentSendFailureZPtr;
8777
8778 /**
8779  * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
8780  * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8781  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8782  */
8783 typedef struct LDKCResult_NonePaymentSendFailureZ {
8784    /**
8785     * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
8786     * `err` or `result` depending on the state of `result_ok`.
8787     */
8788    union LDKCResult_NonePaymentSendFailureZPtr contents;
8789    /**
8790     * Whether this CResult_NonePaymentSendFailureZ represents a success state.
8791     */
8792    bool result_ok;
8793 } LDKCResult_NonePaymentSendFailureZ;
8794
8795 /**
8796  * The contents of CResult_NoneRetryableSendFailureZ
8797  */
8798 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
8799    /**
8800     * Note that this value is always NULL, as there are no contents in the OK variant
8801     */
8802    void *result;
8803    /**
8804     * A pointer to the contents in the error state.
8805     * Reading from this pointer when `result_ok` is set is undefined.
8806     */
8807    enum LDKRetryableSendFailure *err;
8808 } LDKCResult_NoneRetryableSendFailureZPtr;
8809
8810 /**
8811  * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
8812  * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8813  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8814  */
8815 typedef struct LDKCResult_NoneRetryableSendFailureZ {
8816    /**
8817     * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
8818     * `err` or `result` depending on the state of `result_ok`.
8819     */
8820    union LDKCResult_NoneRetryableSendFailureZPtr contents;
8821    /**
8822     * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
8823     */
8824    bool result_ok;
8825 } LDKCResult_NoneRetryableSendFailureZ;
8826
8827 /**
8828  * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
8829  */
8830 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
8831    /**
8832     * A pointer to the contents in the success state.
8833     * Reading from this pointer when `result_ok` is not set is undefined.
8834     */
8835    struct LDKThirtyTwoBytes *result;
8836    /**
8837     * A pointer to the contents in the error state.
8838     * Reading from this pointer when `result_ok` is set is undefined.
8839     */
8840    struct LDKPaymentSendFailure *err;
8841 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
8842
8843 /**
8844  * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
8845  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8846  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8847  */
8848 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
8849    /**
8850     * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
8851     * `err` or `result` depending on the state of `result_ok`.
8852     */
8853    union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
8854    /**
8855     * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
8856     */
8857    bool result_ok;
8858 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
8859
8860 /**
8861  * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
8862  */
8863 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
8864    /**
8865     * A pointer to the contents in the success state.
8866     * Reading from this pointer when `result_ok` is not set is undefined.
8867     */
8868    struct LDKThirtyTwoBytes *result;
8869    /**
8870     * A pointer to the contents in the error state.
8871     * Reading from this pointer when `result_ok` is set is undefined.
8872     */
8873    enum LDKRetryableSendFailure *err;
8874 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
8875
8876 /**
8877  * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
8878  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8879  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8880  */
8881 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
8882    /**
8883     * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
8884     * `err` or `result` depending on the state of `result_ok`.
8885     */
8886    union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
8887    /**
8888     * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
8889     */
8890    bool result_ok;
8891 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
8892
8893 /**
8894  * A tuple of 2 elements. See the individual fields for the types contained.
8895  */
8896 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
8897    /**
8898     * The element at position 0
8899     */
8900    struct LDKThirtyTwoBytes a;
8901    /**
8902     * The element at position 1
8903     */
8904    struct LDKThirtyTwoBytes b;
8905 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
8906
8907 /**
8908  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
8909  */
8910 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
8911    /**
8912     * A pointer to the contents in the success state.
8913     * Reading from this pointer when `result_ok` is not set is undefined.
8914     */
8915    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8916    /**
8917     * A pointer to the contents in the error state.
8918     * Reading from this pointer when `result_ok` is set is undefined.
8919     */
8920    struct LDKPaymentSendFailure *err;
8921 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
8922
8923 /**
8924  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
8925  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8926  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8927  */
8928 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
8929    /**
8930     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
8931     * `err` or `result` depending on the state of `result_ok`.
8932     */
8933    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
8934    /**
8935     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
8936     */
8937    bool result_ok;
8938 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
8939
8940 /**
8941  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
8942  * This corresponds to std::vector in C++
8943  */
8944 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
8945    /**
8946     * The elements in the array.
8947     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8948     */
8949    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
8950    /**
8951     * The number of elements pointed to by `data`.
8952     */
8953    uintptr_t datalen;
8954 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
8955
8956 /**
8957  * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
8958  * [`Event::ProbeFailed`].
8959  *
8960  * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
8961  */
8962 typedef enum LDKProbeSendFailure_Tag {
8963    /**
8964     * We were unable to find a route to the destination.
8965     */
8966    LDKProbeSendFailure_RouteNotFound,
8967    /**
8968     * We failed to send the payment probes.
8969     */
8970    LDKProbeSendFailure_SendingFailed,
8971    /**
8972     * Must be last for serialization purposes
8973     */
8974    LDKProbeSendFailure_Sentinel,
8975 } LDKProbeSendFailure_Tag;
8976
8977 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
8978    LDKProbeSendFailure_Tag tag;
8979    union {
8980       struct {
8981          struct LDKPaymentSendFailure sending_failed;
8982       };
8983    };
8984 } LDKProbeSendFailure;
8985
8986 /**
8987  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
8988  */
8989 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
8990    /**
8991     * A pointer to the contents in the success state.
8992     * Reading from this pointer when `result_ok` is not set is undefined.
8993     */
8994    struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
8995    /**
8996     * A pointer to the contents in the error state.
8997     * Reading from this pointer when `result_ok` is set is undefined.
8998     */
8999    struct LDKProbeSendFailure *err;
9000 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
9001
9002 /**
9003  * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
9004  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
9005  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9006  */
9007 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
9008    /**
9009     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
9010     * `err` or `result` depending on the state of `result_ok`.
9011     */
9012    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
9013    /**
9014     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
9015     */
9016    bool result_ok;
9017 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
9018
9019 /**
9020  * A tuple of 2 elements. See the individual fields for the types contained.
9021  */
9022 typedef struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ {
9023    /**
9024     * The element at position 0
9025     */
9026    struct LDKThirtyTwoBytes a;
9027    /**
9028     * The element at position 1
9029     */
9030    struct LDKPublicKey b;
9031 } LDKC2Tuple_ThirtyTwoBytesPublicKeyZ;
9032
9033 /**
9034  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesPublicKeyZs of arbitrary size.
9035  * This corresponds to std::vector in C++
9036  */
9037 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ {
9038    /**
9039     * The elements in the array.
9040     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9041     */
9042    struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *data;
9043    /**
9044     * The number of elements pointed to by `data`.
9045     */
9046    uintptr_t datalen;
9047 } LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ;
9048
9049 /**
9050  * An enum which can either contain a crate::c_types::Str or not
9051  */
9052 typedef enum LDKCOption_StrZ_Tag {
9053    /**
9054     * When we're in this state, this COption_StrZ contains a crate::c_types::Str
9055     */
9056    LDKCOption_StrZ_Some,
9057    /**
9058     * When we're in this state, this COption_StrZ contains nothing
9059     */
9060    LDKCOption_StrZ_None,
9061    /**
9062     * Must be last for serialization purposes
9063     */
9064    LDKCOption_StrZ_Sentinel,
9065 } LDKCOption_StrZ_Tag;
9066
9067 typedef struct LDKCOption_StrZ {
9068    LDKCOption_StrZ_Tag tag;
9069    union {
9070       struct {
9071          struct LDKStr some;
9072       };
9073    };
9074 } LDKCOption_StrZ;
9075
9076 /**
9077  * The contents of CResult_NoneBolt12SemanticErrorZ
9078  */
9079 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
9080    /**
9081     * Note that this value is always NULL, as there are no contents in the OK variant
9082     */
9083    void *result;
9084    /**
9085     * A pointer to the contents in the error state.
9086     * Reading from this pointer when `result_ok` is set is undefined.
9087     */
9088    enum LDKBolt12SemanticError *err;
9089 } LDKCResult_NoneBolt12SemanticErrorZPtr;
9090
9091 /**
9092  * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
9093  * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
9094  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9095  */
9096 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
9097    /**
9098     * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
9099     * `err` or `result` depending on the state of `result_ok`.
9100     */
9101    union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
9102    /**
9103     * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
9104     */
9105    bool result_ok;
9106 } LDKCResult_NoneBolt12SemanticErrorZ;
9107
9108 /**
9109  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
9110  */
9111 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
9112    /**
9113     * A pointer to the contents in the success state.
9114     * Reading from this pointer when `result_ok` is not set is undefined.
9115     */
9116    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
9117    /**
9118     * Note that this value is always NULL, as there are no contents in the Err variant
9119     */
9120    void *err;
9121 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
9122
9123 /**
9124  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
9125  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
9126  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9127  */
9128 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
9129    /**
9130     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
9131     * `err` or `result` depending on the state of `result_ok`.
9132     */
9133    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
9134    /**
9135     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
9136     */
9137    bool result_ok;
9138 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
9139
9140
9141
9142 /**
9143  * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
9144  *
9145  * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
9146  * specifies these such that its recipient can send an invoice for payment.
9147  *
9148  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
9149  * [`Offer`]: crate::offers::offer::Offer
9150  */
9151 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
9152    /**
9153     * A pointer to the opaque Rust object.
9154     * Nearly everywhere, inner must be non-null, however in places where
9155     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9156     */
9157    LDKnativeInvoiceRequest *inner;
9158    /**
9159     * Indicates that this is the only struct which contains the same pointer.
9160     * Rust functions which take ownership of an object provided via an argument require
9161     * this to be true and invalidate the object pointed to by inner.
9162     */
9163    bool is_owned;
9164 } LDKInvoiceRequest;
9165
9166
9167
9168 /**
9169  * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
9170  *
9171  * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
9172  * directly after scanning a refund. It includes all the information needed to pay a recipient.
9173  *
9174  * [`Offer`]: crate::offers::offer::Offer
9175  * [`Refund`]: crate::offers::refund::Refund
9176  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
9177  */
9178 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
9179    /**
9180     * A pointer to the opaque Rust object.
9181     * Nearly everywhere, inner must be non-null, however in places where
9182     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9183     */
9184    LDKnativeBolt12Invoice *inner;
9185    /**
9186     * Indicates that this is the only struct which contains the same pointer.
9187     * Rust functions which take ownership of an object provided via an argument require
9188     * this to be true and invalidate the object pointed to by inner.
9189     */
9190    bool is_owned;
9191 } LDKBolt12Invoice;
9192
9193
9194
9195 /**
9196  * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
9197  *
9198  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
9199  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
9200  */
9201 typedef struct MUST_USE_STRUCT LDKInvoiceError {
9202    /**
9203     * A pointer to the opaque Rust object.
9204     * Nearly everywhere, inner must be non-null, however in places where
9205     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9206     */
9207    LDKnativeInvoiceError *inner;
9208    /**
9209     * Indicates that this is the only struct which contains the same pointer.
9210     * Rust functions which take ownership of an object provided via an argument require
9211     * this to be true and invalidate the object pointed to by inner.
9212     */
9213    bool is_owned;
9214 } LDKInvoiceError;
9215
9216 /**
9217  * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
9218  *
9219  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
9220  */
9221 typedef enum LDKOffersMessage_Tag {
9222    /**
9223     * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
9224     *
9225     * [`Offer`]: crate::offers::offer::Offer
9226     */
9227    LDKOffersMessage_InvoiceRequest,
9228    /**
9229     * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
9230     *
9231     * [`Refund`]: crate::offers::refund::Refund
9232     */
9233    LDKOffersMessage_Invoice,
9234    /**
9235     * An error from handling an [`OffersMessage`].
9236     */
9237    LDKOffersMessage_InvoiceError,
9238    /**
9239     * Must be last for serialization purposes
9240     */
9241    LDKOffersMessage_Sentinel,
9242 } LDKOffersMessage_Tag;
9243
9244 typedef struct MUST_USE_STRUCT LDKOffersMessage {
9245    LDKOffersMessage_Tag tag;
9246    union {
9247       struct {
9248          struct LDKInvoiceRequest invoice_request;
9249       };
9250       struct {
9251          struct LDKBolt12Invoice invoice;
9252       };
9253       struct {
9254          struct LDKInvoiceError invoice_error;
9255       };
9256    };
9257 } LDKOffersMessage;
9258
9259 /**
9260  * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
9261  */
9262 typedef enum LDKCOption_OffersMessageZ_Tag {
9263    /**
9264     * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
9265     */
9266    LDKCOption_OffersMessageZ_Some,
9267    /**
9268     * When we're in this state, this COption_OffersMessageZ contains nothing
9269     */
9270    LDKCOption_OffersMessageZ_None,
9271    /**
9272     * Must be last for serialization purposes
9273     */
9274    LDKCOption_OffersMessageZ_Sentinel,
9275 } LDKCOption_OffersMessageZ_Tag;
9276
9277 typedef struct LDKCOption_OffersMessageZ {
9278    LDKCOption_OffersMessageZ_Tag tag;
9279    union {
9280       struct {
9281          struct LDKOffersMessage some;
9282       };
9283    };
9284 } LDKCOption_OffersMessageZ;
9285
9286 /**
9287  * The destination of an onion message.
9288  */
9289 typedef enum LDKDestination_Tag {
9290    /**
9291     * We're sending this onion message to a node.
9292     */
9293    LDKDestination_Node,
9294    /**
9295     * We're sending this onion message to a blinded path.
9296     */
9297    LDKDestination_BlindedPath,
9298    /**
9299     * Must be last for serialization purposes
9300     */
9301    LDKDestination_Sentinel,
9302 } LDKDestination_Tag;
9303
9304 typedef struct MUST_USE_STRUCT LDKDestination {
9305    LDKDestination_Tag tag;
9306    union {
9307       struct {
9308          struct LDKPublicKey node;
9309       };
9310       struct {
9311          struct LDKBlindedPath blinded_path;
9312       };
9313    };
9314 } LDKDestination;
9315
9316 /**
9317  * A tuple of 3 elements. See the individual fields for the types contained.
9318  */
9319 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
9320    /**
9321     * The element at position 0
9322     */
9323    struct LDKOffersMessage a;
9324    /**
9325     * The element at position 1
9326     */
9327    struct LDKDestination b;
9328    /**
9329     * The element at position 2
9330     */
9331    struct LDKBlindedPath c;
9332 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
9333
9334 /**
9335  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
9336  * This corresponds to std::vector in C++
9337  */
9338 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
9339    /**
9340     * The elements in the array.
9341     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9342     */
9343    struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
9344    /**
9345     * The number of elements pointed to by `data`.
9346     */
9347    uintptr_t datalen;
9348 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
9349
9350
9351
9352 /**
9353  * Information needed for constructing an invoice route hint for this channel.
9354  */
9355 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
9356    /**
9357     * A pointer to the opaque Rust object.
9358     * Nearly everywhere, inner must be non-null, however in places where
9359     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9360     */
9361    LDKnativeCounterpartyForwardingInfo *inner;
9362    /**
9363     * Indicates that this is the only struct which contains the same pointer.
9364     * Rust functions which take ownership of an object provided via an argument require
9365     * this to be true and invalidate the object pointed to by inner.
9366     */
9367    bool is_owned;
9368 } LDKCounterpartyForwardingInfo;
9369
9370 /**
9371  * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
9372  */
9373 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
9374    /**
9375     * A pointer to the contents in the success state.
9376     * Reading from this pointer when `result_ok` is not set is undefined.
9377     */
9378    struct LDKCounterpartyForwardingInfo *result;
9379    /**
9380     * A pointer to the contents in the error state.
9381     * Reading from this pointer when `result_ok` is set is undefined.
9382     */
9383    struct LDKDecodeError *err;
9384 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
9385
9386 /**
9387  * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
9388  * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9389  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9390  */
9391 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
9392    /**
9393     * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
9394     * `err` or `result` depending on the state of `result_ok`.
9395     */
9396    union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
9397    /**
9398     * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
9399     */
9400    bool result_ok;
9401 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
9402
9403
9404
9405 /**
9406  * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
9407  * to better separate parameters.
9408  */
9409 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
9410    /**
9411     * A pointer to the opaque Rust object.
9412     * Nearly everywhere, inner must be non-null, however in places where
9413     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9414     */
9415    LDKnativeChannelCounterparty *inner;
9416    /**
9417     * Indicates that this is the only struct which contains the same pointer.
9418     * Rust functions which take ownership of an object provided via an argument require
9419     * this to be true and invalidate the object pointed to by inner.
9420     */
9421    bool is_owned;
9422 } LDKChannelCounterparty;
9423
9424 /**
9425  * The contents of CResult_ChannelCounterpartyDecodeErrorZ
9426  */
9427 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
9428    /**
9429     * A pointer to the contents in the success state.
9430     * Reading from this pointer when `result_ok` is not set is undefined.
9431     */
9432    struct LDKChannelCounterparty *result;
9433    /**
9434     * A pointer to the contents in the error state.
9435     * Reading from this pointer when `result_ok` is set is undefined.
9436     */
9437    struct LDKDecodeError *err;
9438 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
9439
9440 /**
9441  * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
9442  * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
9443  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9444  */
9445 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
9446    /**
9447     * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
9448     * `err` or `result` depending on the state of `result_ok`.
9449     */
9450    union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
9451    /**
9452     * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
9453     */
9454    bool result_ok;
9455 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
9456
9457 /**
9458  * The contents of CResult_ChannelDetailsDecodeErrorZ
9459  */
9460 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
9461    /**
9462     * A pointer to the contents in the success state.
9463     * Reading from this pointer when `result_ok` is not set is undefined.
9464     */
9465    struct LDKChannelDetails *result;
9466    /**
9467     * A pointer to the contents in the error state.
9468     * Reading from this pointer when `result_ok` is set is undefined.
9469     */
9470    struct LDKDecodeError *err;
9471 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
9472
9473 /**
9474  * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
9475  * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
9476  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9477  */
9478 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
9479    /**
9480     * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
9481     * `err` or `result` depending on the state of `result_ok`.
9482     */
9483    union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
9484    /**
9485     * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
9486     */
9487    bool result_ok;
9488 } LDKCResult_ChannelDetailsDecodeErrorZ;
9489
9490
9491
9492 /**
9493  * Route hints used in constructing invoices for [phantom node payents].
9494  *
9495  * [phantom node payments]: crate::sign::PhantomKeysManager
9496  */
9497 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
9498    /**
9499     * A pointer to the opaque Rust object.
9500     * Nearly everywhere, inner must be non-null, however in places where
9501     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9502     */
9503    LDKnativePhantomRouteHints *inner;
9504    /**
9505     * Indicates that this is the only struct which contains the same pointer.
9506     * Rust functions which take ownership of an object provided via an argument require
9507     * this to be true and invalidate the object pointed to by inner.
9508     */
9509    bool is_owned;
9510 } LDKPhantomRouteHints;
9511
9512 /**
9513  * The contents of CResult_PhantomRouteHintsDecodeErrorZ
9514  */
9515 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
9516    /**
9517     * A pointer to the contents in the success state.
9518     * Reading from this pointer when `result_ok` is not set is undefined.
9519     */
9520    struct LDKPhantomRouteHints *result;
9521    /**
9522     * A pointer to the contents in the error state.
9523     * Reading from this pointer when `result_ok` is set is undefined.
9524     */
9525    struct LDKDecodeError *err;
9526 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
9527
9528 /**
9529  * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
9530  * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
9531  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9532  */
9533 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
9534    /**
9535     * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
9536     * `err` or `result` depending on the state of `result_ok`.
9537     */
9538    union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
9539    /**
9540     * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
9541     */
9542    bool result_ok;
9543 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
9544
9545
9546
9547 /**
9548  * Information used to forward or fail this HTLC that is being forwarded within a blinded path.
9549  */
9550 typedef struct MUST_USE_STRUCT LDKBlindedForward {
9551    /**
9552     * A pointer to the opaque Rust object.
9553     * Nearly everywhere, inner must be non-null, however in places where
9554     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9555     */
9556    LDKnativeBlindedForward *inner;
9557    /**
9558     * Indicates that this is the only struct which contains the same pointer.
9559     * Rust functions which take ownership of an object provided via an argument require
9560     * this to be true and invalidate the object pointed to by inner.
9561     */
9562    bool is_owned;
9563 } LDKBlindedForward;
9564
9565 /**
9566  * The contents of CResult_BlindedForwardDecodeErrorZ
9567  */
9568 typedef union LDKCResult_BlindedForwardDecodeErrorZPtr {
9569    /**
9570     * A pointer to the contents in the success state.
9571     * Reading from this pointer when `result_ok` is not set is undefined.
9572     */
9573    struct LDKBlindedForward *result;
9574    /**
9575     * A pointer to the contents in the error state.
9576     * Reading from this pointer when `result_ok` is set is undefined.
9577     */
9578    struct LDKDecodeError *err;
9579 } LDKCResult_BlindedForwardDecodeErrorZPtr;
9580
9581 /**
9582  * A CResult_BlindedForwardDecodeErrorZ represents the result of a fallible operation,
9583  * containing a crate::lightning::ln::channelmanager::BlindedForward on success and a crate::lightning::ln::msgs::DecodeError on failure.
9584  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9585  */
9586 typedef struct LDKCResult_BlindedForwardDecodeErrorZ {
9587    /**
9588     * The contents of this CResult_BlindedForwardDecodeErrorZ, accessible via either
9589     * `err` or `result` depending on the state of `result_ok`.
9590     */
9591    union LDKCResult_BlindedForwardDecodeErrorZPtr contents;
9592    /**
9593     * Whether this CResult_BlindedForwardDecodeErrorZ represents a success state.
9594     */
9595    bool result_ok;
9596 } LDKCResult_BlindedForwardDecodeErrorZ;
9597
9598
9599
9600 /**
9601  * BOLT 4 onion packet including hop data for the next peer.
9602  */
9603 typedef struct MUST_USE_STRUCT LDKOnionPacket {
9604    /**
9605     * A pointer to the opaque Rust object.
9606     * Nearly everywhere, inner must be non-null, however in places where
9607     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9608     */
9609    LDKnativeOnionPacket *inner;
9610    /**
9611     * Indicates that this is the only struct which contains the same pointer.
9612     * Rust functions which take ownership of an object provided via an argument require
9613     * this to be true and invalidate the object pointed to by inner.
9614     */
9615    bool is_owned;
9616 } LDKOnionPacket;
9617
9618
9619
9620 /**
9621  * Information communicated in the onion to the recipient for multi-part tracking and proof that
9622  * the payment is associated with an invoice.
9623  */
9624 typedef struct MUST_USE_STRUCT LDKFinalOnionHopData {
9625    /**
9626     * A pointer to the opaque Rust object.
9627     * Nearly everywhere, inner must be non-null, however in places where
9628     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9629     */
9630    LDKnativeFinalOnionHopData *inner;
9631    /**
9632     * Indicates that this is the only struct which contains the same pointer.
9633     * Rust functions which take ownership of an object provided via an argument require
9634     * this to be true and invalidate the object pointed to by inner.
9635     */
9636    bool is_owned;
9637 } LDKFinalOnionHopData;
9638
9639 /**
9640  * Information about where a received HTLC('s onion) has indicated the HTLC should go.
9641  */
9642 typedef enum LDKPendingHTLCRouting_Tag {
9643    /**
9644     * An HTLC which should be forwarded on to another node.
9645     */
9646    LDKPendingHTLCRouting_Forward,
9647    /**
9648     * The onion indicates that this is a payment for an invoice (supposedly) generated by us.
9649     *
9650     * Note that at this point, we have not checked that the invoice being paid was actually
9651     * generated by us, but rather it's claiming to pay an invoice of ours.
9652     */
9653    LDKPendingHTLCRouting_Receive,
9654    /**
9655     * The onion indicates that this is for payment to us but which contains the preimage for
9656     * claiming included, and is unrelated to any invoice we'd previously generated (aka a
9657     * \"keysend\" or \"spontaneous\" payment).
9658     */
9659    LDKPendingHTLCRouting_ReceiveKeysend,
9660    /**
9661     * Must be last for serialization purposes
9662     */
9663    LDKPendingHTLCRouting_Sentinel,
9664 } LDKPendingHTLCRouting_Tag;
9665
9666 typedef struct LDKPendingHTLCRouting_LDKForward_Body {
9667    /**
9668     * The onion which should be included in the forwarded HTLC, telling the next hop what to
9669     * do with the HTLC.
9670     */
9671    struct LDKOnionPacket onion_packet;
9672    /**
9673     * The short channel ID of the channel which we were instructed to forward this HTLC to.
9674     *
9675     * This could be a real on-chain SCID, an SCID alias, or some other SCID which has meaning
9676     * to the receiving node, such as one returned from
9677     * [`ChannelManager::get_intercept_scid`] or [`ChannelManager::get_phantom_scid`].
9678     */
9679    uint64_t short_channel_id;
9680    /**
9681     * Set if this HTLC is being forwarded within a blinded path.
9682     *
9683     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9684     */
9685    struct LDKBlindedForward blinded;
9686 } LDKPendingHTLCRouting_LDKForward_Body;
9687
9688 typedef struct LDKPendingHTLCRouting_LDKReceive_Body {
9689    /**
9690     * Information about the amount the sender intended to pay and (potential) proof that this
9691     * is a payment for an invoice we generated. This proof of payment is is also used for
9692     * linking MPP parts of a larger payment.
9693     */
9694    struct LDKFinalOnionHopData payment_data;
9695    /**
9696     * Additional data which we (allegedly) instructed the sender to include in the onion.
9697     *
9698     * For HTLCs received by LDK, this will ultimately be exposed in
9699     * [`Event::PaymentClaimable::onion_fields`] as
9700     * [`RecipientOnionFields::payment_metadata`].
9701     */
9702    struct LDKCOption_CVec_u8ZZ payment_metadata;
9703    /**
9704     * CLTV expiry of the received HTLC.
9705     *
9706     * Used to track when we should expire pending HTLCs that go unclaimed.
9707     */
9708    uint32_t incoming_cltv_expiry;
9709    /**
9710     * If the onion had forwarding instructions to one of our phantom node SCIDs, this will
9711     * provide the onion shared secret used to decrypt the next level of forwarding
9712     * instructions.
9713     *
9714     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9715     */
9716    struct LDKThirtyTwoBytes phantom_shared_secret;
9717    /**
9718     * Custom TLVs which were set by the sender.
9719     *
9720     * For HTLCs received by LDK, this will ultimately be exposed in
9721     * [`Event::PaymentClaimable::onion_fields`] as
9722     * [`RecipientOnionFields::custom_tlvs`].
9723     */
9724    struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
9725    /**
9726     * Set if this HTLC is the final hop in a multi-hop blinded path.
9727     */
9728    bool requires_blinded_error;
9729 } LDKPendingHTLCRouting_LDKReceive_Body;
9730
9731 typedef struct LDKPendingHTLCRouting_LDKReceiveKeysend_Body {
9732    /**
9733     * Information about the amount the sender intended to pay and possibly a token to
9734     * associate MPP parts of a larger payment.
9735     *
9736     * This will only be filled in if receiving MPP keysend payments is enabled, and it being
9737     * present will cause deserialization to fail on versions of LDK prior to 0.0.116.
9738     *
9739     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9740     */
9741    struct LDKFinalOnionHopData payment_data;
9742    /**
9743     * Preimage for this onion payment. This preimage is provided by the sender and will be
9744     * used to settle the spontaneous payment.
9745     */
9746    struct LDKThirtyTwoBytes payment_preimage;
9747    /**
9748     * Additional data which we (allegedly) instructed the sender to include in the onion.
9749     *
9750     * For HTLCs received by LDK, this will ultimately bubble back up as
9751     * [`RecipientOnionFields::payment_metadata`].
9752     */
9753    struct LDKCOption_CVec_u8ZZ payment_metadata;
9754    /**
9755     * CLTV expiry of the received HTLC.
9756     *
9757     * Used to track when we should expire pending HTLCs that go unclaimed.
9758     */
9759    uint32_t incoming_cltv_expiry;
9760    /**
9761     * Custom TLVs which were set by the sender.
9762     *
9763     * For HTLCs received by LDK, these will ultimately bubble back up as
9764     * [`RecipientOnionFields::custom_tlvs`].
9765     */
9766    struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
9767 } LDKPendingHTLCRouting_LDKReceiveKeysend_Body;
9768
9769 typedef struct MUST_USE_STRUCT LDKPendingHTLCRouting {
9770    LDKPendingHTLCRouting_Tag tag;
9771    union {
9772       LDKPendingHTLCRouting_LDKForward_Body forward;
9773       LDKPendingHTLCRouting_LDKReceive_Body receive;
9774       LDKPendingHTLCRouting_LDKReceiveKeysend_Body receive_keysend;
9775    };
9776 } LDKPendingHTLCRouting;
9777
9778 /**
9779  * The contents of CResult_PendingHTLCRoutingDecodeErrorZ
9780  */
9781 typedef union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr {
9782    /**
9783     * A pointer to the contents in the success state.
9784     * Reading from this pointer when `result_ok` is not set is undefined.
9785     */
9786    struct LDKPendingHTLCRouting *result;
9787    /**
9788     * A pointer to the contents in the error state.
9789     * Reading from this pointer when `result_ok` is set is undefined.
9790     */
9791    struct LDKDecodeError *err;
9792 } LDKCResult_PendingHTLCRoutingDecodeErrorZPtr;
9793
9794 /**
9795  * A CResult_PendingHTLCRoutingDecodeErrorZ represents the result of a fallible operation,
9796  * containing a crate::lightning::ln::channelmanager::PendingHTLCRouting on success and a crate::lightning::ln::msgs::DecodeError on failure.
9797  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9798  */
9799 typedef struct LDKCResult_PendingHTLCRoutingDecodeErrorZ {
9800    /**
9801     * The contents of this CResult_PendingHTLCRoutingDecodeErrorZ, accessible via either
9802     * `err` or `result` depending on the state of `result_ok`.
9803     */
9804    union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr contents;
9805    /**
9806     * Whether this CResult_PendingHTLCRoutingDecodeErrorZ represents a success state.
9807     */
9808    bool result_ok;
9809 } LDKCResult_PendingHTLCRoutingDecodeErrorZ;
9810
9811 /**
9812  * The contents of CResult_PendingHTLCInfoDecodeErrorZ
9813  */
9814 typedef union LDKCResult_PendingHTLCInfoDecodeErrorZPtr {
9815    /**
9816     * A pointer to the contents in the success state.
9817     * Reading from this pointer when `result_ok` is not set is undefined.
9818     */
9819    struct LDKPendingHTLCInfo *result;
9820    /**
9821     * A pointer to the contents in the error state.
9822     * Reading from this pointer when `result_ok` is set is undefined.
9823     */
9824    struct LDKDecodeError *err;
9825 } LDKCResult_PendingHTLCInfoDecodeErrorZPtr;
9826
9827 /**
9828  * A CResult_PendingHTLCInfoDecodeErrorZ represents the result of a fallible operation,
9829  * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9830  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9831  */
9832 typedef struct LDKCResult_PendingHTLCInfoDecodeErrorZ {
9833    /**
9834     * The contents of this CResult_PendingHTLCInfoDecodeErrorZ, accessible via either
9835     * `err` or `result` depending on the state of `result_ok`.
9836     */
9837    union LDKCResult_PendingHTLCInfoDecodeErrorZPtr contents;
9838    /**
9839     * Whether this CResult_PendingHTLCInfoDecodeErrorZ represents a success state.
9840     */
9841    bool result_ok;
9842 } LDKCResult_PendingHTLCInfoDecodeErrorZ;
9843
9844 /**
9845  * The contents of CResult_BlindedFailureDecodeErrorZ
9846  */
9847 typedef union LDKCResult_BlindedFailureDecodeErrorZPtr {
9848    /**
9849     * A pointer to the contents in the success state.
9850     * Reading from this pointer when `result_ok` is not set is undefined.
9851     */
9852    enum LDKBlindedFailure *result;
9853    /**
9854     * A pointer to the contents in the error state.
9855     * Reading from this pointer when `result_ok` is set is undefined.
9856     */
9857    struct LDKDecodeError *err;
9858 } LDKCResult_BlindedFailureDecodeErrorZPtr;
9859
9860 /**
9861  * A CResult_BlindedFailureDecodeErrorZ represents the result of a fallible operation,
9862  * containing a crate::lightning::ln::channelmanager::BlindedFailure on success and a crate::lightning::ln::msgs::DecodeError on failure.
9863  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9864  */
9865 typedef struct LDKCResult_BlindedFailureDecodeErrorZ {
9866    /**
9867     * The contents of this CResult_BlindedFailureDecodeErrorZ, accessible via either
9868     * `err` or `result` depending on the state of `result_ok`.
9869     */
9870    union LDKCResult_BlindedFailureDecodeErrorZPtr contents;
9871    /**
9872     * Whether this CResult_BlindedFailureDecodeErrorZ represents a success state.
9873     */
9874    bool result_ok;
9875 } LDKCResult_BlindedFailureDecodeErrorZ;
9876
9877 /**
9878  * The contents of CResult_ChannelShutdownStateDecodeErrorZ
9879  */
9880 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
9881    /**
9882     * A pointer to the contents in the success state.
9883     * Reading from this pointer when `result_ok` is not set is undefined.
9884     */
9885    enum LDKChannelShutdownState *result;
9886    /**
9887     * A pointer to the contents in the error state.
9888     * Reading from this pointer when `result_ok` is set is undefined.
9889     */
9890    struct LDKDecodeError *err;
9891 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
9892
9893 /**
9894  * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
9895  * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
9896  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9897  */
9898 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
9899    /**
9900     * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
9901     * `err` or `result` depending on the state of `result_ok`.
9902     */
9903    union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
9904    /**
9905     * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
9906     */
9907    bool result_ok;
9908 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
9909
9910
9911
9912 /**
9913  * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
9914  * on-chain transactions to ensure no loss of funds occurs.
9915  *
9916  * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
9917  * information and are actively monitoring the chain.
9918  *
9919  * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
9920  * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
9921  * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
9922  * returned block hash and the the current chain and then reconnecting blocks to get to the
9923  * best chain) upon deserializing the object!
9924  */
9925 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
9926    /**
9927     * A pointer to the opaque Rust object.
9928     * Nearly everywhere, inner must be non-null, however in places where
9929     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9930     */
9931    LDKnativeChannelMonitor *inner;
9932    /**
9933     * Indicates that this is the only struct which contains the same pointer.
9934     * Rust functions which take ownership of an object provided via an argument require
9935     * this to be true and invalidate the object pointed to by inner.
9936     */
9937    bool is_owned;
9938 } LDKChannelMonitor;
9939
9940 /**
9941  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
9942  * This corresponds to std::vector in C++
9943  */
9944 typedef struct LDKCVec_ChannelMonitorZ {
9945    /**
9946     * The elements in the array.
9947     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9948     */
9949    struct LDKChannelMonitor *data;
9950    /**
9951     * The number of elements pointed to by `data`.
9952     */
9953    uintptr_t datalen;
9954 } LDKCVec_ChannelMonitorZ;
9955
9956
9957
9958 /**
9959  * An update generated by the underlying channel itself which contains some new information the
9960  * [`ChannelMonitor`] should be made aware of.
9961  *
9962  * Because this represents only a small number of updates to the underlying state, it is generally
9963  * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
9964  * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
9965  * transaction), a single update may reach upwards of 1 MiB in serialized size.
9966  */
9967 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
9968    /**
9969     * A pointer to the opaque Rust object.
9970     * Nearly everywhere, inner must be non-null, however in places where
9971     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9972     */
9973    LDKnativeChannelMonitorUpdate *inner;
9974    /**
9975     * Indicates that this is the only struct which contains the same pointer.
9976     * Rust functions which take ownership of an object provided via an argument require
9977     * this to be true and invalidate the object pointed to by inner.
9978     */
9979    bool is_owned;
9980 } LDKChannelMonitorUpdate;
9981
9982 /**
9983  * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
9984  * blocks are connected and disconnected.
9985  *
9986  * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
9987  * responsible for maintaining a set of monitors such that they can be updated as channel state
9988  * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
9989  * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
9990  * application crashes.
9991  *
9992  * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
9993  */
9994 typedef struct LDKWatch {
9995    /**
9996     * An opaque pointer which is passed to your function implementations as an argument.
9997     * This has no meaning in the LDK, and can be NULL or any other value.
9998     */
9999    void *this_arg;
10000    /**
10001     * Watches a channel identified by `funding_txo` using `monitor`.
10002     *
10003     * Implementations are responsible for watching the chain for the funding transaction along
10004     * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
10005     * calling [`block_connected`] and [`block_disconnected`] on the monitor.
10006     *
10007     * A return of `Err(())` indicates that the channel should immediately be force-closed without
10008     * broadcasting the funding transaction.
10009     *
10010     * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
10011     * must be returned.
10012     *
10013     * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
10014     * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
10015     * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
10016     */
10017    struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
10018    /**
10019     * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
10020     *
10021     * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
10022     * may fail (returning an `Err(())`), in which case this should return
10023     * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
10024     * generally implies the channel has been closed (either by the funding outpoint being spent
10025     * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
10026     * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
10027     *
10028     * In general, persistence failures should be retried after returning
10029     * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
10030     * cannot be retried, the node should shut down immediately after returning
10031     * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
10032     *
10033     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
10034     */
10035    enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
10036    /**
10037     * Returns any monitor events since the last call. Subsequent calls must only return new
10038     * events.
10039     *
10040     * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
10041     * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
10042     * to disk.
10043     *
10044     * For details on asynchronous [`ChannelMonitor`] updating and returning
10045     * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
10046     */
10047    struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
10048    /**
10049     * Frees any resources associated with this object given its this_arg pointer.
10050     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10051     */
10052    void (*free)(void *this_arg);
10053 } LDKWatch;
10054
10055 /**
10056  * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
10057  * This corresponds to std::vector in C++
10058  */
10059 typedef struct LDKCVec_TransactionZ {
10060    /**
10061     * The elements in the array.
10062     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10063     */
10064    struct LDKTransaction *data;
10065    /**
10066     * The number of elements pointed to by `data`.
10067     */
10068    uintptr_t datalen;
10069 } LDKCVec_TransactionZ;
10070
10071 /**
10072  * An interface to send a transaction to the Bitcoin network.
10073  */
10074 typedef struct LDKBroadcasterInterface {
10075    /**
10076     * An opaque pointer which is passed to your function implementations as an argument.
10077     * This has no meaning in the LDK, and can be NULL or any other value.
10078     */
10079    void *this_arg;
10080    /**
10081     * Sends a list of transactions out to (hopefully) be mined.
10082     * This only needs to handle the actual broadcasting of transactions, LDK will automatically
10083     * rebroadcast transactions that haven't made it into a block.
10084     *
10085     * In some cases LDK may attempt to broadcast a transaction which double-spends another
10086     * and this isn't a bug and can be safely ignored.
10087     *
10088     * If more than one transaction is given, these transactions should be considered to be a
10089     * package and broadcast together. Some of the transactions may or may not depend on each other,
10090     * be sure to manage both cases correctly.
10091     *
10092     * Bitcoin transaction packages are defined in BIP 331 and here:
10093     * <https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md>
10094     */
10095    void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
10096    /**
10097     * Frees any resources associated with this object given its this_arg pointer.
10098     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10099     */
10100    void (*free)(void *this_arg);
10101 } LDKBroadcasterInterface;
10102
10103 /**
10104  * A trait that describes a source of entropy.
10105  */
10106 typedef struct LDKEntropySource {
10107    /**
10108     * An opaque pointer which is passed to your function implementations as an argument.
10109     * This has no meaning in the LDK, and can be NULL or any other value.
10110     */
10111    void *this_arg;
10112    /**
10113     * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
10114     * different value each time it is called.
10115     */
10116    struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
10117    /**
10118     * Frees any resources associated with this object given its this_arg pointer.
10119     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10120     */
10121    void (*free)(void *this_arg);
10122 } LDKEntropySource;
10123
10124
10125
10126 /**
10127  * A semantically valid [`InvoiceRequest`] that hasn't been signed.
10128  *
10129  * # Serialization
10130  *
10131  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
10132  * such, it may include unknown, odd TLV records.
10133  */
10134 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
10135    /**
10136     * A pointer to the opaque Rust object.
10137     * Nearly everywhere, inner must be non-null, however in places where
10138     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10139     */
10140    LDKnativeUnsignedInvoiceRequest *inner;
10141    /**
10142     * Indicates that this is the only struct which contains the same pointer.
10143     * Rust functions which take ownership of an object provided via an argument require
10144     * this to be true and invalidate the object pointed to by inner.
10145     */
10146    bool is_owned;
10147 } LDKUnsignedInvoiceRequest;
10148
10149
10150
10151 /**
10152  * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
10153  *
10154  * # Serialization
10155  *
10156  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
10157  * such, it may include unknown, odd TLV records.
10158  */
10159 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
10160    /**
10161     * A pointer to the opaque Rust object.
10162     * Nearly everywhere, inner must be non-null, however in places where
10163     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10164     */
10165    LDKnativeUnsignedBolt12Invoice *inner;
10166    /**
10167     * Indicates that this is the only struct which contains the same pointer.
10168     * Rust functions which take ownership of an object provided via an argument require
10169     * this to be true and invalidate the object pointed to by inner.
10170     */
10171    bool is_owned;
10172 } LDKUnsignedBolt12Invoice;
10173
10174
10175
10176 /**
10177  * The unsigned part of a [`channel_update`] message.
10178  *
10179  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
10180  */
10181 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
10182    /**
10183     * A pointer to the opaque Rust object.
10184     * Nearly everywhere, inner must be non-null, however in places where
10185     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10186     */
10187    LDKnativeUnsignedChannelUpdate *inner;
10188    /**
10189     * Indicates that this is the only struct which contains the same pointer.
10190     * Rust functions which take ownership of an object provided via an argument require
10191     * this to be true and invalidate the object pointed to by inner.
10192     */
10193    bool is_owned;
10194 } LDKUnsignedChannelUpdate;
10195
10196
10197
10198 /**
10199  * The unsigned part of a [`node_announcement`] message.
10200  *
10201  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
10202  */
10203 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10204    /**
10205     * A pointer to the opaque Rust object.
10206     * Nearly everywhere, inner must be non-null, however in places where
10207     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10208     */
10209    LDKnativeUnsignedNodeAnnouncement *inner;
10210    /**
10211     * Indicates that this is the only struct which contains the same pointer.
10212     * Rust functions which take ownership of an object provided via an argument require
10213     * this to be true and invalidate the object pointed to by inner.
10214     */
10215    bool is_owned;
10216 } LDKUnsignedNodeAnnouncement;
10217
10218 /**
10219  * Represents the set of gossip messages that require a signature from a node's identity key.
10220  */
10221 typedef enum LDKUnsignedGossipMessage_Tag {
10222    /**
10223     * An unsigned channel announcement.
10224     */
10225    LDKUnsignedGossipMessage_ChannelAnnouncement,
10226    /**
10227     * An unsigned channel update.
10228     */
10229    LDKUnsignedGossipMessage_ChannelUpdate,
10230    /**
10231     * An unsigned node announcement.
10232     */
10233    LDKUnsignedGossipMessage_NodeAnnouncement,
10234    /**
10235     * Must be last for serialization purposes
10236     */
10237    LDKUnsignedGossipMessage_Sentinel,
10238 } LDKUnsignedGossipMessage_Tag;
10239
10240 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
10241    LDKUnsignedGossipMessage_Tag tag;
10242    union {
10243       struct {
10244          struct LDKUnsignedChannelAnnouncement channel_announcement;
10245       };
10246       struct {
10247          struct LDKUnsignedChannelUpdate channel_update;
10248       };
10249       struct {
10250          struct LDKUnsignedNodeAnnouncement node_announcement;
10251       };
10252    };
10253 } LDKUnsignedGossipMessage;
10254
10255 /**
10256  * A trait that can handle cryptographic operations at the scope level of a node.
10257  */
10258 typedef struct LDKNodeSigner {
10259    /**
10260     * An opaque pointer which is passed to your function implementations as an argument.
10261     * This has no meaning in the LDK, and can be NULL or any other value.
10262     */
10263    void *this_arg;
10264    /**
10265     * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
10266     *
10267     * If the implementor of this trait supports [phantom node payments], then every node that is
10268     * intended to be included in the phantom invoice route hints must return the same value from
10269     * this method.
10270     *
10271     * This method must return the same value each time it is called.
10272     *
10273     * [phantom node payments]: PhantomKeysManager
10274     */
10275    struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
10276    /**
10277     * Get node id based on the provided [`Recipient`].
10278     *
10279     * This method must return the same value each time it is called with a given [`Recipient`]
10280     * parameter.
10281     *
10282     * Errors if the [`Recipient`] variant is not supported by the implementation.
10283     */
10284    struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
10285    /**
10286     * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
10287     * one is provided. Note that this tweak can be applied to `other_key` instead of our node
10288     * secret, though this is less efficient.
10289     *
10290     * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
10291     * should be resolved to allow LDK to resume forwarding HTLCs.
10292     *
10293     * Errors if the [`Recipient`] variant is not supported by the implementation.
10294     */
10295    struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
10296    /**
10297     * Sign an invoice.
10298     *
10299     * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
10300     * this trait to parse the invoice and make sure they're signing what they expect, rather than
10301     * blindly signing the hash.
10302     *
10303     * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
10304     *
10305     * The secret key used to sign the invoice is dependent on the [`Recipient`].
10306     *
10307     * Errors if the [`Recipient`] variant is not supported by the implementation.
10308     */
10309    struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
10310    /**
10311     * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
10312     *
10313     * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
10314     * `invoice_request` is the callee.
10315     *
10316     * Implementors may check that the `invoice_request` is expected rather than blindly signing
10317     * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
10318     * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
10319     * [`UnsignedInvoiceRequest::payer_id`].
10320     *
10321     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
10322     */
10323    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
10324    /**
10325     * Signs the [`TaggedHash`] of a BOLT 12 invoice.
10326     *
10327     * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
10328     * callee.
10329     *
10330     * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
10331     * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
10332     * key or an ephemeral key to preserve privacy, whichever is associated with
10333     * [`UnsignedBolt12Invoice::signing_pubkey`].
10334     *
10335     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
10336     */
10337    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
10338    /**
10339     * Sign a gossip message.
10340     *
10341     * Note that if this fails, LDK may panic and the message will not be broadcast to the network
10342     * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
10343     * message to be broadcast, as otherwise it may prevent one from receiving funds over the
10344     * corresponding channel.
10345     */
10346    struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
10347    /**
10348     * Frees any resources associated with this object given its this_arg pointer.
10349     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10350     */
10351    void (*free)(void *this_arg);
10352 } LDKNodeSigner;
10353
10354 /**
10355  * A trait that can return signer instances for individual channels.
10356  */
10357 typedef struct LDKSignerProvider {
10358    /**
10359     * An opaque pointer which is passed to your function implementations as an argument.
10360     * This has no meaning in the LDK, and can be NULL or any other value.
10361     */
10362    void *this_arg;
10363    /**
10364     * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
10365     * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
10366     * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
10367     * `channel_keys_id`.
10368     *
10369     * This method must return a different value each time it is called.
10370     */
10371    struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
10372    /**
10373     * Derives the private key material backing a `Signer`.
10374     *
10375     * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
10376     * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
10377     * re-derived from its `channel_keys_id`, which can be obtained through its trait method
10378     * [`ChannelSigner::channel_keys_id`].
10379     */
10380    struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
10381    /**
10382     * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
10383     * This is only called during deserialization of other objects which contain
10384     * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
10385     * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
10386     * contain no versioning scheme. You may wish to include your own version prefix and ensure
10387     * you've read all of the provided bytes to ensure no corruption occurred.
10388     *
10389     * This method is slowly being phased out -- it will only be called when reading objects
10390     * written by LDK versions prior to 0.0.113.
10391     *
10392     * [`Signer`]: Self::EcdsaSigner
10393     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
10394     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
10395     */
10396    struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
10397    /**
10398     * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
10399     *
10400     * If this function returns an error, this will result in a channel failing to open.
10401     *
10402     * This method should return a different value each time it is called, to avoid linking
10403     * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be
10404     * used to derive a unique value for each channel.
10405     */
10406    struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg, struct LDKThirtyTwoBytes channel_keys_id);
10407    /**
10408     * Get a script pubkey which we will send funds to when closing a channel.
10409     *
10410     * If this function returns an error, this will result in a channel failing to open or close.
10411     * In the event of a failure when the counterparty is initiating a close, this can result in a
10412     * channel force close.
10413     *
10414     * This method should return a different value each time it is called, to avoid linking
10415     * on-chain funds across channels as controlled to the same user.
10416     */
10417    struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
10418    /**
10419     * Frees any resources associated with this object given its this_arg pointer.
10420     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10421     */
10422    void (*free)(void *this_arg);
10423 } LDKSignerProvider;
10424
10425 /**
10426  * A trait which should be implemented to provide feerate information on a number of time
10427  * horizons.
10428  *
10429  * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
10430  * third-parties hosting them. Note that this enables them to affect the propagation of your
10431  * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
10432  * should be considered carefully as a deployment.
10433  *
10434  * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
10435  * called from inside the library in response to chain events, P2P events, or timer events).
10436  */
10437 typedef struct LDKFeeEstimator {
10438    /**
10439     * An opaque pointer which is passed to your function implementations as an argument.
10440     * This has no meaning in the LDK, and can be NULL or any other value.
10441     */
10442    void *this_arg;
10443    /**
10444     * Gets estimated satoshis of fee required per 1000 Weight-Units.
10445     *
10446     * LDK will wrap this method and ensure that the value returned is no smaller than 253
10447     * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
10448     *
10449     * The following unit conversions can be used to convert to sats/KW:
10450     *  * satoshis-per-byte * 250
10451     *  * satoshis-per-kbyte / 4
10452     */
10453    uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
10454    /**
10455     * Frees any resources associated with this object given its this_arg pointer.
10456     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10457     */
10458    void (*free)(void *this_arg);
10459 } LDKFeeEstimator;
10460
10461
10462
10463 /**
10464  * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
10465  * may not be valid if received by another lightning implementation.
10466  */
10467 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
10468    /**
10469     * A pointer to the opaque Rust object.
10470     * Nearly everywhere, inner must be non-null, however in places where
10471     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10472     */
10473    LDKnativeReceiveTlvs *inner;
10474    /**
10475     * Indicates that this is the only struct which contains the same pointer.
10476     * Rust functions which take ownership of an object provided via an argument require
10477     * this to be true and invalidate the object pointed to by inner.
10478     */
10479    bool is_owned;
10480 } LDKReceiveTlvs;
10481
10482 /**
10483  * A trait defining behavior for routing an [`OnionMessage`].
10484  */
10485 typedef struct LDKMessageRouter {
10486    /**
10487     * An opaque pointer which is passed to your function implementations as an argument.
10488     * This has no meaning in the LDK, and can be NULL or any other value.
10489     */
10490    void *this_arg;
10491    /**
10492     * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
10493     */
10494    struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
10495    /**
10496     * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
10497     * direct peers with the `recipient`.
10498     */
10499    struct LDKCResult_CVec_BlindedPathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers);
10500    /**
10501     * Frees any resources associated with this object given its this_arg pointer.
10502     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10503     */
10504    void (*free)(void *this_arg);
10505 } LDKMessageRouter;
10506
10507 /**
10508  * A trait defining behavior for routing a payment.
10509  */
10510 typedef struct LDKRouter {
10511    /**
10512     * An opaque pointer which is passed to your function implementations as an argument.
10513     * This has no meaning in the LDK, and can be NULL or any other value.
10514     */
10515    void *this_arg;
10516    /**
10517     * Finds a [`Route`] for a payment between the given `payer` and a payee.
10518     *
10519     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
10520     * and [`RouteParameters::final_value_msat`], respectively.
10521     *
10522     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
10523     */
10524    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);
10525    /**
10526     * Finds a [`Route`] for a payment between the given `payer` and a payee.
10527     *
10528     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
10529     * and [`RouteParameters::final_value_msat`], respectively.
10530     *
10531     * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
10532     * payment.
10533     *
10534     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
10535     */
10536    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);
10537    /**
10538     * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops`
10539     * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are
10540     * given in `tlvs`.
10541     */
10542    struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ (*create_blinded_payment_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats);
10543    /**
10544     * Implementation of MessageRouter for this object.
10545     */
10546    struct LDKMessageRouter MessageRouter;
10547    /**
10548     * Frees any resources associated with this object given its this_arg pointer.
10549     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10550     */
10551    void (*free)(void *this_arg);
10552 } LDKRouter;
10553
10554
10555
10556 /**
10557  * Manager which keeps track of a number of channels and sends messages to the appropriate
10558  * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
10559  *
10560  * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
10561  * to individual Channels.
10562  *
10563  * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
10564  * all peers during write/read (though does not modify this instance, only the instance being
10565  * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
10566  * called [`funding_transaction_generated`] for outbound channels) being closed.
10567  *
10568  * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
10569  * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
10570  * [`ChannelMonitorUpdate`] before returning from
10571  * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
10572  * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
10573  * `ChannelManager` operations from occurring during the serialization process). If the
10574  * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
10575  * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
10576  * will be lost (modulo on-chain transaction fees).
10577  *
10578  * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
10579  * tells you the last block hash which was connected. You should get the best block tip before using the manager.
10580  * See [`chain::Listen`] and [`chain::Confirm`] for more details.
10581  *
10582  * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
10583  * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
10584  * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
10585  * offline for a full minute. In order to track this, you must call
10586  * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
10587  *
10588  * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
10589  * inbound channels without confirmed funding transactions. This may result in nodes which we do
10590  * not have a channel with being unable to connect to us or open new channels with us if we have
10591  * many peers with unfunded channels.
10592  *
10593  * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
10594  * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
10595  * never limited. Please ensure you limit the count of such channels yourself.
10596  *
10597  * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
10598  * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
10599  * essentially you should default to using a [`SimpleRefChannelManager`], and use a
10600  * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
10601  * you're using lightning-net-tokio.
10602  *
10603  * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
10604  * [`funding_created`]: msgs::FundingCreated
10605  * [`funding_transaction_generated`]: Self::funding_transaction_generated
10606  * [`BlockHash`]: bitcoin::hash_types::BlockHash
10607  * [`update_channel`]: chain::Watch::update_channel
10608  * [`ChannelUpdate`]: msgs::ChannelUpdate
10609  * [`timer_tick_occurred`]: Self::timer_tick_occurred
10610  * [`read`]: ReadableArgs::read
10611  */
10612 typedef struct MUST_USE_STRUCT LDKChannelManager {
10613    /**
10614     * A pointer to the opaque Rust object.
10615     * Nearly everywhere, inner must be non-null, however in places where
10616     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10617     */
10618    LDKnativeChannelManager *inner;
10619    /**
10620     * Indicates that this is the only struct which contains the same pointer.
10621     * Rust functions which take ownership of an object provided via an argument require
10622     * this to be true and invalidate the object pointed to by inner.
10623     */
10624    bool is_owned;
10625 } LDKChannelManager;
10626
10627 /**
10628  * A tuple of 2 elements. See the individual fields for the types contained.
10629  */
10630 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
10631    /**
10632     * The element at position 0
10633     */
10634    struct LDKThirtyTwoBytes a;
10635    /**
10636     * The element at position 1
10637     */
10638    struct LDKChannelManager b;
10639 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
10640
10641 /**
10642  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
10643  */
10644 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
10645    /**
10646     * A pointer to the contents in the success state.
10647     * Reading from this pointer when `result_ok` is not set is undefined.
10648     */
10649    struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
10650    /**
10651     * A pointer to the contents in the error state.
10652     * Reading from this pointer when `result_ok` is set is undefined.
10653     */
10654    struct LDKDecodeError *err;
10655 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
10656
10657 /**
10658  * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
10659  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10660  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10661  */
10662 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
10663    /**
10664     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
10665     * `err` or `result` depending on the state of `result_ok`.
10666     */
10667    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
10668    /**
10669     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
10670     */
10671    bool result_ok;
10672 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
10673
10674 /**
10675  * Options for how to set the max dust HTLC exposure allowed on a channel. See
10676  * [`ChannelConfig::max_dust_htlc_exposure`] for details.
10677  */
10678 typedef enum LDKMaxDustHTLCExposure_Tag {
10679    /**
10680     * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
10681     * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
10682     * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
10683     * through [fee griefing
10684     * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
10685     *
10686     * Note that if the feerate increases significantly, without a manual increase
10687     * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
10688     * exposure and the new minimum value for HTLCs to be economically viable to claim.
10689     */
10690    LDKMaxDustHTLCExposure_FixedLimitMsat,
10691    /**
10692     * This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from
10693     * [`FeeEstimator`]) to determine the maximum allowed dust exposure. If this variant is used
10694     * then the maximum dust exposure in millisatoshis is calculated as:
10695     * `high_priority_feerate_per_kw * value`. For example, with our default value
10696     * `FeeRateMultiplier(5000)`:
10697     *
10698     * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
10699     * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
10700     * be 253 * 5000 = 1,265,000 msats.
10701     * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
10702     * 7500 * 5000 = 37,500,000 msats.
10703     *
10704     * This allows the maximum dust exposure to automatically scale with fee rate changes.
10705     *
10706     * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
10707     * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
10708     * causing you to accept more dust HTLCs than you would otherwise.
10709     *
10710     * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
10711     * on HTLC outputs means your channel may be subject to more dust exposure in the event of
10712     * increases in fee rate.
10713     *
10714     * # Backwards Compatibility
10715     * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
10716     * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
10717     *
10718     * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
10719     */
10720    LDKMaxDustHTLCExposure_FeeRateMultiplier,
10721    /**
10722     * Must be last for serialization purposes
10723     */
10724    LDKMaxDustHTLCExposure_Sentinel,
10725 } LDKMaxDustHTLCExposure_Tag;
10726
10727 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
10728    LDKMaxDustHTLCExposure_Tag tag;
10729    union {
10730       struct {
10731          uint64_t fixed_limit_msat;
10732       };
10733       struct {
10734          uint64_t fee_rate_multiplier;
10735       };
10736    };
10737 } LDKMaxDustHTLCExposure;
10738
10739 /**
10740  * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
10741  */
10742 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
10743    /**
10744     * A pointer to the contents in the success state.
10745     * Reading from this pointer when `result_ok` is not set is undefined.
10746     */
10747    struct LDKMaxDustHTLCExposure *result;
10748    /**
10749     * A pointer to the contents in the error state.
10750     * Reading from this pointer when `result_ok` is set is undefined.
10751     */
10752    struct LDKDecodeError *err;
10753 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
10754
10755 /**
10756  * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
10757  * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
10758  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10759  */
10760 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
10761    /**
10762     * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
10763     * `err` or `result` depending on the state of `result_ok`.
10764     */
10765    union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
10766    /**
10767     * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
10768     */
10769    bool result_ok;
10770 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
10771
10772
10773
10774 /**
10775  * Options which apply on a per-channel basis and may change at runtime or based on negotiation
10776  * with our counterparty.
10777  */
10778 typedef struct MUST_USE_STRUCT LDKChannelConfig {
10779    /**
10780     * A pointer to the opaque Rust object.
10781     * Nearly everywhere, inner must be non-null, however in places where
10782     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10783     */
10784    LDKnativeChannelConfig *inner;
10785    /**
10786     * Indicates that this is the only struct which contains the same pointer.
10787     * Rust functions which take ownership of an object provided via an argument require
10788     * this to be true and invalidate the object pointed to by inner.
10789     */
10790    bool is_owned;
10791 } LDKChannelConfig;
10792
10793 /**
10794  * The contents of CResult_ChannelConfigDecodeErrorZ
10795  */
10796 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
10797    /**
10798     * A pointer to the contents in the success state.
10799     * Reading from this pointer when `result_ok` is not set is undefined.
10800     */
10801    struct LDKChannelConfig *result;
10802    /**
10803     * A pointer to the contents in the error state.
10804     * Reading from this pointer when `result_ok` is set is undefined.
10805     */
10806    struct LDKDecodeError *err;
10807 } LDKCResult_ChannelConfigDecodeErrorZPtr;
10808
10809 /**
10810  * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
10811  * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
10812  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10813  */
10814 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
10815    /**
10816     * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
10817     * `err` or `result` depending on the state of `result_ok`.
10818     */
10819    union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
10820    /**
10821     * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
10822     */
10823    bool result_ok;
10824 } LDKCResult_ChannelConfigDecodeErrorZ;
10825
10826 /**
10827  * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
10828  */
10829 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
10830    /**
10831     * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
10832     */
10833    LDKCOption_MaxDustHTLCExposureZ_Some,
10834    /**
10835     * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
10836     */
10837    LDKCOption_MaxDustHTLCExposureZ_None,
10838    /**
10839     * Must be last for serialization purposes
10840     */
10841    LDKCOption_MaxDustHTLCExposureZ_Sentinel,
10842 } LDKCOption_MaxDustHTLCExposureZ_Tag;
10843
10844 typedef struct LDKCOption_MaxDustHTLCExposureZ {
10845    LDKCOption_MaxDustHTLCExposureZ_Tag tag;
10846    union {
10847       struct {
10848          struct LDKMaxDustHTLCExposure some;
10849       };
10850    };
10851 } LDKCOption_MaxDustHTLCExposureZ;
10852
10853 /**
10854  * An enum which can either contain a crate::lightning::util::errors::APIError or not
10855  */
10856 typedef enum LDKCOption_APIErrorZ_Tag {
10857    /**
10858     * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
10859     */
10860    LDKCOption_APIErrorZ_Some,
10861    /**
10862     * When we're in this state, this COption_APIErrorZ contains nothing
10863     */
10864    LDKCOption_APIErrorZ_None,
10865    /**
10866     * Must be last for serialization purposes
10867     */
10868    LDKCOption_APIErrorZ_Sentinel,
10869 } LDKCOption_APIErrorZ_Tag;
10870
10871 typedef struct LDKCOption_APIErrorZ {
10872    LDKCOption_APIErrorZ_Tag tag;
10873    union {
10874       struct {
10875          struct LDKAPIError some;
10876       };
10877    };
10878 } LDKCOption_APIErrorZ;
10879
10880 /**
10881  * The contents of CResult_COption_APIErrorZDecodeErrorZ
10882  */
10883 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
10884    /**
10885     * A pointer to the contents in the success state.
10886     * Reading from this pointer when `result_ok` is not set is undefined.
10887     */
10888    struct LDKCOption_APIErrorZ *result;
10889    /**
10890     * A pointer to the contents in the error state.
10891     * Reading from this pointer when `result_ok` is set is undefined.
10892     */
10893    struct LDKDecodeError *err;
10894 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
10895
10896 /**
10897  * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
10898  * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10899  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10900  */
10901 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
10902    /**
10903     * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
10904     * `err` or `result` depending on the state of `result_ok`.
10905     */
10906    union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
10907    /**
10908     * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
10909     */
10910    bool result_ok;
10911 } LDKCResult_COption_APIErrorZDecodeErrorZ;
10912
10913 /**
10914  * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
10915  */
10916 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
10917    /**
10918     * A pointer to the contents in the success state.
10919     * Reading from this pointer when `result_ok` is not set is undefined.
10920     */
10921    struct LDKChannelMonitorUpdate *result;
10922    /**
10923     * A pointer to the contents in the error state.
10924     * Reading from this pointer when `result_ok` is set is undefined.
10925     */
10926    struct LDKDecodeError *err;
10927 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
10928
10929 /**
10930  * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
10931  * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10932  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10933  */
10934 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
10935    /**
10936     * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
10937     * `err` or `result` depending on the state of `result_ok`.
10938     */
10939    union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
10940    /**
10941     * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
10942     */
10943    bool result_ok;
10944 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
10945
10946 /**
10947  * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
10948  */
10949 typedef enum LDKCOption_MonitorEventZ_Tag {
10950    /**
10951     * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
10952     */
10953    LDKCOption_MonitorEventZ_Some,
10954    /**
10955     * When we're in this state, this COption_MonitorEventZ contains nothing
10956     */
10957    LDKCOption_MonitorEventZ_None,
10958    /**
10959     * Must be last for serialization purposes
10960     */
10961    LDKCOption_MonitorEventZ_Sentinel,
10962 } LDKCOption_MonitorEventZ_Tag;
10963
10964 typedef struct LDKCOption_MonitorEventZ {
10965    LDKCOption_MonitorEventZ_Tag tag;
10966    union {
10967       struct {
10968          struct LDKMonitorEvent some;
10969       };
10970    };
10971 } LDKCOption_MonitorEventZ;
10972
10973 /**
10974  * The contents of CResult_COption_MonitorEventZDecodeErrorZ
10975  */
10976 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
10977    /**
10978     * A pointer to the contents in the success state.
10979     * Reading from this pointer when `result_ok` is not set is undefined.
10980     */
10981    struct LDKCOption_MonitorEventZ *result;
10982    /**
10983     * A pointer to the contents in the error state.
10984     * Reading from this pointer when `result_ok` is set is undefined.
10985     */
10986    struct LDKDecodeError *err;
10987 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
10988
10989 /**
10990  * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
10991  * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10992  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10993  */
10994 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
10995    /**
10996     * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
10997     * `err` or `result` depending on the state of `result_ok`.
10998     */
10999    union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
11000    /**
11001     * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
11002     */
11003    bool result_ok;
11004 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
11005
11006 /**
11007  * The contents of CResult_HTLCUpdateDecodeErrorZ
11008  */
11009 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
11010    /**
11011     * A pointer to the contents in the success state.
11012     * Reading from this pointer when `result_ok` is not set is undefined.
11013     */
11014    struct LDKHTLCUpdate *result;
11015    /**
11016     * A pointer to the contents in the error state.
11017     * Reading from this pointer when `result_ok` is set is undefined.
11018     */
11019    struct LDKDecodeError *err;
11020 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
11021
11022 /**
11023  * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
11024  * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
11025  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11026  */
11027 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
11028    /**
11029     * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
11030     * `err` or `result` depending on the state of `result_ok`.
11031     */
11032    union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
11033    /**
11034     * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
11035     */
11036    bool result_ok;
11037 } LDKCResult_HTLCUpdateDecodeErrorZ;
11038
11039 /**
11040  * A tuple of 2 elements. See the individual fields for the types contained.
11041  */
11042 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
11043    /**
11044     * The element at position 0
11045     */
11046    struct LDKOutPoint a;
11047    /**
11048     * The element at position 1
11049     */
11050    struct LDKCVec_u8Z b;
11051 } LDKC2Tuple_OutPointCVec_u8ZZ;
11052
11053 /**
11054  * A tuple of 2 elements. See the individual fields for the types contained.
11055  */
11056 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
11057    /**
11058     * The element at position 0
11059     */
11060    uint32_t a;
11061    /**
11062     * The element at position 1
11063     */
11064    struct LDKCVec_u8Z b;
11065 } LDKC2Tuple_u32CVec_u8ZZ;
11066
11067 /**
11068  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
11069  * This corresponds to std::vector in C++
11070  */
11071 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
11072    /**
11073     * The elements in the array.
11074     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11075     */
11076    struct LDKC2Tuple_u32CVec_u8ZZ *data;
11077    /**
11078     * The number of elements pointed to by `data`.
11079     */
11080    uintptr_t datalen;
11081 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
11082
11083 /**
11084  * A tuple of 2 elements. See the individual fields for the types contained.
11085  */
11086 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
11087    /**
11088     * The element at position 0
11089     */
11090    struct LDKThirtyTwoBytes a;
11091    /**
11092     * The element at position 1
11093     */
11094    struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
11095 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
11096
11097 /**
11098  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
11099  * This corresponds to std::vector in C++
11100  */
11101 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
11102    /**
11103     * The elements in the array.
11104     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11105     */
11106    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
11107    /**
11108     * The number of elements pointed to by `data`.
11109     */
11110    uintptr_t datalen;
11111 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
11112
11113 /**
11114  * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
11115  * This corresponds to std::vector in C++
11116  */
11117 typedef struct LDKCVec_CommitmentTransactionZ {
11118    /**
11119     * The elements in the array.
11120     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11121     */
11122    struct LDKCommitmentTransaction *data;
11123    /**
11124     * The number of elements pointed to by `data`.
11125     */
11126    uintptr_t datalen;
11127 } LDKCVec_CommitmentTransactionZ;
11128
11129 /**
11130  * A tuple of 2 elements. See the individual fields for the types contained.
11131  */
11132 typedef struct LDKC2Tuple_u32TxOutZ {
11133    /**
11134     * The element at position 0
11135     */
11136    uint32_t a;
11137    /**
11138     * The element at position 1
11139     */
11140    struct LDKTxOut b;
11141 } LDKC2Tuple_u32TxOutZ;
11142
11143 /**
11144  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
11145  * This corresponds to std::vector in C++
11146  */
11147 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
11148    /**
11149     * The elements in the array.
11150     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11151     */
11152    struct LDKC2Tuple_u32TxOutZ *data;
11153    /**
11154     * The number of elements pointed to by `data`.
11155     */
11156    uintptr_t datalen;
11157 } LDKCVec_C2Tuple_u32TxOutZZ;
11158
11159 /**
11160  * A tuple of 2 elements. See the individual fields for the types contained.
11161  */
11162 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
11163    /**
11164     * The element at position 0
11165     */
11166    struct LDKThirtyTwoBytes a;
11167    /**
11168     * The element at position 1
11169     */
11170    struct LDKCVec_C2Tuple_u32TxOutZZ b;
11171 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
11172
11173 /**
11174  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
11175  * This corresponds to std::vector in C++
11176  */
11177 typedef struct LDKCVec_TransactionOutputsZ {
11178    /**
11179     * The elements in the array.
11180     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11181     */
11182    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
11183    /**
11184     * The number of elements pointed to by `data`.
11185     */
11186    uintptr_t datalen;
11187 } LDKCVec_TransactionOutputsZ;
11188
11189 /**
11190  * Details about the balance(s) available for spending once the channel appears on chain.
11191  *
11192  * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
11193  * be provided.
11194  */
11195 typedef enum LDKBalance_Tag {
11196    /**
11197     * The channel is not yet closed (or the commitment or closing transaction has not yet
11198     * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
11199     * force-closed now.
11200     */
11201    LDKBalance_ClaimableOnChannelClose,
11202    /**
11203     * The channel has been closed, and the given balance is ours but awaiting confirmations until
11204     * we consider it spendable.
11205     */
11206    LDKBalance_ClaimableAwaitingConfirmations,
11207    /**
11208     * The channel has been closed, and the given balance should be ours but awaiting spending
11209     * transaction confirmation. If the spending transaction does not confirm in time, it is
11210     * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
11211     *
11212     * Once the spending transaction confirms, before it has reached enough confirmations to be
11213     * considered safe from chain reorganizations, the balance will instead be provided via
11214     * [`Balance::ClaimableAwaitingConfirmations`].
11215     */
11216    LDKBalance_ContentiousClaimable,
11217    /**
11218     * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
11219     * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
11220     * likely to be claimed by our counterparty before we do.
11221     */
11222    LDKBalance_MaybeTimeoutClaimableHTLC,
11223    /**
11224     * HTLCs which we received from our counterparty which are claimable with a preimage which we
11225     * do not currently have. This will only be claimable if we receive the preimage from the node
11226     * to which we forwarded this HTLC before the timeout.
11227     */
11228    LDKBalance_MaybePreimageClaimableHTLC,
11229    /**
11230     * The channel has been closed, and our counterparty broadcasted a revoked commitment
11231     * transaction.
11232     *
11233     * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
11234     * following amount.
11235     */
11236    LDKBalance_CounterpartyRevokedOutputClaimable,
11237    /**
11238     * Must be last for serialization purposes
11239     */
11240    LDKBalance_Sentinel,
11241 } LDKBalance_Tag;
11242
11243 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
11244    /**
11245     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
11246     * required to do so.
11247     */
11248    uint64_t amount_satoshis;
11249 } LDKBalance_LDKClaimableOnChannelClose_Body;
11250
11251 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
11252    /**
11253     * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
11254     * were spent in broadcasting the transaction.
11255     */
11256    uint64_t amount_satoshis;
11257    /**
11258     * The height at which an [`Event::SpendableOutputs`] event will be generated for this
11259     * amount.
11260     */
11261    uint32_t confirmation_height;
11262 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
11263
11264 typedef struct LDKBalance_LDKContentiousClaimable_Body {
11265    /**
11266     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
11267     * required to do so.
11268     */
11269    uint64_t amount_satoshis;
11270    /**
11271     * The height at which the counterparty may be able to claim the balance if we have not
11272     * done so.
11273     */
11274    uint32_t timeout_height;
11275    /**
11276     * The payment hash that locks this HTLC.
11277     */
11278    struct LDKThirtyTwoBytes payment_hash;
11279    /**
11280     * The preimage that can be used to claim this HTLC.
11281     */
11282    struct LDKThirtyTwoBytes payment_preimage;
11283 } LDKBalance_LDKContentiousClaimable_Body;
11284
11285 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
11286    /**
11287     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
11288     * which will be required to do so.
11289     */
11290    uint64_t amount_satoshis;
11291    /**
11292     * The height at which we will be able to claim the balance if our counterparty has not
11293     * done so.
11294     */
11295    uint32_t claimable_height;
11296    /**
11297     * The payment hash whose preimage our counterparty needs to claim this HTLC.
11298     */
11299    struct LDKThirtyTwoBytes payment_hash;
11300 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
11301
11302 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
11303    /**
11304     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
11305     * which will be required to do so.
11306     */
11307    uint64_t amount_satoshis;
11308    /**
11309     * The height at which our counterparty will be able to claim the balance if we have not
11310     * yet received the preimage and claimed it ourselves.
11311     */
11312    uint32_t expiry_height;
11313    /**
11314     * The payment hash whose preimage we need to claim this HTLC.
11315     */
11316    struct LDKThirtyTwoBytes payment_hash;
11317 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
11318
11319 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
11320    /**
11321     * The amount, in satoshis, of the output which we can claim.
11322     *
11323     * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
11324     * were already spent.
11325     */
11326    uint64_t amount_satoshis;
11327 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
11328
11329 typedef struct MUST_USE_STRUCT LDKBalance {
11330    LDKBalance_Tag tag;
11331    union {
11332       LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
11333       LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
11334       LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
11335       LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
11336       LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
11337       LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
11338    };
11339 } LDKBalance;
11340
11341 /**
11342  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
11343  * This corresponds to std::vector in C++
11344  */
11345 typedef struct LDKCVec_BalanceZ {
11346    /**
11347     * The elements in the array.
11348     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11349     */
11350    struct LDKBalance *data;
11351    /**
11352     * The number of elements pointed to by `data`.
11353     */
11354    uintptr_t datalen;
11355 } LDKCVec_BalanceZ;
11356
11357 /**
11358  * A tuple of 2 elements. See the individual fields for the types contained.
11359  */
11360 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
11361    /**
11362     * The element at position 0
11363     */
11364    struct LDKThirtyTwoBytes a;
11365    /**
11366     * The element at position 1
11367     */
11368    struct LDKChannelMonitor b;
11369 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
11370
11371 /**
11372  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
11373  */
11374 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
11375    /**
11376     * A pointer to the contents in the success state.
11377     * Reading from this pointer when `result_ok` is not set is undefined.
11378     */
11379    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
11380    /**
11381     * A pointer to the contents in the error state.
11382     * Reading from this pointer when `result_ok` is set is undefined.
11383     */
11384    struct LDKDecodeError *err;
11385 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
11386
11387 /**
11388  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
11389  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
11390  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11391  */
11392 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
11393    /**
11394     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
11395     * `err` or `result` depending on the state of `result_ok`.
11396     */
11397    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
11398    /**
11399     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
11400     */
11401    bool result_ok;
11402 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
11403
11404 /**
11405  * Defines a type identifier for sending messages over the wire.
11406  *
11407  * Messages implementing this trait specify a type and must be [`Writeable`].
11408  */
11409 typedef struct LDKType {
11410    /**
11411     * An opaque pointer which is passed to your function implementations as an argument.
11412     * This has no meaning in the LDK, and can be NULL or any other value.
11413     */
11414    void *this_arg;
11415    /**
11416     * Returns the type identifying the message payload.
11417     */
11418    uint16_t (*type_id)(const void *this_arg);
11419    /**
11420     * Return a human-readable "debug" string describing this object
11421     */
11422    struct LDKStr (*debug_str)(const void *this_arg);
11423    /**
11424     * Serialize the object into a byte array
11425     */
11426    struct LDKCVec_u8Z (*write)(const void *this_arg);
11427    /**
11428     * Called, if set, after this Type has been cloned into a duplicate object.
11429     * The new Type is provided, and should be mutated as needed to perform a
11430     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
11431     */
11432    void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
11433    /**
11434     * Frees any resources associated with this object given its this_arg pointer.
11435     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11436     */
11437    void (*free)(void *this_arg);
11438 } LDKType;
11439
11440 /**
11441  * A tuple of 2 elements. See the individual fields for the types contained.
11442  */
11443 typedef struct LDKC2Tuple_PublicKeyTypeZ {
11444    /**
11445     * The element at position 0
11446     */
11447    struct LDKPublicKey a;
11448    /**
11449     * The element at position 1
11450     */
11451    struct LDKType b;
11452 } LDKC2Tuple_PublicKeyTypeZ;
11453
11454 /**
11455  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
11456  * This corresponds to std::vector in C++
11457  */
11458 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
11459    /**
11460     * The elements in the array.
11461     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11462     */
11463    struct LDKC2Tuple_PublicKeyTypeZ *data;
11464    /**
11465     * The number of elements pointed to by `data`.
11466     */
11467    uintptr_t datalen;
11468 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
11469
11470 /**
11471  * A tuple of 2 elements. See the individual fields for the types contained.
11472  */
11473 typedef struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ {
11474    /**
11475     * The element at position 0
11476     */
11477    struct LDKPublicKey a;
11478    /**
11479     * The element at position 1
11480     */
11481    struct LDKCVec_SocketAddressZ b;
11482 } LDKC2Tuple_PublicKeyCVec_SocketAddressZZ;
11483
11484 /**
11485  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCVec_SocketAddressZZs of arbitrary size.
11486  * This corresponds to std::vector in C++
11487  */
11488 typedef struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ {
11489    /**
11490     * The elements in the array.
11491     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11492     */
11493    struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *data;
11494    /**
11495     * The number of elements pointed to by `data`.
11496     */
11497    uintptr_t datalen;
11498 } LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ;
11499
11500 /**
11501  * The contents of an onion message.
11502  */
11503 typedef struct LDKOnionMessageContents {
11504    /**
11505     * An opaque pointer which is passed to your function implementations as an argument.
11506     * This has no meaning in the LDK, and can be NULL or any other value.
11507     */
11508    void *this_arg;
11509    /**
11510     * Returns the TLV type identifying the message contents. MUST be >= 64.
11511     */
11512    uint64_t (*tlv_type)(const void *this_arg);
11513    /**
11514     * Serialize the object into a byte array
11515     */
11516    struct LDKCVec_u8Z (*write)(const void *this_arg);
11517    /**
11518     * Return a human-readable "debug" string describing this object
11519     */
11520    struct LDKStr (*debug_str)(const void *this_arg);
11521    /**
11522     * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
11523     * The new OnionMessageContents is provided, and should be mutated as needed to perform a
11524     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
11525     */
11526    void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
11527    /**
11528     * Frees any resources associated with this object given its this_arg pointer.
11529     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11530     */
11531    void (*free)(void *this_arg);
11532 } LDKOnionMessageContents;
11533
11534 /**
11535  * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
11536  */
11537 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
11538    /**
11539     * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
11540     */
11541    LDKCOption_OnionMessageContentsZ_Some,
11542    /**
11543     * When we're in this state, this COption_OnionMessageContentsZ contains nothing
11544     */
11545    LDKCOption_OnionMessageContentsZ_None,
11546    /**
11547     * Must be last for serialization purposes
11548     */
11549    LDKCOption_OnionMessageContentsZ_Sentinel,
11550 } LDKCOption_OnionMessageContentsZ_Tag;
11551
11552 typedef struct LDKCOption_OnionMessageContentsZ {
11553    LDKCOption_OnionMessageContentsZ_Tag tag;
11554    union {
11555       struct {
11556          struct LDKOnionMessageContents some;
11557       };
11558    };
11559 } LDKCOption_OnionMessageContentsZ;
11560
11561 /**
11562  * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
11563  */
11564 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
11565    /**
11566     * A pointer to the contents in the success state.
11567     * Reading from this pointer when `result_ok` is not set is undefined.
11568     */
11569    struct LDKCOption_OnionMessageContentsZ *result;
11570    /**
11571     * A pointer to the contents in the error state.
11572     * Reading from this pointer when `result_ok` is set is undefined.
11573     */
11574    struct LDKDecodeError *err;
11575 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
11576
11577 /**
11578  * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
11579  * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
11580  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11581  */
11582 typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
11583    /**
11584     * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
11585     * `err` or `result` depending on the state of `result_ok`.
11586     */
11587    union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
11588    /**
11589     * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
11590     */
11591    bool result_ok;
11592 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
11593
11594 /**
11595  * A tuple of 3 elements. See the individual fields for the types contained.
11596  */
11597 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
11598    /**
11599     * The element at position 0
11600     */
11601    struct LDKOnionMessageContents a;
11602    /**
11603     * The element at position 1
11604     */
11605    struct LDKDestination b;
11606    /**
11607     * The element at position 2
11608     */
11609    struct LDKBlindedPath c;
11610 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
11611
11612 /**
11613  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
11614  * This corresponds to std::vector in C++
11615  */
11616 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
11617    /**
11618     * The elements in the array.
11619     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11620     */
11621    struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
11622    /**
11623     * The number of elements pointed to by `data`.
11624     */
11625    uintptr_t datalen;
11626 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
11627
11628 /**
11629  * An enum which can either contain a crate::lightning::ln::wire::Type or not
11630  */
11631 typedef enum LDKCOption_TypeZ_Tag {
11632    /**
11633     * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
11634     */
11635    LDKCOption_TypeZ_Some,
11636    /**
11637     * When we're in this state, this COption_TypeZ contains nothing
11638     */
11639    LDKCOption_TypeZ_None,
11640    /**
11641     * Must be last for serialization purposes
11642     */
11643    LDKCOption_TypeZ_Sentinel,
11644 } LDKCOption_TypeZ_Tag;
11645
11646 typedef struct LDKCOption_TypeZ {
11647    LDKCOption_TypeZ_Tag tag;
11648    union {
11649       struct {
11650          struct LDKType some;
11651       };
11652    };
11653 } LDKCOption_TypeZ;
11654
11655 /**
11656  * The contents of CResult_COption_TypeZDecodeErrorZ
11657  */
11658 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
11659    /**
11660     * A pointer to the contents in the success state.
11661     * Reading from this pointer when `result_ok` is not set is undefined.
11662     */
11663    struct LDKCOption_TypeZ *result;
11664    /**
11665     * A pointer to the contents in the error state.
11666     * Reading from this pointer when `result_ok` is set is undefined.
11667     */
11668    struct LDKDecodeError *err;
11669 } LDKCResult_COption_TypeZDecodeErrorZPtr;
11670
11671 /**
11672  * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
11673  * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
11674  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11675  */
11676 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
11677    /**
11678     * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
11679     * `err` or `result` depending on the state of `result_ok`.
11680     */
11681    union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
11682    /**
11683     * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
11684     */
11685    bool result_ok;
11686 } LDKCResult_COption_TypeZDecodeErrorZ;
11687
11688 /**
11689  * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
11690  */
11691 typedef enum LDKCOption_SocketAddressZ_Tag {
11692    /**
11693     * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
11694     */
11695    LDKCOption_SocketAddressZ_Some,
11696    /**
11697     * When we're in this state, this COption_SocketAddressZ contains nothing
11698     */
11699    LDKCOption_SocketAddressZ_None,
11700    /**
11701     * Must be last for serialization purposes
11702     */
11703    LDKCOption_SocketAddressZ_Sentinel,
11704 } LDKCOption_SocketAddressZ_Tag;
11705
11706 typedef struct LDKCOption_SocketAddressZ {
11707    LDKCOption_SocketAddressZ_Tag tag;
11708    union {
11709       struct {
11710          struct LDKSocketAddress some;
11711       };
11712    };
11713 } LDKCOption_SocketAddressZ;
11714
11715 /**
11716  * A tuple of 2 elements. See the individual fields for the types contained.
11717  */
11718 typedef struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ {
11719    /**
11720     * The element at position 0
11721     */
11722    struct LDKPublicKey a;
11723    /**
11724     * The element at position 1
11725     */
11726    struct LDKCOption_SocketAddressZ b;
11727 } LDKC2Tuple_PublicKeyCOption_SocketAddressZZ;
11728
11729 /**
11730  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_SocketAddressZZs of arbitrary size.
11731  * This corresponds to std::vector in C++
11732  */
11733 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ {
11734    /**
11735     * The elements in the array.
11736     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11737     */
11738    struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *data;
11739    /**
11740     * The number of elements pointed to by `data`.
11741     */
11742    uintptr_t datalen;
11743 } LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ;
11744
11745
11746
11747 /**
11748  * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
11749  * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
11750  * descriptor.
11751  */
11752 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
11753    /**
11754     * A pointer to the opaque Rust object.
11755     * Nearly everywhere, inner must be non-null, however in places where
11756     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11757     */
11758    LDKnativePeerHandleError *inner;
11759    /**
11760     * Indicates that this is the only struct which contains the same pointer.
11761     * Rust functions which take ownership of an object provided via an argument require
11762     * this to be true and invalidate the object pointed to by inner.
11763     */
11764    bool is_owned;
11765 } LDKPeerHandleError;
11766
11767 /**
11768  * The contents of CResult_CVec_u8ZPeerHandleErrorZ
11769  */
11770 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
11771    /**
11772     * A pointer to the contents in the success state.
11773     * Reading from this pointer when `result_ok` is not set is undefined.
11774     */
11775    struct LDKCVec_u8Z *result;
11776    /**
11777     * A pointer to the contents in the error state.
11778     * Reading from this pointer when `result_ok` is set is undefined.
11779     */
11780    struct LDKPeerHandleError *err;
11781 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
11782
11783 /**
11784  * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
11785  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
11786  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11787  */
11788 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
11789    /**
11790     * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
11791     * `err` or `result` depending on the state of `result_ok`.
11792     */
11793    union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
11794    /**
11795     * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
11796     */
11797    bool result_ok;
11798 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
11799
11800 /**
11801  * The contents of CResult_NonePeerHandleErrorZ
11802  */
11803 typedef union LDKCResult_NonePeerHandleErrorZPtr {
11804    /**
11805     * Note that this value is always NULL, as there are no contents in the OK variant
11806     */
11807    void *result;
11808    /**
11809     * A pointer to the contents in the error state.
11810     * Reading from this pointer when `result_ok` is set is undefined.
11811     */
11812    struct LDKPeerHandleError *err;
11813 } LDKCResult_NonePeerHandleErrorZPtr;
11814
11815 /**
11816  * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
11817  * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
11818  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11819  */
11820 typedef struct LDKCResult_NonePeerHandleErrorZ {
11821    /**
11822     * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
11823     * `err` or `result` depending on the state of `result_ok`.
11824     */
11825    union LDKCResult_NonePeerHandleErrorZPtr contents;
11826    /**
11827     * Whether this CResult_NonePeerHandleErrorZ represents a success state.
11828     */
11829    bool result_ok;
11830 } LDKCResult_NonePeerHandleErrorZ;
11831
11832 /**
11833  * The contents of CResult_boolPeerHandleErrorZ
11834  */
11835 typedef union LDKCResult_boolPeerHandleErrorZPtr {
11836    /**
11837     * A pointer to the contents in the success state.
11838     * Reading from this pointer when `result_ok` is not set is undefined.
11839     */
11840    bool *result;
11841    /**
11842     * A pointer to the contents in the error state.
11843     * Reading from this pointer when `result_ok` is set is undefined.
11844     */
11845    struct LDKPeerHandleError *err;
11846 } LDKCResult_boolPeerHandleErrorZPtr;
11847
11848 /**
11849  * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
11850  * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
11851  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11852  */
11853 typedef struct LDKCResult_boolPeerHandleErrorZ {
11854    /**
11855     * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
11856     * `err` or `result` depending on the state of `result_ok`.
11857     */
11858    union LDKCResult_boolPeerHandleErrorZPtr contents;
11859    /**
11860     * Whether this CResult_boolPeerHandleErrorZ represents a success state.
11861     */
11862    bool result_ok;
11863 } LDKCResult_boolPeerHandleErrorZ;
11864
11865 /**
11866  * All-encompassing standard error type that processing can return
11867  */
11868 typedef enum LDKGraphSyncError_Tag {
11869    /**
11870     * Error trying to read the update data, typically due to an erroneous data length indication
11871     * that is greater than the actual amount of data provided
11872     */
11873    LDKGraphSyncError_DecodeError,
11874    /**
11875     * Error applying the patch to the network graph, usually the result of updates that are too
11876     * old or missing prerequisite data to the application of updates out of order
11877     */
11878    LDKGraphSyncError_LightningError,
11879    /**
11880     * Must be last for serialization purposes
11881     */
11882    LDKGraphSyncError_Sentinel,
11883 } LDKGraphSyncError_Tag;
11884
11885 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
11886    LDKGraphSyncError_Tag tag;
11887    union {
11888       struct {
11889          struct LDKDecodeError decode_error;
11890       };
11891       struct {
11892          struct LDKLightningError lightning_error;
11893       };
11894    };
11895 } LDKGraphSyncError;
11896
11897 /**
11898  * The contents of CResult_u32GraphSyncErrorZ
11899  */
11900 typedef union LDKCResult_u32GraphSyncErrorZPtr {
11901    /**
11902     * A pointer to the contents in the success state.
11903     * Reading from this pointer when `result_ok` is not set is undefined.
11904     */
11905    uint32_t *result;
11906    /**
11907     * A pointer to the contents in the error state.
11908     * Reading from this pointer when `result_ok` is set is undefined.
11909     */
11910    struct LDKGraphSyncError *err;
11911 } LDKCResult_u32GraphSyncErrorZPtr;
11912
11913 /**
11914  * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
11915  * containing a u32 on success and a crate::lightning_rapid_gossip_sync::GraphSyncError on failure.
11916  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11917  */
11918 typedef struct LDKCResult_u32GraphSyncErrorZ {
11919    /**
11920     * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
11921     * `err` or `result` depending on the state of `result_ok`.
11922     */
11923    union LDKCResult_u32GraphSyncErrorZPtr contents;
11924    /**
11925     * Whether this CResult_u32GraphSyncErrorZ represents a success state.
11926     */
11927    bool result_ok;
11928 } LDKCResult_u32GraphSyncErrorZ;
11929
11930 /**
11931  * The contents of CResult_CVec_u8ZIOErrorZ
11932  */
11933 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
11934    /**
11935     * A pointer to the contents in the success state.
11936     * Reading from this pointer when `result_ok` is not set is undefined.
11937     */
11938    struct LDKCVec_u8Z *result;
11939    /**
11940     * A pointer to the contents in the error state.
11941     * Reading from this pointer when `result_ok` is set is undefined.
11942     */
11943    enum LDKIOError *err;
11944 } LDKCResult_CVec_u8ZIOErrorZPtr;
11945
11946 /**
11947  * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
11948  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
11949  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11950  */
11951 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
11952    /**
11953     * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
11954     * `err` or `result` depending on the state of `result_ok`.
11955     */
11956    union LDKCResult_CVec_u8ZIOErrorZPtr contents;
11957    /**
11958     * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
11959     */
11960    bool result_ok;
11961 } LDKCResult_CVec_u8ZIOErrorZ;
11962
11963 /**
11964  * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
11965  * This corresponds to std::vector in C++
11966  */
11967 typedef struct LDKCVec_StrZ {
11968    /**
11969     * The elements in the array.
11970     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11971     */
11972    struct LDKStr *data;
11973    /**
11974     * The number of elements pointed to by `data`.
11975     */
11976    uintptr_t datalen;
11977 } LDKCVec_StrZ;
11978
11979 /**
11980  * The contents of CResult_CVec_StrZIOErrorZ
11981  */
11982 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
11983    /**
11984     * A pointer to the contents in the success state.
11985     * Reading from this pointer when `result_ok` is not set is undefined.
11986     */
11987    struct LDKCVec_StrZ *result;
11988    /**
11989     * A pointer to the contents in the error state.
11990     * Reading from this pointer when `result_ok` is set is undefined.
11991     */
11992    enum LDKIOError *err;
11993 } LDKCResult_CVec_StrZIOErrorZPtr;
11994
11995 /**
11996  * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
11997  * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
11998  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11999  */
12000 typedef struct LDKCResult_CVec_StrZIOErrorZ {
12001    /**
12002     * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
12003     * `err` or `result` depending on the state of `result_ok`.
12004     */
12005    union LDKCResult_CVec_StrZIOErrorZPtr contents;
12006    /**
12007     * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
12008     */
12009    bool result_ok;
12010 } LDKCResult_CVec_StrZIOErrorZ;
12011
12012 /**
12013  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
12014  * This corresponds to std::vector in C++
12015  */
12016 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
12017    /**
12018     * The elements in the array.
12019     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12020     */
12021    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
12022    /**
12023     * The number of elements pointed to by `data`.
12024     */
12025    uintptr_t datalen;
12026 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
12027
12028 /**
12029  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
12030  */
12031 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
12032    /**
12033     * A pointer to the contents in the success state.
12034     * Reading from this pointer when `result_ok` is not set is undefined.
12035     */
12036    struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
12037    /**
12038     * A pointer to the contents in the error state.
12039     * Reading from this pointer when `result_ok` is set is undefined.
12040     */
12041    enum LDKIOError *err;
12042 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
12043
12044 /**
12045  * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
12046  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
12047  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12048  */
12049 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
12050    /**
12051     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
12052     * `err` or `result` depending on the state of `result_ok`.
12053     */
12054    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
12055    /**
12056     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
12057     */
12058    bool result_ok;
12059 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
12060
12061 /**
12062  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
12063  */
12064 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
12065    /**
12066     * A pointer to the contents in the success state.
12067     * Reading from this pointer when `result_ok` is not set is undefined.
12068     */
12069    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
12070    /**
12071     * A pointer to the contents in the error state.
12072     * Reading from this pointer when `result_ok` is set is undefined.
12073     */
12074    enum LDKIOError *err;
12075 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
12076
12077 /**
12078  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
12079  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
12080  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12081  */
12082 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
12083    /**
12084     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
12085     * `err` or `result` depending on the state of `result_ok`.
12086     */
12087    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
12088    /**
12089     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
12090     */
12091    bool result_ok;
12092 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
12093
12094 /**
12095  * Represents a valid secp256k1 secret key serialized as a 32 byte array.
12096  */
12097 typedef struct LDKSecretKey {
12098    /**
12099     * The bytes of the secret key
12100     */
12101    uint8_t bytes[32];
12102 } LDKSecretKey;
12103
12104 /**
12105  * An enum which can either contain a crate::c_types::SecretKey or not
12106  */
12107 typedef enum LDKCOption_SecretKeyZ_Tag {
12108    /**
12109     * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
12110     */
12111    LDKCOption_SecretKeyZ_Some,
12112    /**
12113     * When we're in this state, this COption_SecretKeyZ contains nothing
12114     */
12115    LDKCOption_SecretKeyZ_None,
12116    /**
12117     * Must be last for serialization purposes
12118     */
12119    LDKCOption_SecretKeyZ_Sentinel,
12120 } LDKCOption_SecretKeyZ_Tag;
12121
12122 typedef struct LDKCOption_SecretKeyZ {
12123    LDKCOption_SecretKeyZ_Tag tag;
12124    union {
12125       struct {
12126          struct LDKSecretKey some;
12127       };
12128    };
12129 } LDKCOption_SecretKeyZ;
12130
12131
12132
12133 /**
12134  * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
12135  * ways to respond depending on whether the signing keys were derived.
12136  */
12137 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
12138    /**
12139     * A pointer to the opaque Rust object.
12140     * Nearly everywhere, inner must be non-null, however in places where
12141     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12142     */
12143    LDKnativeVerifiedInvoiceRequest *inner;
12144    /**
12145     * Indicates that this is the only struct which contains the same pointer.
12146     * Rust functions which take ownership of an object provided via an argument require
12147     * this to be true and invalidate the object pointed to by inner.
12148     */
12149    bool is_owned;
12150 } LDKVerifiedInvoiceRequest;
12151
12152 /**
12153  * The contents of CResult_VerifiedInvoiceRequestNoneZ
12154  */
12155 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
12156    /**
12157     * A pointer to the contents in the success state.
12158     * Reading from this pointer when `result_ok` is not set is undefined.
12159     */
12160    struct LDKVerifiedInvoiceRequest *result;
12161    /**
12162     * Note that this value is always NULL, as there are no contents in the Err variant
12163     */
12164    void *err;
12165 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
12166
12167 /**
12168  * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
12169  * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
12170  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12171  */
12172 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
12173    /**
12174     * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
12175     * `err` or `result` depending on the state of `result_ok`.
12176     */
12177    union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
12178    /**
12179     * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
12180     */
12181    bool result_ok;
12182 } LDKCResult_VerifiedInvoiceRequestNoneZ;
12183
12184 /**
12185  * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
12186  * This corresponds to std::vector in C++
12187  */
12188 typedef struct LDKCVec_WitnessZ {
12189    /**
12190     * The elements in the array.
12191     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12192     */
12193    struct LDKWitness *data;
12194    /**
12195     * The number of elements pointed to by `data`.
12196     */
12197    uintptr_t datalen;
12198 } LDKCVec_WitnessZ;
12199
12200 /**
12201  * An enum which can either contain a i64 or not
12202  */
12203 typedef enum LDKCOption_i64Z_Tag {
12204    /**
12205     * When we're in this state, this COption_i64Z contains a i64
12206     */
12207    LDKCOption_i64Z_Some,
12208    /**
12209     * When we're in this state, this COption_i64Z contains nothing
12210     */
12211    LDKCOption_i64Z_None,
12212    /**
12213     * Must be last for serialization purposes
12214     */
12215    LDKCOption_i64Z_Sentinel,
12216 } LDKCOption_i64Z_Tag;
12217
12218 typedef struct LDKCOption_i64Z {
12219    LDKCOption_i64Z_Tag tag;
12220    union {
12221       struct {
12222          int64_t some;
12223       };
12224    };
12225 } LDKCOption_i64Z;
12226
12227 /**
12228  * The contents of CResult_SocketAddressDecodeErrorZ
12229  */
12230 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
12231    /**
12232     * A pointer to the contents in the success state.
12233     * Reading from this pointer when `result_ok` is not set is undefined.
12234     */
12235    struct LDKSocketAddress *result;
12236    /**
12237     * A pointer to the contents in the error state.
12238     * Reading from this pointer when `result_ok` is set is undefined.
12239     */
12240    struct LDKDecodeError *err;
12241 } LDKCResult_SocketAddressDecodeErrorZPtr;
12242
12243 /**
12244  * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
12245  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
12246  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12247  */
12248 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
12249    /**
12250     * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
12251     * `err` or `result` depending on the state of `result_ok`.
12252     */
12253    union LDKCResult_SocketAddressDecodeErrorZPtr contents;
12254    /**
12255     * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
12256     */
12257    bool result_ok;
12258 } LDKCResult_SocketAddressDecodeErrorZ;
12259
12260 /**
12261  * The contents of CResult_SocketAddressSocketAddressParseErrorZ
12262  */
12263 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
12264    /**
12265     * A pointer to the contents in the success state.
12266     * Reading from this pointer when `result_ok` is not set is undefined.
12267     */
12268    struct LDKSocketAddress *result;
12269    /**
12270     * A pointer to the contents in the error state.
12271     * Reading from this pointer when `result_ok` is set is undefined.
12272     */
12273    enum LDKSocketAddressParseError *err;
12274 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
12275
12276 /**
12277  * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
12278  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
12279  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12280  */
12281 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
12282    /**
12283     * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
12284     * `err` or `result` depending on the state of `result_ok`.
12285     */
12286    union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
12287    /**
12288     * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
12289     */
12290    bool result_ok;
12291 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
12292
12293
12294
12295 /**
12296  * An [`update_add_htlc`] message to be sent to or received from a peer.
12297  *
12298  * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
12299  */
12300 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
12301    /**
12302     * A pointer to the opaque Rust object.
12303     * Nearly everywhere, inner must be non-null, however in places where
12304     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12305     */
12306    LDKnativeUpdateAddHTLC *inner;
12307    /**
12308     * Indicates that this is the only struct which contains the same pointer.
12309     * Rust functions which take ownership of an object provided via an argument require
12310     * this to be true and invalidate the object pointed to by inner.
12311     */
12312    bool is_owned;
12313 } LDKUpdateAddHTLC;
12314
12315 /**
12316  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
12317  * This corresponds to std::vector in C++
12318  */
12319 typedef struct LDKCVec_UpdateAddHTLCZ {
12320    /**
12321     * The elements in the array.
12322     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12323     */
12324    struct LDKUpdateAddHTLC *data;
12325    /**
12326     * The number of elements pointed to by `data`.
12327     */
12328    uintptr_t datalen;
12329 } LDKCVec_UpdateAddHTLCZ;
12330
12331
12332
12333 /**
12334  * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
12335  *
12336  * [`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
12337  */
12338 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
12339    /**
12340     * A pointer to the opaque Rust object.
12341     * Nearly everywhere, inner must be non-null, however in places where
12342     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12343     */
12344    LDKnativeUpdateFulfillHTLC *inner;
12345    /**
12346     * Indicates that this is the only struct which contains the same pointer.
12347     * Rust functions which take ownership of an object provided via an argument require
12348     * this to be true and invalidate the object pointed to by inner.
12349     */
12350    bool is_owned;
12351 } LDKUpdateFulfillHTLC;
12352
12353 /**
12354  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
12355  * This corresponds to std::vector in C++
12356  */
12357 typedef struct LDKCVec_UpdateFulfillHTLCZ {
12358    /**
12359     * The elements in the array.
12360     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12361     */
12362    struct LDKUpdateFulfillHTLC *data;
12363    /**
12364     * The number of elements pointed to by `data`.
12365     */
12366    uintptr_t datalen;
12367 } LDKCVec_UpdateFulfillHTLCZ;
12368
12369
12370
12371 /**
12372  * An [`update_fail_htlc`] message to be sent to or received from a peer.
12373  *
12374  * [`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
12375  */
12376 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
12377    /**
12378     * A pointer to the opaque Rust object.
12379     * Nearly everywhere, inner must be non-null, however in places where
12380     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12381     */
12382    LDKnativeUpdateFailHTLC *inner;
12383    /**
12384     * Indicates that this is the only struct which contains the same pointer.
12385     * Rust functions which take ownership of an object provided via an argument require
12386     * this to be true and invalidate the object pointed to by inner.
12387     */
12388    bool is_owned;
12389 } LDKUpdateFailHTLC;
12390
12391 /**
12392  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
12393  * This corresponds to std::vector in C++
12394  */
12395 typedef struct LDKCVec_UpdateFailHTLCZ {
12396    /**
12397     * The elements in the array.
12398     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12399     */
12400    struct LDKUpdateFailHTLC *data;
12401    /**
12402     * The number of elements pointed to by `data`.
12403     */
12404    uintptr_t datalen;
12405 } LDKCVec_UpdateFailHTLCZ;
12406
12407
12408
12409 /**
12410  * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
12411  *
12412  * [`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
12413  */
12414 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
12415    /**
12416     * A pointer to the opaque Rust object.
12417     * Nearly everywhere, inner must be non-null, however in places where
12418     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12419     */
12420    LDKnativeUpdateFailMalformedHTLC *inner;
12421    /**
12422     * Indicates that this is the only struct which contains the same pointer.
12423     * Rust functions which take ownership of an object provided via an argument require
12424     * this to be true and invalidate the object pointed to by inner.
12425     */
12426    bool is_owned;
12427 } LDKUpdateFailMalformedHTLC;
12428
12429 /**
12430  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
12431  * This corresponds to std::vector in C++
12432  */
12433 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
12434    /**
12435     * The elements in the array.
12436     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12437     */
12438    struct LDKUpdateFailMalformedHTLC *data;
12439    /**
12440     * The number of elements pointed to by `data`.
12441     */
12442    uintptr_t datalen;
12443 } LDKCVec_UpdateFailMalformedHTLCZ;
12444
12445 /**
12446  * The contents of CResult_AcceptChannelDecodeErrorZ
12447  */
12448 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
12449    /**
12450     * A pointer to the contents in the success state.
12451     * Reading from this pointer when `result_ok` is not set is undefined.
12452     */
12453    struct LDKAcceptChannel *result;
12454    /**
12455     * A pointer to the contents in the error state.
12456     * Reading from this pointer when `result_ok` is set is undefined.
12457     */
12458    struct LDKDecodeError *err;
12459 } LDKCResult_AcceptChannelDecodeErrorZPtr;
12460
12461 /**
12462  * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
12463  * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
12464  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12465  */
12466 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
12467    /**
12468     * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
12469     * `err` or `result` depending on the state of `result_ok`.
12470     */
12471    union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
12472    /**
12473     * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
12474     */
12475    bool result_ok;
12476 } LDKCResult_AcceptChannelDecodeErrorZ;
12477
12478 /**
12479  * The contents of CResult_AcceptChannelV2DecodeErrorZ
12480  */
12481 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
12482    /**
12483     * A pointer to the contents in the success state.
12484     * Reading from this pointer when `result_ok` is not set is undefined.
12485     */
12486    struct LDKAcceptChannelV2 *result;
12487    /**
12488     * A pointer to the contents in the error state.
12489     * Reading from this pointer when `result_ok` is set is undefined.
12490     */
12491    struct LDKDecodeError *err;
12492 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
12493
12494 /**
12495  * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
12496  * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
12497  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12498  */
12499 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
12500    /**
12501     * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
12502     * `err` or `result` depending on the state of `result_ok`.
12503     */
12504    union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
12505    /**
12506     * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
12507     */
12508    bool result_ok;
12509 } LDKCResult_AcceptChannelV2DecodeErrorZ;
12510
12511 /**
12512  * The contents of CResult_StfuDecodeErrorZ
12513  */
12514 typedef union LDKCResult_StfuDecodeErrorZPtr {
12515    /**
12516     * A pointer to the contents in the success state.
12517     * Reading from this pointer when `result_ok` is not set is undefined.
12518     */
12519    struct LDKStfu *result;
12520    /**
12521     * A pointer to the contents in the error state.
12522     * Reading from this pointer when `result_ok` is set is undefined.
12523     */
12524    struct LDKDecodeError *err;
12525 } LDKCResult_StfuDecodeErrorZPtr;
12526
12527 /**
12528  * A CResult_StfuDecodeErrorZ represents the result of a fallible operation,
12529  * containing a crate::lightning::ln::msgs::Stfu on success and a crate::lightning::ln::msgs::DecodeError on failure.
12530  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12531  */
12532 typedef struct LDKCResult_StfuDecodeErrorZ {
12533    /**
12534     * The contents of this CResult_StfuDecodeErrorZ, accessible via either
12535     * `err` or `result` depending on the state of `result_ok`.
12536     */
12537    union LDKCResult_StfuDecodeErrorZPtr contents;
12538    /**
12539     * Whether this CResult_StfuDecodeErrorZ represents a success state.
12540     */
12541    bool result_ok;
12542 } LDKCResult_StfuDecodeErrorZ;
12543
12544 /**
12545  * The contents of CResult_SpliceDecodeErrorZ
12546  */
12547 typedef union LDKCResult_SpliceDecodeErrorZPtr {
12548    /**
12549     * A pointer to the contents in the success state.
12550     * Reading from this pointer when `result_ok` is not set is undefined.
12551     */
12552    struct LDKSplice *result;
12553    /**
12554     * A pointer to the contents in the error state.
12555     * Reading from this pointer when `result_ok` is set is undefined.
12556     */
12557    struct LDKDecodeError *err;
12558 } LDKCResult_SpliceDecodeErrorZPtr;
12559
12560 /**
12561  * A CResult_SpliceDecodeErrorZ represents the result of a fallible operation,
12562  * containing a crate::lightning::ln::msgs::Splice on success and a crate::lightning::ln::msgs::DecodeError on failure.
12563  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12564  */
12565 typedef struct LDKCResult_SpliceDecodeErrorZ {
12566    /**
12567     * The contents of this CResult_SpliceDecodeErrorZ, accessible via either
12568     * `err` or `result` depending on the state of `result_ok`.
12569     */
12570    union LDKCResult_SpliceDecodeErrorZPtr contents;
12571    /**
12572     * Whether this CResult_SpliceDecodeErrorZ represents a success state.
12573     */
12574    bool result_ok;
12575 } LDKCResult_SpliceDecodeErrorZ;
12576
12577 /**
12578  * The contents of CResult_SpliceAckDecodeErrorZ
12579  */
12580 typedef union LDKCResult_SpliceAckDecodeErrorZPtr {
12581    /**
12582     * A pointer to the contents in the success state.
12583     * Reading from this pointer when `result_ok` is not set is undefined.
12584     */
12585    struct LDKSpliceAck *result;
12586    /**
12587     * A pointer to the contents in the error state.
12588     * Reading from this pointer when `result_ok` is set is undefined.
12589     */
12590    struct LDKDecodeError *err;
12591 } LDKCResult_SpliceAckDecodeErrorZPtr;
12592
12593 /**
12594  * A CResult_SpliceAckDecodeErrorZ represents the result of a fallible operation,
12595  * containing a crate::lightning::ln::msgs::SpliceAck on success and a crate::lightning::ln::msgs::DecodeError on failure.
12596  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12597  */
12598 typedef struct LDKCResult_SpliceAckDecodeErrorZ {
12599    /**
12600     * The contents of this CResult_SpliceAckDecodeErrorZ, accessible via either
12601     * `err` or `result` depending on the state of `result_ok`.
12602     */
12603    union LDKCResult_SpliceAckDecodeErrorZPtr contents;
12604    /**
12605     * Whether this CResult_SpliceAckDecodeErrorZ represents a success state.
12606     */
12607    bool result_ok;
12608 } LDKCResult_SpliceAckDecodeErrorZ;
12609
12610 /**
12611  * The contents of CResult_SpliceLockedDecodeErrorZ
12612  */
12613 typedef union LDKCResult_SpliceLockedDecodeErrorZPtr {
12614    /**
12615     * A pointer to the contents in the success state.
12616     * Reading from this pointer when `result_ok` is not set is undefined.
12617     */
12618    struct LDKSpliceLocked *result;
12619    /**
12620     * A pointer to the contents in the error state.
12621     * Reading from this pointer when `result_ok` is set is undefined.
12622     */
12623    struct LDKDecodeError *err;
12624 } LDKCResult_SpliceLockedDecodeErrorZPtr;
12625
12626 /**
12627  * A CResult_SpliceLockedDecodeErrorZ represents the result of a fallible operation,
12628  * containing a crate::lightning::ln::msgs::SpliceLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
12629  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12630  */
12631 typedef struct LDKCResult_SpliceLockedDecodeErrorZ {
12632    /**
12633     * The contents of this CResult_SpliceLockedDecodeErrorZ, accessible via either
12634     * `err` or `result` depending on the state of `result_ok`.
12635     */
12636    union LDKCResult_SpliceLockedDecodeErrorZPtr contents;
12637    /**
12638     * Whether this CResult_SpliceLockedDecodeErrorZ represents a success state.
12639     */
12640    bool result_ok;
12641 } LDKCResult_SpliceLockedDecodeErrorZ;
12642
12643 /**
12644  * The contents of CResult_TxAddInputDecodeErrorZ
12645  */
12646 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
12647    /**
12648     * A pointer to the contents in the success state.
12649     * Reading from this pointer when `result_ok` is not set is undefined.
12650     */
12651    struct LDKTxAddInput *result;
12652    /**
12653     * A pointer to the contents in the error state.
12654     * Reading from this pointer when `result_ok` is set is undefined.
12655     */
12656    struct LDKDecodeError *err;
12657 } LDKCResult_TxAddInputDecodeErrorZPtr;
12658
12659 /**
12660  * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
12661  * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
12662  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12663  */
12664 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
12665    /**
12666     * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
12667     * `err` or `result` depending on the state of `result_ok`.
12668     */
12669    union LDKCResult_TxAddInputDecodeErrorZPtr contents;
12670    /**
12671     * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
12672     */
12673    bool result_ok;
12674 } LDKCResult_TxAddInputDecodeErrorZ;
12675
12676 /**
12677  * The contents of CResult_TxAddOutputDecodeErrorZ
12678  */
12679 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
12680    /**
12681     * A pointer to the contents in the success state.
12682     * Reading from this pointer when `result_ok` is not set is undefined.
12683     */
12684    struct LDKTxAddOutput *result;
12685    /**
12686     * A pointer to the contents in the error state.
12687     * Reading from this pointer when `result_ok` is set is undefined.
12688     */
12689    struct LDKDecodeError *err;
12690 } LDKCResult_TxAddOutputDecodeErrorZPtr;
12691
12692 /**
12693  * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
12694  * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
12695  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12696  */
12697 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
12698    /**
12699     * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
12700     * `err` or `result` depending on the state of `result_ok`.
12701     */
12702    union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
12703    /**
12704     * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
12705     */
12706    bool result_ok;
12707 } LDKCResult_TxAddOutputDecodeErrorZ;
12708
12709 /**
12710  * The contents of CResult_TxRemoveInputDecodeErrorZ
12711  */
12712 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
12713    /**
12714     * A pointer to the contents in the success state.
12715     * Reading from this pointer when `result_ok` is not set is undefined.
12716     */
12717    struct LDKTxRemoveInput *result;
12718    /**
12719     * A pointer to the contents in the error state.
12720     * Reading from this pointer when `result_ok` is set is undefined.
12721     */
12722    struct LDKDecodeError *err;
12723 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
12724
12725 /**
12726  * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
12727  * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
12728  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12729  */
12730 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
12731    /**
12732     * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
12733     * `err` or `result` depending on the state of `result_ok`.
12734     */
12735    union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
12736    /**
12737     * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
12738     */
12739    bool result_ok;
12740 } LDKCResult_TxRemoveInputDecodeErrorZ;
12741
12742 /**
12743  * The contents of CResult_TxRemoveOutputDecodeErrorZ
12744  */
12745 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
12746    /**
12747     * A pointer to the contents in the success state.
12748     * Reading from this pointer when `result_ok` is not set is undefined.
12749     */
12750    struct LDKTxRemoveOutput *result;
12751    /**
12752     * A pointer to the contents in the error state.
12753     * Reading from this pointer when `result_ok` is set is undefined.
12754     */
12755    struct LDKDecodeError *err;
12756 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
12757
12758 /**
12759  * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
12760  * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
12761  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12762  */
12763 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
12764    /**
12765     * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
12766     * `err` or `result` depending on the state of `result_ok`.
12767     */
12768    union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
12769    /**
12770     * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
12771     */
12772    bool result_ok;
12773 } LDKCResult_TxRemoveOutputDecodeErrorZ;
12774
12775 /**
12776  * The contents of CResult_TxCompleteDecodeErrorZ
12777  */
12778 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
12779    /**
12780     * A pointer to the contents in the success state.
12781     * Reading from this pointer when `result_ok` is not set is undefined.
12782     */
12783    struct LDKTxComplete *result;
12784    /**
12785     * A pointer to the contents in the error state.
12786     * Reading from this pointer when `result_ok` is set is undefined.
12787     */
12788    struct LDKDecodeError *err;
12789 } LDKCResult_TxCompleteDecodeErrorZPtr;
12790
12791 /**
12792  * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
12793  * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
12794  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12795  */
12796 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
12797    /**
12798     * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
12799     * `err` or `result` depending on the state of `result_ok`.
12800     */
12801    union LDKCResult_TxCompleteDecodeErrorZPtr contents;
12802    /**
12803     * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
12804     */
12805    bool result_ok;
12806 } LDKCResult_TxCompleteDecodeErrorZ;
12807
12808 /**
12809  * The contents of CResult_TxSignaturesDecodeErrorZ
12810  */
12811 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
12812    /**
12813     * A pointer to the contents in the success state.
12814     * Reading from this pointer when `result_ok` is not set is undefined.
12815     */
12816    struct LDKTxSignatures *result;
12817    /**
12818     * A pointer to the contents in the error state.
12819     * Reading from this pointer when `result_ok` is set is undefined.
12820     */
12821    struct LDKDecodeError *err;
12822 } LDKCResult_TxSignaturesDecodeErrorZPtr;
12823
12824 /**
12825  * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
12826  * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
12827  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12828  */
12829 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
12830    /**
12831     * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
12832     * `err` or `result` depending on the state of `result_ok`.
12833     */
12834    union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
12835    /**
12836     * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
12837     */
12838    bool result_ok;
12839 } LDKCResult_TxSignaturesDecodeErrorZ;
12840
12841 /**
12842  * The contents of CResult_TxInitRbfDecodeErrorZ
12843  */
12844 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
12845    /**
12846     * A pointer to the contents in the success state.
12847     * Reading from this pointer when `result_ok` is not set is undefined.
12848     */
12849    struct LDKTxInitRbf *result;
12850    /**
12851     * A pointer to the contents in the error state.
12852     * Reading from this pointer when `result_ok` is set is undefined.
12853     */
12854    struct LDKDecodeError *err;
12855 } LDKCResult_TxInitRbfDecodeErrorZPtr;
12856
12857 /**
12858  * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
12859  * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
12860  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12861  */
12862 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
12863    /**
12864     * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
12865     * `err` or `result` depending on the state of `result_ok`.
12866     */
12867    union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
12868    /**
12869     * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
12870     */
12871    bool result_ok;
12872 } LDKCResult_TxInitRbfDecodeErrorZ;
12873
12874 /**
12875  * The contents of CResult_TxAckRbfDecodeErrorZ
12876  */
12877 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
12878    /**
12879     * A pointer to the contents in the success state.
12880     * Reading from this pointer when `result_ok` is not set is undefined.
12881     */
12882    struct LDKTxAckRbf *result;
12883    /**
12884     * A pointer to the contents in the error state.
12885     * Reading from this pointer when `result_ok` is set is undefined.
12886     */
12887    struct LDKDecodeError *err;
12888 } LDKCResult_TxAckRbfDecodeErrorZPtr;
12889
12890 /**
12891  * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
12892  * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
12893  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12894  */
12895 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
12896    /**
12897     * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
12898     * `err` or `result` depending on the state of `result_ok`.
12899     */
12900    union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
12901    /**
12902     * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
12903     */
12904    bool result_ok;
12905 } LDKCResult_TxAckRbfDecodeErrorZ;
12906
12907 /**
12908  * The contents of CResult_TxAbortDecodeErrorZ
12909  */
12910 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
12911    /**
12912     * A pointer to the contents in the success state.
12913     * Reading from this pointer when `result_ok` is not set is undefined.
12914     */
12915    struct LDKTxAbort *result;
12916    /**
12917     * A pointer to the contents in the error state.
12918     * Reading from this pointer when `result_ok` is set is undefined.
12919     */
12920    struct LDKDecodeError *err;
12921 } LDKCResult_TxAbortDecodeErrorZPtr;
12922
12923 /**
12924  * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
12925  * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
12926  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12927  */
12928 typedef struct LDKCResult_TxAbortDecodeErrorZ {
12929    /**
12930     * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
12931     * `err` or `result` depending on the state of `result_ok`.
12932     */
12933    union LDKCResult_TxAbortDecodeErrorZPtr contents;
12934    /**
12935     * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
12936     */
12937    bool result_ok;
12938 } LDKCResult_TxAbortDecodeErrorZ;
12939
12940 /**
12941  * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
12942  */
12943 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
12944    /**
12945     * A pointer to the contents in the success state.
12946     * Reading from this pointer when `result_ok` is not set is undefined.
12947     */
12948    struct LDKAnnouncementSignatures *result;
12949    /**
12950     * A pointer to the contents in the error state.
12951     * Reading from this pointer when `result_ok` is set is undefined.
12952     */
12953    struct LDKDecodeError *err;
12954 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
12955
12956 /**
12957  * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
12958  * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
12959  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12960  */
12961 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
12962    /**
12963     * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
12964     * `err` or `result` depending on the state of `result_ok`.
12965     */
12966    union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
12967    /**
12968     * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
12969     */
12970    bool result_ok;
12971 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
12972
12973 /**
12974  * The contents of CResult_ChannelReestablishDecodeErrorZ
12975  */
12976 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
12977    /**
12978     * A pointer to the contents in the success state.
12979     * Reading from this pointer when `result_ok` is not set is undefined.
12980     */
12981    struct LDKChannelReestablish *result;
12982    /**
12983     * A pointer to the contents in the error state.
12984     * Reading from this pointer when `result_ok` is set is undefined.
12985     */
12986    struct LDKDecodeError *err;
12987 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
12988
12989 /**
12990  * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
12991  * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
12992  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12993  */
12994 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
12995    /**
12996     * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
12997     * `err` or `result` depending on the state of `result_ok`.
12998     */
12999    union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
13000    /**
13001     * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
13002     */
13003    bool result_ok;
13004 } LDKCResult_ChannelReestablishDecodeErrorZ;
13005
13006 /**
13007  * The contents of CResult_ClosingSignedDecodeErrorZ
13008  */
13009 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
13010    /**
13011     * A pointer to the contents in the success state.
13012     * Reading from this pointer when `result_ok` is not set is undefined.
13013     */
13014    struct LDKClosingSigned *result;
13015    /**
13016     * A pointer to the contents in the error state.
13017     * Reading from this pointer when `result_ok` is set is undefined.
13018     */
13019    struct LDKDecodeError *err;
13020 } LDKCResult_ClosingSignedDecodeErrorZPtr;
13021
13022 /**
13023  * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
13024  * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
13025  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13026  */
13027 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
13028    /**
13029     * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
13030     * `err` or `result` depending on the state of `result_ok`.
13031     */
13032    union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
13033    /**
13034     * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
13035     */
13036    bool result_ok;
13037 } LDKCResult_ClosingSignedDecodeErrorZ;
13038
13039
13040
13041 /**
13042  * The minimum and maximum fees which the sender is willing to place on the closing transaction.
13043  *
13044  * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
13045  * to use.
13046  */
13047 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
13048    /**
13049     * A pointer to the opaque Rust object.
13050     * Nearly everywhere, inner must be non-null, however in places where
13051     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13052     */
13053    LDKnativeClosingSignedFeeRange *inner;
13054    /**
13055     * Indicates that this is the only struct which contains the same pointer.
13056     * Rust functions which take ownership of an object provided via an argument require
13057     * this to be true and invalidate the object pointed to by inner.
13058     */
13059    bool is_owned;
13060 } LDKClosingSignedFeeRange;
13061
13062 /**
13063  * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
13064  */
13065 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
13066    /**
13067     * A pointer to the contents in the success state.
13068     * Reading from this pointer when `result_ok` is not set is undefined.
13069     */
13070    struct LDKClosingSignedFeeRange *result;
13071    /**
13072     * A pointer to the contents in the error state.
13073     * Reading from this pointer when `result_ok` is set is undefined.
13074     */
13075    struct LDKDecodeError *err;
13076 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
13077
13078 /**
13079  * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
13080  * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
13081  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13082  */
13083 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
13084    /**
13085     * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
13086     * `err` or `result` depending on the state of `result_ok`.
13087     */
13088    union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
13089    /**
13090     * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
13091     */
13092    bool result_ok;
13093 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
13094
13095
13096
13097 /**
13098  * A [`commitment_signed`] message to be sent to or received from a peer.
13099  *
13100  * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
13101  */
13102 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
13103    /**
13104     * A pointer to the opaque Rust object.
13105     * Nearly everywhere, inner must be non-null, however in places where
13106     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13107     */
13108    LDKnativeCommitmentSigned *inner;
13109    /**
13110     * Indicates that this is the only struct which contains the same pointer.
13111     * Rust functions which take ownership of an object provided via an argument require
13112     * this to be true and invalidate the object pointed to by inner.
13113     */
13114    bool is_owned;
13115 } LDKCommitmentSigned;
13116
13117 /**
13118  * The contents of CResult_CommitmentSignedDecodeErrorZ
13119  */
13120 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
13121    /**
13122     * A pointer to the contents in the success state.
13123     * Reading from this pointer when `result_ok` is not set is undefined.
13124     */
13125    struct LDKCommitmentSigned *result;
13126    /**
13127     * A pointer to the contents in the error state.
13128     * Reading from this pointer when `result_ok` is set is undefined.
13129     */
13130    struct LDKDecodeError *err;
13131 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
13132
13133 /**
13134  * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
13135  * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
13136  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13137  */
13138 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
13139    /**
13140     * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
13141     * `err` or `result` depending on the state of `result_ok`.
13142     */
13143    union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
13144    /**
13145     * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
13146     */
13147    bool result_ok;
13148 } LDKCResult_CommitmentSignedDecodeErrorZ;
13149
13150 /**
13151  * The contents of CResult_FundingCreatedDecodeErrorZ
13152  */
13153 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
13154    /**
13155     * A pointer to the contents in the success state.
13156     * Reading from this pointer when `result_ok` is not set is undefined.
13157     */
13158    struct LDKFundingCreated *result;
13159    /**
13160     * A pointer to the contents in the error state.
13161     * Reading from this pointer when `result_ok` is set is undefined.
13162     */
13163    struct LDKDecodeError *err;
13164 } LDKCResult_FundingCreatedDecodeErrorZPtr;
13165
13166 /**
13167  * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
13168  * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
13169  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13170  */
13171 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
13172    /**
13173     * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
13174     * `err` or `result` depending on the state of `result_ok`.
13175     */
13176    union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
13177    /**
13178     * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
13179     */
13180    bool result_ok;
13181 } LDKCResult_FundingCreatedDecodeErrorZ;
13182
13183 /**
13184  * The contents of CResult_FundingSignedDecodeErrorZ
13185  */
13186 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
13187    /**
13188     * A pointer to the contents in the success state.
13189     * Reading from this pointer when `result_ok` is not set is undefined.
13190     */
13191    struct LDKFundingSigned *result;
13192    /**
13193     * A pointer to the contents in the error state.
13194     * Reading from this pointer when `result_ok` is set is undefined.
13195     */
13196    struct LDKDecodeError *err;
13197 } LDKCResult_FundingSignedDecodeErrorZPtr;
13198
13199 /**
13200  * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
13201  * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
13202  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13203  */
13204 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
13205    /**
13206     * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
13207     * `err` or `result` depending on the state of `result_ok`.
13208     */
13209    union LDKCResult_FundingSignedDecodeErrorZPtr contents;
13210    /**
13211     * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
13212     */
13213    bool result_ok;
13214 } LDKCResult_FundingSignedDecodeErrorZ;
13215
13216 /**
13217  * The contents of CResult_ChannelReadyDecodeErrorZ
13218  */
13219 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
13220    /**
13221     * A pointer to the contents in the success state.
13222     * Reading from this pointer when `result_ok` is not set is undefined.
13223     */
13224    struct LDKChannelReady *result;
13225    /**
13226     * A pointer to the contents in the error state.
13227     * Reading from this pointer when `result_ok` is set is undefined.
13228     */
13229    struct LDKDecodeError *err;
13230 } LDKCResult_ChannelReadyDecodeErrorZPtr;
13231
13232 /**
13233  * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
13234  * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
13235  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13236  */
13237 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
13238    /**
13239     * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
13240     * `err` or `result` depending on the state of `result_ok`.
13241     */
13242    union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
13243    /**
13244     * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
13245     */
13246    bool result_ok;
13247 } LDKCResult_ChannelReadyDecodeErrorZ;
13248
13249
13250
13251 /**
13252  * An [`init`] message to be sent to or received from a peer.
13253  *
13254  * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
13255  */
13256 typedef struct MUST_USE_STRUCT LDKInit {
13257    /**
13258     * A pointer to the opaque Rust object.
13259     * Nearly everywhere, inner must be non-null, however in places where
13260     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13261     */
13262    LDKnativeInit *inner;
13263    /**
13264     * Indicates that this is the only struct which contains the same pointer.
13265     * Rust functions which take ownership of an object provided via an argument require
13266     * this to be true and invalidate the object pointed to by inner.
13267     */
13268    bool is_owned;
13269 } LDKInit;
13270
13271 /**
13272  * The contents of CResult_InitDecodeErrorZ
13273  */
13274 typedef union LDKCResult_InitDecodeErrorZPtr {
13275    /**
13276     * A pointer to the contents in the success state.
13277     * Reading from this pointer when `result_ok` is not set is undefined.
13278     */
13279    struct LDKInit *result;
13280    /**
13281     * A pointer to the contents in the error state.
13282     * Reading from this pointer when `result_ok` is set is undefined.
13283     */
13284    struct LDKDecodeError *err;
13285 } LDKCResult_InitDecodeErrorZPtr;
13286
13287 /**
13288  * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
13289  * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
13290  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13291  */
13292 typedef struct LDKCResult_InitDecodeErrorZ {
13293    /**
13294     * The contents of this CResult_InitDecodeErrorZ, accessible via either
13295     * `err` or `result` depending on the state of `result_ok`.
13296     */
13297    union LDKCResult_InitDecodeErrorZPtr contents;
13298    /**
13299     * Whether this CResult_InitDecodeErrorZ represents a success state.
13300     */
13301    bool result_ok;
13302 } LDKCResult_InitDecodeErrorZ;
13303
13304 /**
13305  * The contents of CResult_OpenChannelDecodeErrorZ
13306  */
13307 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
13308    /**
13309     * A pointer to the contents in the success state.
13310     * Reading from this pointer when `result_ok` is not set is undefined.
13311     */
13312    struct LDKOpenChannel *result;
13313    /**
13314     * A pointer to the contents in the error state.
13315     * Reading from this pointer when `result_ok` is set is undefined.
13316     */
13317    struct LDKDecodeError *err;
13318 } LDKCResult_OpenChannelDecodeErrorZPtr;
13319
13320 /**
13321  * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
13322  * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
13323  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13324  */
13325 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
13326    /**
13327     * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
13328     * `err` or `result` depending on the state of `result_ok`.
13329     */
13330    union LDKCResult_OpenChannelDecodeErrorZPtr contents;
13331    /**
13332     * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
13333     */
13334    bool result_ok;
13335 } LDKCResult_OpenChannelDecodeErrorZ;
13336
13337 /**
13338  * The contents of CResult_OpenChannelV2DecodeErrorZ
13339  */
13340 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
13341    /**
13342     * A pointer to the contents in the success state.
13343     * Reading from this pointer when `result_ok` is not set is undefined.
13344     */
13345    struct LDKOpenChannelV2 *result;
13346    /**
13347     * A pointer to the contents in the error state.
13348     * Reading from this pointer when `result_ok` is set is undefined.
13349     */
13350    struct LDKDecodeError *err;
13351 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
13352
13353 /**
13354  * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
13355  * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
13356  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13357  */
13358 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
13359    /**
13360     * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
13361     * `err` or `result` depending on the state of `result_ok`.
13362     */
13363    union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
13364    /**
13365     * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
13366     */
13367    bool result_ok;
13368 } LDKCResult_OpenChannelV2DecodeErrorZ;
13369
13370 /**
13371  * The contents of CResult_RevokeAndACKDecodeErrorZ
13372  */
13373 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
13374    /**
13375     * A pointer to the contents in the success state.
13376     * Reading from this pointer when `result_ok` is not set is undefined.
13377     */
13378    struct LDKRevokeAndACK *result;
13379    /**
13380     * A pointer to the contents in the error state.
13381     * Reading from this pointer when `result_ok` is set is undefined.
13382     */
13383    struct LDKDecodeError *err;
13384 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
13385
13386 /**
13387  * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
13388  * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
13389  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13390  */
13391 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
13392    /**
13393     * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
13394     * `err` or `result` depending on the state of `result_ok`.
13395     */
13396    union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
13397    /**
13398     * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
13399     */
13400    bool result_ok;
13401 } LDKCResult_RevokeAndACKDecodeErrorZ;
13402
13403 /**
13404  * The contents of CResult_ShutdownDecodeErrorZ
13405  */
13406 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
13407    /**
13408     * A pointer to the contents in the success state.
13409     * Reading from this pointer when `result_ok` is not set is undefined.
13410     */
13411    struct LDKShutdown *result;
13412    /**
13413     * A pointer to the contents in the error state.
13414     * Reading from this pointer when `result_ok` is set is undefined.
13415     */
13416    struct LDKDecodeError *err;
13417 } LDKCResult_ShutdownDecodeErrorZPtr;
13418
13419 /**
13420  * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
13421  * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
13422  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13423  */
13424 typedef struct LDKCResult_ShutdownDecodeErrorZ {
13425    /**
13426     * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
13427     * `err` or `result` depending on the state of `result_ok`.
13428     */
13429    union LDKCResult_ShutdownDecodeErrorZPtr contents;
13430    /**
13431     * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
13432     */
13433    bool result_ok;
13434 } LDKCResult_ShutdownDecodeErrorZ;
13435
13436 /**
13437  * The contents of CResult_UpdateFailHTLCDecodeErrorZ
13438  */
13439 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
13440    /**
13441     * A pointer to the contents in the success state.
13442     * Reading from this pointer when `result_ok` is not set is undefined.
13443     */
13444    struct LDKUpdateFailHTLC *result;
13445    /**
13446     * A pointer to the contents in the error state.
13447     * Reading from this pointer when `result_ok` is set is undefined.
13448     */
13449    struct LDKDecodeError *err;
13450 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
13451
13452 /**
13453  * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
13454  * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13455  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13456  */
13457 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
13458    /**
13459     * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
13460     * `err` or `result` depending on the state of `result_ok`.
13461     */
13462    union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
13463    /**
13464     * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
13465     */
13466    bool result_ok;
13467 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
13468
13469 /**
13470  * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
13471  */
13472 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
13473    /**
13474     * A pointer to the contents in the success state.
13475     * Reading from this pointer when `result_ok` is not set is undefined.
13476     */
13477    struct LDKUpdateFailMalformedHTLC *result;
13478    /**
13479     * A pointer to the contents in the error state.
13480     * Reading from this pointer when `result_ok` is set is undefined.
13481     */
13482    struct LDKDecodeError *err;
13483 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
13484
13485 /**
13486  * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
13487  * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13488  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13489  */
13490 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
13491    /**
13492     * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
13493     * `err` or `result` depending on the state of `result_ok`.
13494     */
13495    union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
13496    /**
13497     * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
13498     */
13499    bool result_ok;
13500 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
13501
13502
13503
13504 /**
13505  * An [`update_fee`] message to be sent to or received from a peer
13506  *
13507  * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
13508  */
13509 typedef struct MUST_USE_STRUCT LDKUpdateFee {
13510    /**
13511     * A pointer to the opaque Rust object.
13512     * Nearly everywhere, inner must be non-null, however in places where
13513     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13514     */
13515    LDKnativeUpdateFee *inner;
13516    /**
13517     * Indicates that this is the only struct which contains the same pointer.
13518     * Rust functions which take ownership of an object provided via an argument require
13519     * this to be true and invalidate the object pointed to by inner.
13520     */
13521    bool is_owned;
13522 } LDKUpdateFee;
13523
13524 /**
13525  * The contents of CResult_UpdateFeeDecodeErrorZ
13526  */
13527 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
13528    /**
13529     * A pointer to the contents in the success state.
13530     * Reading from this pointer when `result_ok` is not set is undefined.
13531     */
13532    struct LDKUpdateFee *result;
13533    /**
13534     * A pointer to the contents in the error state.
13535     * Reading from this pointer when `result_ok` is set is undefined.
13536     */
13537    struct LDKDecodeError *err;
13538 } LDKCResult_UpdateFeeDecodeErrorZPtr;
13539
13540 /**
13541  * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
13542  * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
13543  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13544  */
13545 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
13546    /**
13547     * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
13548     * `err` or `result` depending on the state of `result_ok`.
13549     */
13550    union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
13551    /**
13552     * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
13553     */
13554    bool result_ok;
13555 } LDKCResult_UpdateFeeDecodeErrorZ;
13556
13557 /**
13558  * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
13559  */
13560 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
13561    /**
13562     * A pointer to the contents in the success state.
13563     * Reading from this pointer when `result_ok` is not set is undefined.
13564     */
13565    struct LDKUpdateFulfillHTLC *result;
13566    /**
13567     * A pointer to the contents in the error state.
13568     * Reading from this pointer when `result_ok` is set is undefined.
13569     */
13570    struct LDKDecodeError *err;
13571 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
13572
13573 /**
13574  * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
13575  * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13576  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13577  */
13578 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
13579    /**
13580     * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
13581     * `err` or `result` depending on the state of `result_ok`.
13582     */
13583    union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
13584    /**
13585     * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
13586     */
13587    bool result_ok;
13588 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
13589
13590 /**
13591  * The contents of CResult_OnionPacketDecodeErrorZ
13592  */
13593 typedef union LDKCResult_OnionPacketDecodeErrorZPtr {
13594    /**
13595     * A pointer to the contents in the success state.
13596     * Reading from this pointer when `result_ok` is not set is undefined.
13597     */
13598    struct LDKOnionPacket *result;
13599    /**
13600     * A pointer to the contents in the error state.
13601     * Reading from this pointer when `result_ok` is set is undefined.
13602     */
13603    struct LDKDecodeError *err;
13604 } LDKCResult_OnionPacketDecodeErrorZPtr;
13605
13606 /**
13607  * A CResult_OnionPacketDecodeErrorZ represents the result of a fallible operation,
13608  * containing a crate::lightning::ln::msgs::OnionPacket on success and a crate::lightning::ln::msgs::DecodeError on failure.
13609  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13610  */
13611 typedef struct LDKCResult_OnionPacketDecodeErrorZ {
13612    /**
13613     * The contents of this CResult_OnionPacketDecodeErrorZ, accessible via either
13614     * `err` or `result` depending on the state of `result_ok`.
13615     */
13616    union LDKCResult_OnionPacketDecodeErrorZPtr contents;
13617    /**
13618     * Whether this CResult_OnionPacketDecodeErrorZ represents a success state.
13619     */
13620    bool result_ok;
13621 } LDKCResult_OnionPacketDecodeErrorZ;
13622
13623 /**
13624  * The contents of CResult_UpdateAddHTLCDecodeErrorZ
13625  */
13626 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
13627    /**
13628     * A pointer to the contents in the success state.
13629     * Reading from this pointer when `result_ok` is not set is undefined.
13630     */
13631    struct LDKUpdateAddHTLC *result;
13632    /**
13633     * A pointer to the contents in the error state.
13634     * Reading from this pointer when `result_ok` is set is undefined.
13635     */
13636    struct LDKDecodeError *err;
13637 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
13638
13639 /**
13640  * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
13641  * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13642  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13643  */
13644 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
13645    /**
13646     * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
13647     * `err` or `result` depending on the state of `result_ok`.
13648     */
13649    union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
13650    /**
13651     * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
13652     */
13653    bool result_ok;
13654 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
13655
13656
13657
13658 /**
13659  * An onion message to be sent to or received from a peer.
13660  *
13661  */
13662 typedef struct MUST_USE_STRUCT LDKOnionMessage {
13663    /**
13664     * A pointer to the opaque Rust object.
13665     * Nearly everywhere, inner must be non-null, however in places where
13666     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13667     */
13668    LDKnativeOnionMessage *inner;
13669    /**
13670     * Indicates that this is the only struct which contains the same pointer.
13671     * Rust functions which take ownership of an object provided via an argument require
13672     * this to be true and invalidate the object pointed to by inner.
13673     */
13674    bool is_owned;
13675 } LDKOnionMessage;
13676
13677 /**
13678  * The contents of CResult_OnionMessageDecodeErrorZ
13679  */
13680 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
13681    /**
13682     * A pointer to the contents in the success state.
13683     * Reading from this pointer when `result_ok` is not set is undefined.
13684     */
13685    struct LDKOnionMessage *result;
13686    /**
13687     * A pointer to the contents in the error state.
13688     * Reading from this pointer when `result_ok` is set is undefined.
13689     */
13690    struct LDKDecodeError *err;
13691 } LDKCResult_OnionMessageDecodeErrorZPtr;
13692
13693 /**
13694  * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
13695  * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
13696  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13697  */
13698 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
13699    /**
13700     * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
13701     * `err` or `result` depending on the state of `result_ok`.
13702     */
13703    union LDKCResult_OnionMessageDecodeErrorZPtr contents;
13704    /**
13705     * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
13706     */
13707    bool result_ok;
13708 } LDKCResult_OnionMessageDecodeErrorZ;
13709
13710 /**
13711  * The contents of CResult_FinalOnionHopDataDecodeErrorZ
13712  */
13713 typedef union LDKCResult_FinalOnionHopDataDecodeErrorZPtr {
13714    /**
13715     * A pointer to the contents in the success state.
13716     * Reading from this pointer when `result_ok` is not set is undefined.
13717     */
13718    struct LDKFinalOnionHopData *result;
13719    /**
13720     * A pointer to the contents in the error state.
13721     * Reading from this pointer when `result_ok` is set is undefined.
13722     */
13723    struct LDKDecodeError *err;
13724 } LDKCResult_FinalOnionHopDataDecodeErrorZPtr;
13725
13726 /**
13727  * A CResult_FinalOnionHopDataDecodeErrorZ represents the result of a fallible operation,
13728  * containing a crate::lightning::ln::msgs::FinalOnionHopData on success and a crate::lightning::ln::msgs::DecodeError on failure.
13729  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13730  */
13731 typedef struct LDKCResult_FinalOnionHopDataDecodeErrorZ {
13732    /**
13733     * The contents of this CResult_FinalOnionHopDataDecodeErrorZ, accessible via either
13734     * `err` or `result` depending on the state of `result_ok`.
13735     */
13736    union LDKCResult_FinalOnionHopDataDecodeErrorZPtr contents;
13737    /**
13738     * Whether this CResult_FinalOnionHopDataDecodeErrorZ represents a success state.
13739     */
13740    bool result_ok;
13741 } LDKCResult_FinalOnionHopDataDecodeErrorZ;
13742
13743
13744
13745 /**
13746  * A [`ping`] message to be sent to or received from a peer.
13747  *
13748  * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
13749  */
13750 typedef struct MUST_USE_STRUCT LDKPing {
13751    /**
13752     * A pointer to the opaque Rust object.
13753     * Nearly everywhere, inner must be non-null, however in places where
13754     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13755     */
13756    LDKnativePing *inner;
13757    /**
13758     * Indicates that this is the only struct which contains the same pointer.
13759     * Rust functions which take ownership of an object provided via an argument require
13760     * this to be true and invalidate the object pointed to by inner.
13761     */
13762    bool is_owned;
13763 } LDKPing;
13764
13765 /**
13766  * The contents of CResult_PingDecodeErrorZ
13767  */
13768 typedef union LDKCResult_PingDecodeErrorZPtr {
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 LDKPing *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_PingDecodeErrorZPtr;
13780
13781 /**
13782  * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
13783  * containing a crate::lightning::ln::msgs::Ping 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_PingDecodeErrorZ {
13787    /**
13788     * The contents of this CResult_PingDecodeErrorZ, accessible via either
13789     * `err` or `result` depending on the state of `result_ok`.
13790     */
13791    union LDKCResult_PingDecodeErrorZPtr contents;
13792    /**
13793     * Whether this CResult_PingDecodeErrorZ represents a success state.
13794     */
13795    bool result_ok;
13796 } LDKCResult_PingDecodeErrorZ;
13797
13798
13799
13800 /**
13801  * A [`pong`] message to be sent to or received from a peer.
13802  *
13803  * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
13804  */
13805 typedef struct MUST_USE_STRUCT LDKPong {
13806    /**
13807     * A pointer to the opaque Rust object.
13808     * Nearly everywhere, inner must be non-null, however in places where
13809     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13810     */
13811    LDKnativePong *inner;
13812    /**
13813     * Indicates that this is the only struct which contains the same pointer.
13814     * Rust functions which take ownership of an object provided via an argument require
13815     * this to be true and invalidate the object pointed to by inner.
13816     */
13817    bool is_owned;
13818 } LDKPong;
13819
13820 /**
13821  * The contents of CResult_PongDecodeErrorZ
13822  */
13823 typedef union LDKCResult_PongDecodeErrorZPtr {
13824    /**
13825     * A pointer to the contents in the success state.
13826     * Reading from this pointer when `result_ok` is not set is undefined.
13827     */
13828    struct LDKPong *result;
13829    /**
13830     * A pointer to the contents in the error state.
13831     * Reading from this pointer when `result_ok` is set is undefined.
13832     */
13833    struct LDKDecodeError *err;
13834 } LDKCResult_PongDecodeErrorZPtr;
13835
13836 /**
13837  * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
13838  * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
13839  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13840  */
13841 typedef struct LDKCResult_PongDecodeErrorZ {
13842    /**
13843     * The contents of this CResult_PongDecodeErrorZ, accessible via either
13844     * `err` or `result` depending on the state of `result_ok`.
13845     */
13846    union LDKCResult_PongDecodeErrorZPtr contents;
13847    /**
13848     * Whether this CResult_PongDecodeErrorZ represents a success state.
13849     */
13850    bool result_ok;
13851 } LDKCResult_PongDecodeErrorZ;
13852
13853 /**
13854  * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
13855  */
13856 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
13857    /**
13858     * A pointer to the contents in the success state.
13859     * Reading from this pointer when `result_ok` is not set is undefined.
13860     */
13861    struct LDKUnsignedChannelAnnouncement *result;
13862    /**
13863     * A pointer to the contents in the error state.
13864     * Reading from this pointer when `result_ok` is set is undefined.
13865     */
13866    struct LDKDecodeError *err;
13867 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
13868
13869 /**
13870  * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
13871  * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
13872  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13873  */
13874 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
13875    /**
13876     * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
13877     * `err` or `result` depending on the state of `result_ok`.
13878     */
13879    union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
13880    /**
13881     * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
13882     */
13883    bool result_ok;
13884 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
13885
13886 /**
13887  * The contents of CResult_ChannelAnnouncementDecodeErrorZ
13888  */
13889 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
13890    /**
13891     * A pointer to the contents in the success state.
13892     * Reading from this pointer when `result_ok` is not set is undefined.
13893     */
13894    struct LDKChannelAnnouncement *result;
13895    /**
13896     * A pointer to the contents in the error state.
13897     * Reading from this pointer when `result_ok` is set is undefined.
13898     */
13899    struct LDKDecodeError *err;
13900 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
13901
13902 /**
13903  * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
13904  * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
13905  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13906  */
13907 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
13908    /**
13909     * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
13910     * `err` or `result` depending on the state of `result_ok`.
13911     */
13912    union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
13913    /**
13914     * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
13915     */
13916    bool result_ok;
13917 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
13918
13919 /**
13920  * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
13921  */
13922 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
13923    /**
13924     * A pointer to the contents in the success state.
13925     * Reading from this pointer when `result_ok` is not set is undefined.
13926     */
13927    struct LDKUnsignedChannelUpdate *result;
13928    /**
13929     * A pointer to the contents in the error state.
13930     * Reading from this pointer when `result_ok` is set is undefined.
13931     */
13932    struct LDKDecodeError *err;
13933 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
13934
13935 /**
13936  * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
13937  * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
13938  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13939  */
13940 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
13941    /**
13942     * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
13943     * `err` or `result` depending on the state of `result_ok`.
13944     */
13945    union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
13946    /**
13947     * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
13948     */
13949    bool result_ok;
13950 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
13951
13952 /**
13953  * The contents of CResult_ChannelUpdateDecodeErrorZ
13954  */
13955 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
13956    /**
13957     * A pointer to the contents in the success state.
13958     * Reading from this pointer when `result_ok` is not set is undefined.
13959     */
13960    struct LDKChannelUpdate *result;
13961    /**
13962     * A pointer to the contents in the error state.
13963     * Reading from this pointer when `result_ok` is set is undefined.
13964     */
13965    struct LDKDecodeError *err;
13966 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
13967
13968 /**
13969  * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
13970  * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
13971  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13972  */
13973 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
13974    /**
13975     * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
13976     * `err` or `result` depending on the state of `result_ok`.
13977     */
13978    union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
13979    /**
13980     * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
13981     */
13982    bool result_ok;
13983 } LDKCResult_ChannelUpdateDecodeErrorZ;
13984
13985 /**
13986  * The contents of CResult_ErrorMessageDecodeErrorZ
13987  */
13988 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
13989    /**
13990     * A pointer to the contents in the success state.
13991     * Reading from this pointer when `result_ok` is not set is undefined.
13992     */
13993    struct LDKErrorMessage *result;
13994    /**
13995     * A pointer to the contents in the error state.
13996     * Reading from this pointer when `result_ok` is set is undefined.
13997     */
13998    struct LDKDecodeError *err;
13999 } LDKCResult_ErrorMessageDecodeErrorZPtr;
14000
14001 /**
14002  * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
14003  * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
14004  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14005  */
14006 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
14007    /**
14008     * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
14009     * `err` or `result` depending on the state of `result_ok`.
14010     */
14011    union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
14012    /**
14013     * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
14014     */
14015    bool result_ok;
14016 } LDKCResult_ErrorMessageDecodeErrorZ;
14017
14018 /**
14019  * The contents of CResult_WarningMessageDecodeErrorZ
14020  */
14021 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
14022    /**
14023     * A pointer to the contents in the success state.
14024     * Reading from this pointer when `result_ok` is not set is undefined.
14025     */
14026    struct LDKWarningMessage *result;
14027    /**
14028     * A pointer to the contents in the error state.
14029     * Reading from this pointer when `result_ok` is set is undefined.
14030     */
14031    struct LDKDecodeError *err;
14032 } LDKCResult_WarningMessageDecodeErrorZPtr;
14033
14034 /**
14035  * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
14036  * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
14037  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14038  */
14039 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
14040    /**
14041     * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
14042     * `err` or `result` depending on the state of `result_ok`.
14043     */
14044    union LDKCResult_WarningMessageDecodeErrorZPtr contents;
14045    /**
14046     * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
14047     */
14048    bool result_ok;
14049 } LDKCResult_WarningMessageDecodeErrorZ;
14050
14051 /**
14052  * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
14053  */
14054 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
14055    /**
14056     * A pointer to the contents in the success state.
14057     * Reading from this pointer when `result_ok` is not set is undefined.
14058     */
14059    struct LDKUnsignedNodeAnnouncement *result;
14060    /**
14061     * A pointer to the contents in the error state.
14062     * Reading from this pointer when `result_ok` is set is undefined.
14063     */
14064    struct LDKDecodeError *err;
14065 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
14066
14067 /**
14068  * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
14069  * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
14070  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14071  */
14072 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
14073    /**
14074     * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
14075     * `err` or `result` depending on the state of `result_ok`.
14076     */
14077    union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
14078    /**
14079     * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
14080     */
14081    bool result_ok;
14082 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
14083
14084 /**
14085  * The contents of CResult_NodeAnnouncementDecodeErrorZ
14086  */
14087 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
14088    /**
14089     * A pointer to the contents in the success state.
14090     * Reading from this pointer when `result_ok` is not set is undefined.
14091     */
14092    struct LDKNodeAnnouncement *result;
14093    /**
14094     * A pointer to the contents in the error state.
14095     * Reading from this pointer when `result_ok` is set is undefined.
14096     */
14097    struct LDKDecodeError *err;
14098 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
14099
14100 /**
14101  * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
14102  * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
14103  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14104  */
14105 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
14106    /**
14107     * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
14108     * `err` or `result` depending on the state of `result_ok`.
14109     */
14110    union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
14111    /**
14112     * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
14113     */
14114    bool result_ok;
14115 } LDKCResult_NodeAnnouncementDecodeErrorZ;
14116
14117 /**
14118  * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
14119  */
14120 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
14121    /**
14122     * A pointer to the contents in the success state.
14123     * Reading from this pointer when `result_ok` is not set is undefined.
14124     */
14125    struct LDKQueryShortChannelIds *result;
14126    /**
14127     * A pointer to the contents in the error state.
14128     * Reading from this pointer when `result_ok` is set is undefined.
14129     */
14130    struct LDKDecodeError *err;
14131 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
14132
14133 /**
14134  * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
14135  * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
14136  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14137  */
14138 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
14139    /**
14140     * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
14141     * `err` or `result` depending on the state of `result_ok`.
14142     */
14143    union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
14144    /**
14145     * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
14146     */
14147    bool result_ok;
14148 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
14149
14150
14151
14152 /**
14153  * A [`reply_short_channel_ids_end`] message is sent as a reply to a
14154  * message. The query recipient makes a best
14155  * effort to respond based on their local network view which may not be
14156  * a perfect view of the network.
14157  *
14158  * [`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
14159  */
14160 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
14161    /**
14162     * A pointer to the opaque Rust object.
14163     * Nearly everywhere, inner must be non-null, however in places where
14164     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14165     */
14166    LDKnativeReplyShortChannelIdsEnd *inner;
14167    /**
14168     * Indicates that this is the only struct which contains the same pointer.
14169     * Rust functions which take ownership of an object provided via an argument require
14170     * this to be true and invalidate the object pointed to by inner.
14171     */
14172    bool is_owned;
14173 } LDKReplyShortChannelIdsEnd;
14174
14175 /**
14176  * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
14177  */
14178 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
14179    /**
14180     * A pointer to the contents in the success state.
14181     * Reading from this pointer when `result_ok` is not set is undefined.
14182     */
14183    struct LDKReplyShortChannelIdsEnd *result;
14184    /**
14185     * A pointer to the contents in the error state.
14186     * Reading from this pointer when `result_ok` is set is undefined.
14187     */
14188    struct LDKDecodeError *err;
14189 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
14190
14191 /**
14192  * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
14193  * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
14194  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14195  */
14196 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
14197    /**
14198     * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
14199     * `err` or `result` depending on the state of `result_ok`.
14200     */
14201    union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
14202    /**
14203     * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
14204     */
14205    bool result_ok;
14206 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
14207
14208 /**
14209  * The contents of CResult_QueryChannelRangeDecodeErrorZ
14210  */
14211 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
14212    /**
14213     * A pointer to the contents in the success state.
14214     * Reading from this pointer when `result_ok` is not set is undefined.
14215     */
14216    struct LDKQueryChannelRange *result;
14217    /**
14218     * A pointer to the contents in the error state.
14219     * Reading from this pointer when `result_ok` is set is undefined.
14220     */
14221    struct LDKDecodeError *err;
14222 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
14223
14224 /**
14225  * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
14226  * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
14227  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14228  */
14229 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
14230    /**
14231     * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
14232     * `err` or `result` depending on the state of `result_ok`.
14233     */
14234    union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
14235    /**
14236     * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
14237     */
14238    bool result_ok;
14239 } LDKCResult_QueryChannelRangeDecodeErrorZ;
14240
14241 /**
14242  * The contents of CResult_ReplyChannelRangeDecodeErrorZ
14243  */
14244 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
14245    /**
14246     * A pointer to the contents in the success state.
14247     * Reading from this pointer when `result_ok` is not set is undefined.
14248     */
14249    struct LDKReplyChannelRange *result;
14250    /**
14251     * A pointer to the contents in the error state.
14252     * Reading from this pointer when `result_ok` is set is undefined.
14253     */
14254    struct LDKDecodeError *err;
14255 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
14256
14257 /**
14258  * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
14259  * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
14260  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14261  */
14262 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
14263    /**
14264     * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
14265     * `err` or `result` depending on the state of `result_ok`.
14266     */
14267    union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
14268    /**
14269     * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
14270     */
14271    bool result_ok;
14272 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
14273
14274 /**
14275  * The contents of CResult_GossipTimestampFilterDecodeErrorZ
14276  */
14277 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
14278    /**
14279     * A pointer to the contents in the success state.
14280     * Reading from this pointer when `result_ok` is not set is undefined.
14281     */
14282    struct LDKGossipTimestampFilter *result;
14283    /**
14284     * A pointer to the contents in the error state.
14285     * Reading from this pointer when `result_ok` is set is undefined.
14286     */
14287    struct LDKDecodeError *err;
14288 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
14289
14290 /**
14291  * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
14292  * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
14293  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14294  */
14295 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
14296    /**
14297     * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
14298     * `err` or `result` depending on the state of `result_ok`.
14299     */
14300    union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
14301    /**
14302     * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
14303     */
14304    bool result_ok;
14305 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
14306
14307 /**
14308  * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
14309  * This corresponds to std::vector in C++
14310  */
14311 typedef struct LDKCVec_PhantomRouteHintsZ {
14312    /**
14313     * The elements in the array.
14314     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14315     */
14316    struct LDKPhantomRouteHints *data;
14317    /**
14318     * The number of elements pointed to by `data`.
14319     */
14320    uintptr_t datalen;
14321 } LDKCVec_PhantomRouteHintsZ;
14322
14323
14324
14325 /**
14326  * Represents a syntactically and semantically correct lightning BOLT11 invoice.
14327  *
14328  * There are three ways to construct a `Bolt11Invoice`:
14329  *  1. using [`InvoiceBuilder`]
14330  *  2. using [`Bolt11Invoice::from_signed`]
14331  *  3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
14332  *
14333  * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
14334  */
14335 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
14336    /**
14337     * A pointer to the opaque Rust object.
14338     * Nearly everywhere, inner must be non-null, however in places where
14339     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14340     */
14341    LDKnativeBolt11Invoice *inner;
14342    /**
14343     * Indicates that this is the only struct which contains the same pointer.
14344     * Rust functions which take ownership of an object provided via an argument require
14345     * this to be true and invalidate the object pointed to by inner.
14346     */
14347    bool is_owned;
14348 } LDKBolt11Invoice;
14349
14350 /**
14351  * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
14352  * may occur.
14353  */
14354 typedef enum LDKSignOrCreationError_Tag {
14355    /**
14356     * An error occurred during signing
14357     */
14358    LDKSignOrCreationError_SignError,
14359    /**
14360     * An error occurred while building the transaction
14361     */
14362    LDKSignOrCreationError_CreationError,
14363    /**
14364     * Must be last for serialization purposes
14365     */
14366    LDKSignOrCreationError_Sentinel,
14367 } LDKSignOrCreationError_Tag;
14368
14369 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
14370    LDKSignOrCreationError_Tag tag;
14371    union {
14372       struct {
14373          enum LDKCreationError creation_error;
14374       };
14375    };
14376 } LDKSignOrCreationError;
14377
14378 /**
14379  * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
14380  */
14381 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
14382    /**
14383     * A pointer to the contents in the success state.
14384     * Reading from this pointer when `result_ok` is not set is undefined.
14385     */
14386    struct LDKBolt11Invoice *result;
14387    /**
14388     * A pointer to the contents in the error state.
14389     * Reading from this pointer when `result_ok` is set is undefined.
14390     */
14391    struct LDKSignOrCreationError *err;
14392 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
14393
14394 /**
14395  * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
14396  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
14397  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14398  */
14399 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
14400    /**
14401     * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
14402     * `err` or `result` depending on the state of `result_ok`.
14403     */
14404    union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
14405    /**
14406     * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
14407     */
14408    bool result_ok;
14409 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
14410
14411
14412
14413 /**
14414  * A simple future which can complete once, and calls some callback(s) when it does so.
14415  *
14416  * Clones can be made and all futures cloned from the same source will complete at the same time.
14417  */
14418 typedef struct MUST_USE_STRUCT LDKFuture {
14419    /**
14420     * A pointer to the opaque Rust object.
14421     * Nearly everywhere, inner must be non-null, however in places where
14422     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14423     */
14424    LDKnativeFuture *inner;
14425    /**
14426     * Indicates that this is the only struct which contains the same pointer.
14427     * Rust functions which take ownership of an object provided via an argument require
14428     * this to be true and invalidate the object pointed to by inner.
14429     */
14430    bool is_owned;
14431 } LDKFuture;
14432
14433 /**
14434  * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
14435  * This corresponds to std::vector in C++
14436  */
14437 typedef struct LDKCVec_FutureZ {
14438    /**
14439     * The elements in the array.
14440     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14441     */
14442    struct LDKFuture *data;
14443    /**
14444     * The number of elements pointed to by `data`.
14445     */
14446    uintptr_t datalen;
14447 } LDKCVec_FutureZ;
14448
14449 /**
14450  * The contents of CResult_OffersMessageDecodeErrorZ
14451  */
14452 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
14453    /**
14454     * A pointer to the contents in the success state.
14455     * Reading from this pointer when `result_ok` is not set is undefined.
14456     */
14457    struct LDKOffersMessage *result;
14458    /**
14459     * A pointer to the contents in the error state.
14460     * Reading from this pointer when `result_ok` is set is undefined.
14461     */
14462    struct LDKDecodeError *err;
14463 } LDKCResult_OffersMessageDecodeErrorZPtr;
14464
14465 /**
14466  * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
14467  * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
14468  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14469  */
14470 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
14471    /**
14472     * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
14473     * `err` or `result` depending on the state of `result_ok`.
14474     */
14475    union LDKCResult_OffersMessageDecodeErrorZPtr contents;
14476    /**
14477     * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
14478     */
14479    bool result_ok;
14480 } LDKCResult_OffersMessageDecodeErrorZ;
14481
14482 /**
14483  * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
14484  */
14485 typedef enum LDKCOption_HTLCClaimZ_Tag {
14486    /**
14487     * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
14488     */
14489    LDKCOption_HTLCClaimZ_Some,
14490    /**
14491     * When we're in this state, this COption_HTLCClaimZ contains nothing
14492     */
14493    LDKCOption_HTLCClaimZ_None,
14494    /**
14495     * Must be last for serialization purposes
14496     */
14497    LDKCOption_HTLCClaimZ_Sentinel,
14498 } LDKCOption_HTLCClaimZ_Tag;
14499
14500 typedef struct LDKCOption_HTLCClaimZ {
14501    LDKCOption_HTLCClaimZ_Tag tag;
14502    union {
14503       struct {
14504          enum LDKHTLCClaim some;
14505       };
14506    };
14507 } LDKCOption_HTLCClaimZ;
14508
14509
14510
14511 /**
14512  * Implements the per-commitment secret storage scheme from
14513  * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
14514  *
14515  * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
14516  * or so.
14517  */
14518 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
14519    /**
14520     * A pointer to the opaque Rust object.
14521     * Nearly everywhere, inner must be non-null, however in places where
14522     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14523     */
14524    LDKnativeCounterpartyCommitmentSecrets *inner;
14525    /**
14526     * Indicates that this is the only struct which contains the same pointer.
14527     * Rust functions which take ownership of an object provided via an argument require
14528     * this to be true and invalidate the object pointed to by inner.
14529     */
14530    bool is_owned;
14531 } LDKCounterpartyCommitmentSecrets;
14532
14533 /**
14534  * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
14535  */
14536 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
14537    /**
14538     * A pointer to the contents in the success state.
14539     * Reading from this pointer when `result_ok` is not set is undefined.
14540     */
14541    struct LDKCounterpartyCommitmentSecrets *result;
14542    /**
14543     * A pointer to the contents in the error state.
14544     * Reading from this pointer when `result_ok` is set is undefined.
14545     */
14546    struct LDKDecodeError *err;
14547 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
14548
14549 /**
14550  * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
14551  * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
14552  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14553  */
14554 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
14555    /**
14556     * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
14557     * `err` or `result` depending on the state of `result_ok`.
14558     */
14559    union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
14560    /**
14561     * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
14562     */
14563    bool result_ok;
14564 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
14565
14566
14567
14568 /**
14569  * The set of public keys which are used in the creation of one commitment transaction.
14570  * These are derived from the channel base keys and per-commitment data.
14571  *
14572  * A broadcaster key is provided from potential broadcaster of the computed transaction.
14573  * A countersignatory key is coming from a protocol participant unable to broadcast the
14574  * transaction.
14575  *
14576  * These keys are assumed to be good, either because the code derived them from
14577  * channel basepoints via the new function, or they were obtained via
14578  * CommitmentTransaction.trust().keys() because we trusted the source of the
14579  * pre-calculated keys.
14580  */
14581 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
14582    /**
14583     * A pointer to the opaque Rust object.
14584     * Nearly everywhere, inner must be non-null, however in places where
14585     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14586     */
14587    LDKnativeTxCreationKeys *inner;
14588    /**
14589     * Indicates that this is the only struct which contains the same pointer.
14590     * Rust functions which take ownership of an object provided via an argument require
14591     * this to be true and invalidate the object pointed to by inner.
14592     */
14593    bool is_owned;
14594 } LDKTxCreationKeys;
14595
14596 /**
14597  * The contents of CResult_TxCreationKeysDecodeErrorZ
14598  */
14599 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
14600    /**
14601     * A pointer to the contents in the success state.
14602     * Reading from this pointer when `result_ok` is not set is undefined.
14603     */
14604    struct LDKTxCreationKeys *result;
14605    /**
14606     * A pointer to the contents in the error state.
14607     * Reading from this pointer when `result_ok` is set is undefined.
14608     */
14609    struct LDKDecodeError *err;
14610 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
14611
14612 /**
14613  * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
14614  * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
14615  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14616  */
14617 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
14618    /**
14619     * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
14620     * `err` or `result` depending on the state of `result_ok`.
14621     */
14622    union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
14623    /**
14624     * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
14625     */
14626    bool result_ok;
14627 } LDKCResult_TxCreationKeysDecodeErrorZ;
14628
14629 /**
14630  * The contents of CResult_ChannelPublicKeysDecodeErrorZ
14631  */
14632 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
14633    /**
14634     * A pointer to the contents in the success state.
14635     * Reading from this pointer when `result_ok` is not set is undefined.
14636     */
14637    struct LDKChannelPublicKeys *result;
14638    /**
14639     * A pointer to the contents in the error state.
14640     * Reading from this pointer when `result_ok` is set is undefined.
14641     */
14642    struct LDKDecodeError *err;
14643 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
14644
14645 /**
14646  * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
14647  * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
14648  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14649  */
14650 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
14651    /**
14652     * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
14653     * `err` or `result` depending on the state of `result_ok`.
14654     */
14655    union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
14656    /**
14657     * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
14658     */
14659    bool result_ok;
14660 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
14661
14662 /**
14663  * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
14664  */
14665 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
14666    /**
14667     * A pointer to the contents in the success state.
14668     * Reading from this pointer when `result_ok` is not set is undefined.
14669     */
14670    struct LDKHTLCOutputInCommitment *result;
14671    /**
14672     * A pointer to the contents in the error state.
14673     * Reading from this pointer when `result_ok` is set is undefined.
14674     */
14675    struct LDKDecodeError *err;
14676 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
14677
14678 /**
14679  * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
14680  * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
14681  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14682  */
14683 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
14684    /**
14685     * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
14686     * `err` or `result` depending on the state of `result_ok`.
14687     */
14688    union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
14689    /**
14690     * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
14691     */
14692    bool result_ok;
14693 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
14694
14695
14696
14697 /**
14698  * Late-bound per-channel counterparty data used to build transactions.
14699  */
14700 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
14701    /**
14702     * A pointer to the opaque Rust object.
14703     * Nearly everywhere, inner must be non-null, however in places where
14704     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14705     */
14706    LDKnativeCounterpartyChannelTransactionParameters *inner;
14707    /**
14708     * Indicates that this is the only struct which contains the same pointer.
14709     * Rust functions which take ownership of an object provided via an argument require
14710     * this to be true and invalidate the object pointed to by inner.
14711     */
14712    bool is_owned;
14713 } LDKCounterpartyChannelTransactionParameters;
14714
14715 /**
14716  * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
14717  */
14718 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
14719    /**
14720     * A pointer to the contents in the success state.
14721     * Reading from this pointer when `result_ok` is not set is undefined.
14722     */
14723    struct LDKCounterpartyChannelTransactionParameters *result;
14724    /**
14725     * A pointer to the contents in the error state.
14726     * Reading from this pointer when `result_ok` is set is undefined.
14727     */
14728    struct LDKDecodeError *err;
14729 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
14730
14731 /**
14732  * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
14733  * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
14734  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14735  */
14736 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
14737    /**
14738     * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
14739     * `err` or `result` depending on the state of `result_ok`.
14740     */
14741    union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
14742    /**
14743     * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
14744     */
14745    bool result_ok;
14746 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
14747
14748 /**
14749  * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
14750  */
14751 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
14752    /**
14753     * A pointer to the contents in the success state.
14754     * Reading from this pointer when `result_ok` is not set is undefined.
14755     */
14756    struct LDKChannelTransactionParameters *result;
14757    /**
14758     * A pointer to the contents in the error state.
14759     * Reading from this pointer when `result_ok` is set is undefined.
14760     */
14761    struct LDKDecodeError *err;
14762 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
14763
14764 /**
14765  * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
14766  * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
14767  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14768  */
14769 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
14770    /**
14771     * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
14772     * `err` or `result` depending on the state of `result_ok`.
14773     */
14774    union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
14775    /**
14776     * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
14777     */
14778    bool result_ok;
14779 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
14780
14781 /**
14782  * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
14783  */
14784 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
14785    /**
14786     * A pointer to the contents in the success state.
14787     * Reading from this pointer when `result_ok` is not set is undefined.
14788     */
14789    struct LDKHolderCommitmentTransaction *result;
14790    /**
14791     * A pointer to the contents in the error state.
14792     * Reading from this pointer when `result_ok` is set is undefined.
14793     */
14794    struct LDKDecodeError *err;
14795 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
14796
14797 /**
14798  * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
14799  * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
14800  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14801  */
14802 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
14803    /**
14804     * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
14805     * `err` or `result` depending on the state of `result_ok`.
14806     */
14807    union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
14808    /**
14809     * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
14810     */
14811    bool result_ok;
14812 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
14813
14814
14815
14816 /**
14817  * A pre-built Bitcoin commitment transaction and its txid.
14818  */
14819 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
14820    /**
14821     * A pointer to the opaque Rust object.
14822     * Nearly everywhere, inner must be non-null, however in places where
14823     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14824     */
14825    LDKnativeBuiltCommitmentTransaction *inner;
14826    /**
14827     * Indicates that this is the only struct which contains the same pointer.
14828     * Rust functions which take ownership of an object provided via an argument require
14829     * this to be true and invalidate the object pointed to by inner.
14830     */
14831    bool is_owned;
14832 } LDKBuiltCommitmentTransaction;
14833
14834 /**
14835  * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
14836  */
14837 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
14838    /**
14839     * A pointer to the contents in the success state.
14840     * Reading from this pointer when `result_ok` is not set is undefined.
14841     */
14842    struct LDKBuiltCommitmentTransaction *result;
14843    /**
14844     * A pointer to the contents in the error state.
14845     * Reading from this pointer when `result_ok` is set is undefined.
14846     */
14847    struct LDKDecodeError *err;
14848 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
14849
14850 /**
14851  * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
14852  * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
14853  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14854  */
14855 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
14856    /**
14857     * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
14858     * `err` or `result` depending on the state of `result_ok`.
14859     */
14860    union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
14861    /**
14862     * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
14863     */
14864    bool result_ok;
14865 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
14866
14867
14868
14869 /**
14870  * A wrapper on ClosingTransaction indicating that the built bitcoin
14871  * transaction is trusted.
14872  *
14873  * See trust() and verify() functions on CommitmentTransaction.
14874  *
14875  * This structure implements Deref.
14876  */
14877 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
14878    /**
14879     * A pointer to the opaque Rust object.
14880     * Nearly everywhere, inner must be non-null, however in places where
14881     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14882     */
14883    LDKnativeTrustedClosingTransaction *inner;
14884    /**
14885     * Indicates that this is the only struct which contains the same pointer.
14886     * Rust functions which take ownership of an object provided via an argument require
14887     * this to be true and invalidate the object pointed to by inner.
14888     */
14889    bool is_owned;
14890 } LDKTrustedClosingTransaction;
14891
14892 /**
14893  * The contents of CResult_TrustedClosingTransactionNoneZ
14894  */
14895 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
14896    /**
14897     * A pointer to the contents in the success state.
14898     * Reading from this pointer when `result_ok` is not set is undefined.
14899     */
14900    struct LDKTrustedClosingTransaction *result;
14901    /**
14902     * Note that this value is always NULL, as there are no contents in the Err variant
14903     */
14904    void *err;
14905 } LDKCResult_TrustedClosingTransactionNoneZPtr;
14906
14907 /**
14908  * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
14909  * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
14910  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14911  */
14912 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
14913    /**
14914     * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
14915     * `err` or `result` depending on the state of `result_ok`.
14916     */
14917    union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
14918    /**
14919     * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
14920     */
14921    bool result_ok;
14922 } LDKCResult_TrustedClosingTransactionNoneZ;
14923
14924 /**
14925  * The contents of CResult_CommitmentTransactionDecodeErrorZ
14926  */
14927 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
14928    /**
14929     * A pointer to the contents in the success state.
14930     * Reading from this pointer when `result_ok` is not set is undefined.
14931     */
14932    struct LDKCommitmentTransaction *result;
14933    /**
14934     * A pointer to the contents in the error state.
14935     * Reading from this pointer when `result_ok` is set is undefined.
14936     */
14937    struct LDKDecodeError *err;
14938 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
14939
14940 /**
14941  * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
14942  * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
14943  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14944  */
14945 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
14946    /**
14947     * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
14948     * `err` or `result` depending on the state of `result_ok`.
14949     */
14950    union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
14951    /**
14952     * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
14953     */
14954    bool result_ok;
14955 } LDKCResult_CommitmentTransactionDecodeErrorZ;
14956
14957
14958
14959 /**
14960  * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
14961  * transaction and the transaction creation keys) are trusted.
14962  *
14963  * See trust() and verify() functions on CommitmentTransaction.
14964  *
14965  * This structure implements Deref.
14966  */
14967 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
14968    /**
14969     * A pointer to the opaque Rust object.
14970     * Nearly everywhere, inner must be non-null, however in places where
14971     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14972     */
14973    LDKnativeTrustedCommitmentTransaction *inner;
14974    /**
14975     * Indicates that this is the only struct which contains the same pointer.
14976     * Rust functions which take ownership of an object provided via an argument require
14977     * this to be true and invalidate the object pointed to by inner.
14978     */
14979    bool is_owned;
14980 } LDKTrustedCommitmentTransaction;
14981
14982 /**
14983  * The contents of CResult_TrustedCommitmentTransactionNoneZ
14984  */
14985 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
14986    /**
14987     * A pointer to the contents in the success state.
14988     * Reading from this pointer when `result_ok` is not set is undefined.
14989     */
14990    struct LDKTrustedCommitmentTransaction *result;
14991    /**
14992     * Note that this value is always NULL, as there are no contents in the Err variant
14993     */
14994    void *err;
14995 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
14996
14997 /**
14998  * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
14999  * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
15000  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15001  */
15002 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
15003    /**
15004     * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
15005     * `err` or `result` depending on the state of `result_ok`.
15006     */
15007    union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
15008    /**
15009     * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
15010     */
15011    bool result_ok;
15012 } LDKCResult_TrustedCommitmentTransactionNoneZ;
15013
15014 /**
15015  * The contents of CResult_CVec_ECDSASignatureZNoneZ
15016  */
15017 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
15018    /**
15019     * A pointer to the contents in the success state.
15020     * Reading from this pointer when `result_ok` is not set is undefined.
15021     */
15022    struct LDKCVec_ECDSASignatureZ *result;
15023    /**
15024     * Note that this value is always NULL, as there are no contents in the Err variant
15025     */
15026    void *err;
15027 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
15028
15029 /**
15030  * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
15031  * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
15032  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15033  */
15034 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
15035    /**
15036     * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
15037     * `err` or `result` depending on the state of `result_ok`.
15038     */
15039    union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
15040    /**
15041     * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
15042     */
15043    bool result_ok;
15044 } LDKCResult_CVec_ECDSASignatureZNoneZ;
15045
15046 /**
15047  * An enum which can either contain a usize or not
15048  */
15049 typedef enum LDKCOption_usizeZ_Tag {
15050    /**
15051     * When we're in this state, this COption_usizeZ contains a usize
15052     */
15053    LDKCOption_usizeZ_Some,
15054    /**
15055     * When we're in this state, this COption_usizeZ contains nothing
15056     */
15057    LDKCOption_usizeZ_None,
15058    /**
15059     * Must be last for serialization purposes
15060     */
15061    LDKCOption_usizeZ_Sentinel,
15062 } LDKCOption_usizeZ_Tag;
15063
15064 typedef struct LDKCOption_usizeZ {
15065    LDKCOption_usizeZ_Tag tag;
15066    union {
15067       struct {
15068          uintptr_t some;
15069       };
15070    };
15071 } LDKCOption_usizeZ;
15072
15073 /**
15074  * The contents of CResult_ShutdownScriptDecodeErrorZ
15075  */
15076 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
15077    /**
15078     * A pointer to the contents in the success state.
15079     * Reading from this pointer when `result_ok` is not set is undefined.
15080     */
15081    struct LDKShutdownScript *result;
15082    /**
15083     * A pointer to the contents in the error state.
15084     * Reading from this pointer when `result_ok` is set is undefined.
15085     */
15086    struct LDKDecodeError *err;
15087 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
15088
15089 /**
15090  * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
15091  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
15092  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15093  */
15094 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
15095    /**
15096     * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
15097     * `err` or `result` depending on the state of `result_ok`.
15098     */
15099    union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
15100    /**
15101     * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
15102     */
15103    bool result_ok;
15104 } LDKCResult_ShutdownScriptDecodeErrorZ;
15105
15106
15107
15108 /**
15109  * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
15110  */
15111 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
15112    /**
15113     * A pointer to the opaque Rust object.
15114     * Nearly everywhere, inner must be non-null, however in places where
15115     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15116     */
15117    LDKnativeInvalidShutdownScript *inner;
15118    /**
15119     * Indicates that this is the only struct which contains the same pointer.
15120     * Rust functions which take ownership of an object provided via an argument require
15121     * this to be true and invalidate the object pointed to by inner.
15122     */
15123    bool is_owned;
15124 } LDKInvalidShutdownScript;
15125
15126 /**
15127  * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
15128  */
15129 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
15130    /**
15131     * A pointer to the contents in the success state.
15132     * Reading from this pointer when `result_ok` is not set is undefined.
15133     */
15134    struct LDKShutdownScript *result;
15135    /**
15136     * A pointer to the contents in the error state.
15137     * Reading from this pointer when `result_ok` is set is undefined.
15138     */
15139    struct LDKInvalidShutdownScript *err;
15140 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
15141
15142 /**
15143  * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
15144  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
15145  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15146  */
15147 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
15148    /**
15149     * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
15150     * `err` or `result` depending on the state of `result_ok`.
15151     */
15152    union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
15153    /**
15154     * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
15155     */
15156    bool result_ok;
15157 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
15158
15159 /**
15160  * Some information provided on receipt of payment depends on whether the payment received is a
15161  * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
15162  */
15163 typedef enum LDKPaymentPurpose_Tag {
15164    /**
15165     * Information for receiving a payment that we generated an invoice for.
15166     */
15167    LDKPaymentPurpose_InvoicePayment,
15168    /**
15169     * Because this is a spontaneous payment, the payer generated their own preimage rather than us
15170     * (the payee) providing a preimage.
15171     */
15172    LDKPaymentPurpose_SpontaneousPayment,
15173    /**
15174     * Must be last for serialization purposes
15175     */
15176    LDKPaymentPurpose_Sentinel,
15177 } LDKPaymentPurpose_Tag;
15178
15179 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
15180    /**
15181     * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
15182     * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
15183     * [`ChannelManager::claim_funds`].
15184     *
15185     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
15186     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
15187     */
15188    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
15189    /**
15190     * The \"payment secret\". This authenticates the sender to the recipient, preventing a
15191     * number of deanonymization attacks during the routing process.
15192     * It is provided here for your reference, however its accuracy is enforced directly by
15193     * [`ChannelManager`] using the values you previously provided to
15194     * [`ChannelManager::create_inbound_payment`] or
15195     * [`ChannelManager::create_inbound_payment_for_hash`].
15196     *
15197     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15198     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
15199     * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
15200     */
15201    struct LDKThirtyTwoBytes payment_secret;
15202 } LDKPaymentPurpose_LDKInvoicePayment_Body;
15203
15204 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
15205    LDKPaymentPurpose_Tag tag;
15206    union {
15207       LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
15208       struct {
15209          struct LDKThirtyTwoBytes spontaneous_payment;
15210       };
15211    };
15212 } LDKPaymentPurpose;
15213
15214 /**
15215  * The contents of CResult_PaymentPurposeDecodeErrorZ
15216  */
15217 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
15218    /**
15219     * A pointer to the contents in the success state.
15220     * Reading from this pointer when `result_ok` is not set is undefined.
15221     */
15222    struct LDKPaymentPurpose *result;
15223    /**
15224     * A pointer to the contents in the error state.
15225     * Reading from this pointer when `result_ok` is set is undefined.
15226     */
15227    struct LDKDecodeError *err;
15228 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
15229
15230 /**
15231  * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
15232  * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
15233  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15234  */
15235 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
15236    /**
15237     * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
15238     * `err` or `result` depending on the state of `result_ok`.
15239     */
15240    union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
15241    /**
15242     * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
15243     */
15244    bool result_ok;
15245 } LDKCResult_PaymentPurposeDecodeErrorZ;
15246
15247
15248
15249 /**
15250  * Information about an HTLC that is part of a payment that can be claimed.
15251  */
15252 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
15253    /**
15254     * A pointer to the opaque Rust object.
15255     * Nearly everywhere, inner must be non-null, however in places where
15256     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15257     */
15258    LDKnativeClaimedHTLC *inner;
15259    /**
15260     * Indicates that this is the only struct which contains the same pointer.
15261     * Rust functions which take ownership of an object provided via an argument require
15262     * this to be true and invalidate the object pointed to by inner.
15263     */
15264    bool is_owned;
15265 } LDKClaimedHTLC;
15266
15267 /**
15268  * The contents of CResult_ClaimedHTLCDecodeErrorZ
15269  */
15270 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
15271    /**
15272     * A pointer to the contents in the success state.
15273     * Reading from this pointer when `result_ok` is not set is undefined.
15274     */
15275    struct LDKClaimedHTLC *result;
15276    /**
15277     * A pointer to the contents in the error state.
15278     * Reading from this pointer when `result_ok` is set is undefined.
15279     */
15280    struct LDKDecodeError *err;
15281 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
15282
15283 /**
15284  * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
15285  * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15286  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15287  */
15288 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
15289    /**
15290     * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
15291     * `err` or `result` depending on the state of `result_ok`.
15292     */
15293    union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
15294    /**
15295     * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
15296     */
15297    bool result_ok;
15298 } LDKCResult_ClaimedHTLCDecodeErrorZ;
15299
15300 /**
15301  * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
15302  * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
15303  *
15304  * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
15305  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
15306  */
15307 typedef enum LDKPathFailure_Tag {
15308    /**
15309     * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
15310     * error.
15311     */
15312    LDKPathFailure_InitialSend,
15313    /**
15314     * A hop on the path failed to forward our payment.
15315     */
15316    LDKPathFailure_OnPath,
15317    /**
15318     * Must be last for serialization purposes
15319     */
15320    LDKPathFailure_Sentinel,
15321 } LDKPathFailure_Tag;
15322
15323 typedef struct LDKPathFailure_LDKInitialSend_Body {
15324    /**
15325     * The error surfaced from initial send.
15326     */
15327    struct LDKAPIError err;
15328 } LDKPathFailure_LDKInitialSend_Body;
15329
15330 typedef struct LDKPathFailure_LDKOnPath_Body {
15331    /**
15332     * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
15333     * decisions can take into account the update.
15334     *
15335     * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
15336     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
15337     */
15338    struct LDKCOption_NetworkUpdateZ network_update;
15339 } LDKPathFailure_LDKOnPath_Body;
15340
15341 typedef struct MUST_USE_STRUCT LDKPathFailure {
15342    LDKPathFailure_Tag tag;
15343    union {
15344       LDKPathFailure_LDKInitialSend_Body initial_send;
15345       LDKPathFailure_LDKOnPath_Body on_path;
15346    };
15347 } LDKPathFailure;
15348
15349 /**
15350  * An enum which can either contain a crate::lightning::events::PathFailure or not
15351  */
15352 typedef enum LDKCOption_PathFailureZ_Tag {
15353    /**
15354     * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
15355     */
15356    LDKCOption_PathFailureZ_Some,
15357    /**
15358     * When we're in this state, this COption_PathFailureZ contains nothing
15359     */
15360    LDKCOption_PathFailureZ_None,
15361    /**
15362     * Must be last for serialization purposes
15363     */
15364    LDKCOption_PathFailureZ_Sentinel,
15365 } LDKCOption_PathFailureZ_Tag;
15366
15367 typedef struct LDKCOption_PathFailureZ {
15368    LDKCOption_PathFailureZ_Tag tag;
15369    union {
15370       struct {
15371          struct LDKPathFailure some;
15372       };
15373    };
15374 } LDKCOption_PathFailureZ;
15375
15376 /**
15377  * The contents of CResult_COption_PathFailureZDecodeErrorZ
15378  */
15379 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
15380    /**
15381     * A pointer to the contents in the success state.
15382     * Reading from this pointer when `result_ok` is not set is undefined.
15383     */
15384    struct LDKCOption_PathFailureZ *result;
15385    /**
15386     * A pointer to the contents in the error state.
15387     * Reading from this pointer when `result_ok` is set is undefined.
15388     */
15389    struct LDKDecodeError *err;
15390 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
15391
15392 /**
15393  * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
15394  * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15395  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15396  */
15397 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
15398    /**
15399     * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
15400     * `err` or `result` depending on the state of `result_ok`.
15401     */
15402    union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
15403    /**
15404     * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
15405     */
15406    bool result_ok;
15407 } LDKCResult_COption_PathFailureZDecodeErrorZ;
15408
15409
15410
15411 /**
15412  * Struct to `Display` fields in a safe way using `PrintableString`
15413  */
15414 typedef struct MUST_USE_STRUCT LDKUntrustedString {
15415    /**
15416     * A pointer to the opaque Rust object.
15417     * Nearly everywhere, inner must be non-null, however in places where
15418     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15419     */
15420    LDKnativeUntrustedString *inner;
15421    /**
15422     * Indicates that this is the only struct which contains the same pointer.
15423     * Rust functions which take ownership of an object provided via an argument require
15424     * this to be true and invalidate the object pointed to by inner.
15425     */
15426    bool is_owned;
15427 } LDKUntrustedString;
15428
15429 /**
15430  * The reason the channel was closed. See individual variants for more details.
15431  */
15432 typedef enum LDKClosureReason_Tag {
15433    /**
15434     * Closure generated from receiving a peer error message.
15435     *
15436     * Our counterparty may have broadcasted their latest commitment state, and we have
15437     * as well.
15438     */
15439    LDKClosureReason_CounterpartyForceClosed,
15440    /**
15441     * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
15442     *
15443     * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
15444     */
15445    LDKClosureReason_HolderForceClosed,
15446    /**
15447     * The channel was closed after negotiating a cooperative close and we've now broadcasted
15448     * the cooperative close transaction. Note the shutdown may have been initiated by us.
15449     */
15450    LDKClosureReason_CooperativeClosure,
15451    /**
15452     * A commitment transaction was confirmed on chain, closing the channel. Most likely this
15453     * commitment transaction came from our counterparty, but it may also have come from
15454     * a copy of our own `ChannelMonitor`.
15455     */
15456    LDKClosureReason_CommitmentTxConfirmed,
15457    /**
15458     * The funding transaction failed to confirm in a timely manner on an inbound channel.
15459     */
15460    LDKClosureReason_FundingTimedOut,
15461    /**
15462     * Closure generated from processing an event, likely a HTLC forward/relay/reception.
15463     */
15464    LDKClosureReason_ProcessingError,
15465    /**
15466     * The peer disconnected prior to funding completing. In this case the spec mandates that we
15467     * forget the channel entirely - we can attempt again if the peer reconnects.
15468     *
15469     * This includes cases where we restarted prior to funding completion, including prior to the
15470     * initial [`ChannelMonitor`] persistence completing.
15471     *
15472     * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
15473     * peer because of mutual incompatibility between us and our channel counterparty.
15474     *
15475     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
15476     */
15477    LDKClosureReason_DisconnectedPeer,
15478    /**
15479     * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
15480     * the [`ChannelManager`] deserialized.
15481     *
15482     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
15483     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15484     */
15485    LDKClosureReason_OutdatedChannelManager,
15486    /**
15487     * The counterparty requested a cooperative close of a channel that had not been funded yet.
15488     * The channel has been immediately closed.
15489     */
15490    LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
15491    /**
15492     * Another channel in the same funding batch closed before the funding transaction
15493     * was ready to be broadcast.
15494     */
15495    LDKClosureReason_FundingBatchClosure,
15496    /**
15497     * Must be last for serialization purposes
15498     */
15499    LDKClosureReason_Sentinel,
15500 } LDKClosureReason_Tag;
15501
15502 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
15503    /**
15504     * The error which the peer sent us.
15505     *
15506     * Be careful about printing the peer_msg, a well-crafted message could exploit
15507     * a security vulnerability in the terminal emulator or the logging subsystem.
15508     * To be safe, use `Display` on `UntrustedString`
15509     *
15510     * [`UntrustedString`]: crate::util::string::UntrustedString
15511     */
15512    struct LDKUntrustedString peer_msg;
15513 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
15514
15515 typedef struct LDKClosureReason_LDKProcessingError_Body {
15516    /**
15517     * A developer-readable error message which we generated.
15518     */
15519    struct LDKStr err;
15520 } LDKClosureReason_LDKProcessingError_Body;
15521
15522 typedef struct MUST_USE_STRUCT LDKClosureReason {
15523    LDKClosureReason_Tag tag;
15524    union {
15525       LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
15526       LDKClosureReason_LDKProcessingError_Body processing_error;
15527    };
15528 } LDKClosureReason;
15529
15530 /**
15531  * An enum which can either contain a crate::lightning::events::ClosureReason or not
15532  */
15533 typedef enum LDKCOption_ClosureReasonZ_Tag {
15534    /**
15535     * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
15536     */
15537    LDKCOption_ClosureReasonZ_Some,
15538    /**
15539     * When we're in this state, this COption_ClosureReasonZ contains nothing
15540     */
15541    LDKCOption_ClosureReasonZ_None,
15542    /**
15543     * Must be last for serialization purposes
15544     */
15545    LDKCOption_ClosureReasonZ_Sentinel,
15546 } LDKCOption_ClosureReasonZ_Tag;
15547
15548 typedef struct LDKCOption_ClosureReasonZ {
15549    LDKCOption_ClosureReasonZ_Tag tag;
15550    union {
15551       struct {
15552          struct LDKClosureReason some;
15553       };
15554    };
15555 } LDKCOption_ClosureReasonZ;
15556
15557 /**
15558  * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
15559  */
15560 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
15561    /**
15562     * A pointer to the contents in the success state.
15563     * Reading from this pointer when `result_ok` is not set is undefined.
15564     */
15565    struct LDKCOption_ClosureReasonZ *result;
15566    /**
15567     * A pointer to the contents in the error state.
15568     * Reading from this pointer when `result_ok` is set is undefined.
15569     */
15570    struct LDKDecodeError *err;
15571 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
15572
15573 /**
15574  * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
15575  * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15576  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15577  */
15578 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
15579    /**
15580     * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
15581     * `err` or `result` depending on the state of `result_ok`.
15582     */
15583    union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
15584    /**
15585     * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
15586     */
15587    bool result_ok;
15588 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
15589
15590 /**
15591  * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
15592  */
15593 typedef enum LDKHTLCDestination_Tag {
15594    /**
15595     * We tried forwarding to a channel but failed to do so. An example of such an instance is when
15596     * there is insufficient capacity in our outbound channel.
15597     */
15598    LDKHTLCDestination_NextHopChannel,
15599    /**
15600     * Scenario where we are unsure of the next node to forward the HTLC to.
15601     */
15602    LDKHTLCDestination_UnknownNextHop,
15603    /**
15604     * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
15605     * intercept HTLC.
15606     */
15607    LDKHTLCDestination_InvalidForward,
15608    /**
15609     * Failure scenario where an HTLC may have been forwarded to be intended for us,
15610     * but is invalid for some reason, so we reject it.
15611     *
15612     * Some of the reasons may include:
15613     * * HTLC Timeouts
15614     * * Excess HTLCs for a payment that we have already fully received, over-paying for the
15615     *   payment,
15616     * * The counterparty node modified the HTLC in transit,
15617     * * A probing attack where an intermediary node is trying to detect if we are the ultimate
15618     *   recipient for a payment.
15619     */
15620    LDKHTLCDestination_FailedPayment,
15621    /**
15622     * Must be last for serialization purposes
15623     */
15624    LDKHTLCDestination_Sentinel,
15625 } LDKHTLCDestination_Tag;
15626
15627 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
15628    /**
15629     * The `node_id` of the next node. For backwards compatibility, this field is
15630     * marked as optional, versions prior to 0.0.110 may not always be able to provide
15631     * counterparty node information.
15632     *
15633     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15634     */
15635    struct LDKPublicKey node_id;
15636    /**
15637     * The outgoing `channel_id` between us and the next node.
15638     */
15639    struct LDKThirtyTwoBytes channel_id;
15640 } LDKHTLCDestination_LDKNextHopChannel_Body;
15641
15642 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
15643    /**
15644     * Short channel id we are requesting to forward an HTLC to.
15645     */
15646    uint64_t requested_forward_scid;
15647 } LDKHTLCDestination_LDKUnknownNextHop_Body;
15648
15649 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
15650    /**
15651     * Short channel id we are requesting to forward an HTLC to.
15652     */
15653    uint64_t requested_forward_scid;
15654 } LDKHTLCDestination_LDKInvalidForward_Body;
15655
15656 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
15657    /**
15658     * The payment hash of the payment we attempted to process.
15659     */
15660    struct LDKThirtyTwoBytes payment_hash;
15661 } LDKHTLCDestination_LDKFailedPayment_Body;
15662
15663 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
15664    LDKHTLCDestination_Tag tag;
15665    union {
15666       LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
15667       LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
15668       LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
15669       LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
15670    };
15671 } LDKHTLCDestination;
15672
15673 /**
15674  * An enum which can either contain a crate::lightning::events::HTLCDestination or not
15675  */
15676 typedef enum LDKCOption_HTLCDestinationZ_Tag {
15677    /**
15678     * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
15679     */
15680    LDKCOption_HTLCDestinationZ_Some,
15681    /**
15682     * When we're in this state, this COption_HTLCDestinationZ contains nothing
15683     */
15684    LDKCOption_HTLCDestinationZ_None,
15685    /**
15686     * Must be last for serialization purposes
15687     */
15688    LDKCOption_HTLCDestinationZ_Sentinel,
15689 } LDKCOption_HTLCDestinationZ_Tag;
15690
15691 typedef struct LDKCOption_HTLCDestinationZ {
15692    LDKCOption_HTLCDestinationZ_Tag tag;
15693    union {
15694       struct {
15695          struct LDKHTLCDestination some;
15696       };
15697    };
15698 } LDKCOption_HTLCDestinationZ;
15699
15700 /**
15701  * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
15702  */
15703 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
15704    /**
15705     * A pointer to the contents in the success state.
15706     * Reading from this pointer when `result_ok` is not set is undefined.
15707     */
15708    struct LDKCOption_HTLCDestinationZ *result;
15709    /**
15710     * A pointer to the contents in the error state.
15711     * Reading from this pointer when `result_ok` is set is undefined.
15712     */
15713    struct LDKDecodeError *err;
15714 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
15715
15716 /**
15717  * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
15718  * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15719  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15720  */
15721 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
15722    /**
15723     * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
15724     * `err` or `result` depending on the state of `result_ok`.
15725     */
15726    union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
15727    /**
15728     * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
15729     */
15730    bool result_ok;
15731 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
15732
15733 /**
15734  * The contents of CResult_PaymentFailureReasonDecodeErrorZ
15735  */
15736 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
15737    /**
15738     * A pointer to the contents in the success state.
15739     * Reading from this pointer when `result_ok` is not set is undefined.
15740     */
15741    enum LDKPaymentFailureReason *result;
15742    /**
15743     * A pointer to the contents in the error state.
15744     * Reading from this pointer when `result_ok` is set is undefined.
15745     */
15746    struct LDKDecodeError *err;
15747 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
15748
15749 /**
15750  * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
15751  * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
15752  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15753  */
15754 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
15755    /**
15756     * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
15757     * `err` or `result` depending on the state of `result_ok`.
15758     */
15759    union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
15760    /**
15761     * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
15762     */
15763    bool result_ok;
15764 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
15765
15766 /**
15767  * An enum which can either contain a crate::c_types::U128 or not
15768  */
15769 typedef enum LDKCOption_U128Z_Tag {
15770    /**
15771     * When we're in this state, this COption_U128Z contains a crate::c_types::U128
15772     */
15773    LDKCOption_U128Z_Some,
15774    /**
15775     * When we're in this state, this COption_U128Z contains nothing
15776     */
15777    LDKCOption_U128Z_None,
15778    /**
15779     * Must be last for serialization purposes
15780     */
15781    LDKCOption_U128Z_Sentinel,
15782 } LDKCOption_U128Z_Tag;
15783
15784 typedef struct LDKCOption_U128Z {
15785    LDKCOption_U128Z_Tag tag;
15786    union {
15787       struct {
15788          struct LDKU128 some;
15789       };
15790    };
15791 } LDKCOption_U128Z;
15792
15793 /**
15794  * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
15795  * This corresponds to std::vector in C++
15796  */
15797 typedef struct LDKCVec_ClaimedHTLCZ {
15798    /**
15799     * The elements in the array.
15800     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
15801     */
15802    struct LDKClaimedHTLC *data;
15803    /**
15804     * The number of elements pointed to by `data`.
15805     */
15806    uintptr_t datalen;
15807 } LDKCVec_ClaimedHTLCZ;
15808
15809 /**
15810  * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
15811  */
15812 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
15813    /**
15814     * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
15815     */
15816    LDKCOption_PaymentFailureReasonZ_Some,
15817    /**
15818     * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
15819     */
15820    LDKCOption_PaymentFailureReasonZ_None,
15821    /**
15822     * Must be last for serialization purposes
15823     */
15824    LDKCOption_PaymentFailureReasonZ_Sentinel,
15825 } LDKCOption_PaymentFailureReasonZ_Tag;
15826
15827 typedef struct LDKCOption_PaymentFailureReasonZ {
15828    LDKCOption_PaymentFailureReasonZ_Tag tag;
15829    union {
15830       struct {
15831          enum LDKPaymentFailureReason some;
15832       };
15833    };
15834 } LDKCOption_PaymentFailureReasonZ;
15835
15836
15837
15838 /**
15839  * A descriptor used to sign for a commitment transaction's anchor output.
15840  */
15841 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
15842    /**
15843     * A pointer to the opaque Rust object.
15844     * Nearly everywhere, inner must be non-null, however in places where
15845     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15846     */
15847    LDKnativeAnchorDescriptor *inner;
15848    /**
15849     * Indicates that this is the only struct which contains the same pointer.
15850     * Rust functions which take ownership of an object provided via an argument require
15851     * this to be true and invalidate the object pointed to by inner.
15852     */
15853    bool is_owned;
15854 } LDKAnchorDescriptor;
15855
15856 /**
15857  * Represents the different types of transactions, originating from LDK, to be bumped.
15858  */
15859 typedef enum LDKBumpTransactionEvent_Tag {
15860    /**
15861     * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
15862     * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
15863     * they may need additional fees to be attached through a child transaction using the popular
15864     * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
15865     * child transaction must include the anchor input described within `anchor_descriptor` along
15866     * with additional inputs to meet the target feerate. Failure to meet the target feerate
15867     * decreases the confirmation odds of the transaction package (which includes the commitment
15868     * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
15869     * is constructed, it must be fully signed for and broadcast by the consumer of the event
15870     * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
15871     * broadcast first, as the child anchor transaction depends on it.
15872     *
15873     * The consumer should be able to sign for any of the additional inputs included within the
15874     * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
15875     * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
15876     * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
15877     * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
15878     * full witness required to spend.
15879     *
15880     * It is possible to receive more than one instance of this event if a valid child anchor
15881     * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
15882     * be taken by the consumer of the event to ensure any future iterations of the child anchor
15883     * transaction adhere to the [Replace-By-Fee
15884     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
15885     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
15886     * these events is not user-controlled, users may ignore/drop the event if they are no longer
15887     * able to commit external confirmed funds to the child anchor transaction.
15888     *
15889     * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
15890     * determine whether a significant portion of the channel's funds are allocated to HTLCs,
15891     * enabling users to make their own decisions regarding the importance of the commitment
15892     * transaction's confirmation. Note that this is not required, but simply exists as an option
15893     * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
15894     * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
15895     * be not urgent.
15896     *
15897     * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
15898     * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
15899     * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
15900     */
15901    LDKBumpTransactionEvent_ChannelClose,
15902    /**
15903     * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
15904     * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
15905     * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
15906     * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
15907     * for a timely confirmation within the chain. These additional inputs and/or outputs must be
15908     * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
15909     * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
15910     * loss of funds. Once the transaction meets the target feerate, it must be signed for and
15911     * broadcast by the consumer of the event.
15912     *
15913     * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
15914     * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
15915     * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
15916     * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
15917     * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
15918     * to spend.
15919     *
15920     * It is possible to receive more than one instance of this event if a valid HTLC transaction
15921     * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
15922     * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
15923     * the [Replace-By-Fee
15924     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
15925     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
15926     * these events is not user-controlled, users may ignore/drop the event if either they are no
15927     * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
15928     * to the HTLC transaction is greater in value than the HTLCs being claimed.
15929     *
15930     * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
15931     * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
15932     */
15933    LDKBumpTransactionEvent_HTLCResolution,
15934    /**
15935     * Must be last for serialization purposes
15936     */
15937    LDKBumpTransactionEvent_Sentinel,
15938 } LDKBumpTransactionEvent_Tag;
15939
15940 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
15941    /**
15942     * The unique identifier for the claim of the anchor output in the commitment transaction.
15943     *
15944     * The identifier must map to the set of external UTXOs assigned to the claim, such that
15945     * they can be reused when a new claim with the same identifier needs to be made, resulting
15946     * in a fee-bumping attempt.
15947     */
15948    struct LDKThirtyTwoBytes claim_id;
15949    /**
15950     * The target feerate that the transaction package, which consists of the commitment
15951     * transaction and the to-be-crafted child anchor transaction, must meet.
15952     */
15953    uint32_t package_target_feerate_sat_per_1000_weight;
15954    /**
15955     * The channel's commitment transaction to bump the fee of. This transaction should be
15956     * broadcast along with the anchor transaction constructed as a result of consuming this
15957     * event.
15958     */
15959    struct LDKTransaction commitment_tx;
15960    /**
15961     * The absolute fee in satoshis of the commitment transaction. This can be used along the
15962     * with weight of the commitment transaction to determine its feerate.
15963     */
15964    uint64_t commitment_tx_fee_satoshis;
15965    /**
15966     * The descriptor to sign the anchor input of the anchor transaction constructed as a
15967     * result of consuming this event.
15968     */
15969    struct LDKAnchorDescriptor anchor_descriptor;
15970    /**
15971     * The set of pending HTLCs on the commitment transaction that need to be resolved once the
15972     * commitment transaction confirms.
15973     */
15974    struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
15975 } LDKBumpTransactionEvent_LDKChannelClose_Body;
15976
15977 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
15978    /**
15979     * The unique identifier for the claim of the HTLCs in the confirmed commitment
15980     * transaction.
15981     *
15982     * The identifier must map to the set of external UTXOs assigned to the claim, such that
15983     * they can be reused when a new claim with the same identifier needs to be made, resulting
15984     * in a fee-bumping attempt.
15985     */
15986    struct LDKThirtyTwoBytes claim_id;
15987    /**
15988     * The target feerate that the resulting HTLC transaction must meet.
15989     */
15990    uint32_t target_feerate_sat_per_1000_weight;
15991    /**
15992     * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
15993     * by the same transaction.
15994     */
15995    struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
15996    /**
15997     * The locktime required for the resulting HTLC transaction.
15998     */
15999    uint32_t tx_lock_time;
16000 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
16001
16002 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
16003    LDKBumpTransactionEvent_Tag tag;
16004    union {
16005       LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
16006       LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
16007    };
16008 } LDKBumpTransactionEvent;
16009
16010 /**
16011  * An Event which you should probably take some action in response to.
16012  *
16013  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
16014  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
16015  * written as it makes no sense to respond to it after reconnecting to peers).
16016  */
16017 typedef enum LDKEvent_Tag {
16018    /**
16019     * Used to indicate that the client should generate a funding transaction with the given
16020     * parameters and then call [`ChannelManager::funding_transaction_generated`].
16021     * Generated in [`ChannelManager`] message handling.
16022     * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
16023     * counterparty can steal your funds!
16024     *
16025     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16026     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
16027     */
16028    LDKEvent_FundingGenerationReady,
16029    /**
16030     * Indicates that we've been offered a payment and it needs to be claimed via calling
16031     * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
16032     *
16033     * Note that if the preimage is not known, you should call
16034     * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
16035     * to free up resources for this HTLC and avoid network congestion.
16036     *
16037     * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
16038     * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
16039     * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
16040     * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
16041     * If you don't intend to check for custom TLVs, you can simply use
16042     * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
16043     *
16044     * If you fail to call [`ChannelManager::claim_funds`],
16045     * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
16046     * [`ChannelManager::fail_htlc_backwards`], or
16047     * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
16048     * be automatically failed.
16049     *
16050     * # Note
16051     * LDK will not stop an inbound payment from being paid multiple times, so multiple
16052     * `PaymentClaimable` events may be generated for the same payment. In such a case it is
16053     * polite (and required in the lightning specification) to fail the payment the second time
16054     * and give the sender their money back rather than accepting double payment.
16055     *
16056     * # Note
16057     * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
16058     *
16059     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
16060     * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
16061     * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
16062     * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
16063     * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
16064     */
16065    LDKEvent_PaymentClaimable,
16066    /**
16067     * Indicates a payment has been claimed and we've received money!
16068     *
16069     * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
16070     * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
16071     * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
16072     * [`Event::PaymentClaimable`] event.
16073     *
16074     * # Note
16075     * LDK will not stop an inbound payment from being paid multiple times, so multiple
16076     * `PaymentClaimable` events may be generated for the same payment. If you then call
16077     * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
16078     * multiple `PaymentClaimed` events.
16079     *
16080     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
16081     */
16082    LDKEvent_PaymentClaimed,
16083    /**
16084     * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
16085     *
16086     * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
16087     * [`Destination`]. Once a connection is established, any messages buffered by an
16088     * [`OnionMessageHandler`] may be sent.
16089     *
16090     * This event will not be generated for onion message forwards; only for sends including
16091     * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
16092     *
16093     * [`OnionMessage`]: msgs::OnionMessage
16094     * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
16095     * [`Destination`]: crate::onion_message::messenger::Destination
16096     * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
16097     */
16098    LDKEvent_ConnectionNeeded,
16099    /**
16100     * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
16101     * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
16102     * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
16103     *
16104     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
16105     * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
16106     * [`Offer`]: crate::offers::offer::Offer
16107     * [`Refund`]: crate::offers::refund::Refund
16108     */
16109    LDKEvent_InvoiceRequestFailed,
16110    /**
16111     * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
16112     * and we got back the payment preimage for it).
16113     *
16114     * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
16115     * event. In this situation, you SHOULD treat this payment as having succeeded.
16116     */
16117    LDKEvent_PaymentSent,
16118    /**
16119     * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
16120     * provide failure information for each path attempt in the payment, including retries.
16121     *
16122     * This event is provided once there are no further pending HTLCs for the payment and the
16123     * payment is no longer retryable, due either to the [`Retry`] provided or
16124     * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
16125     *
16126     * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
16127     * a payment after an [`Event::PaymentSent`] event for this same payment has already been
16128     * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
16129     * and the payment MUST be treated as having succeeded.
16130     *
16131     * [`Retry`]: crate::ln::channelmanager::Retry
16132     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
16133     */
16134    LDKEvent_PaymentFailed,
16135    /**
16136     * Indicates that a path for an outbound payment was successful.
16137     *
16138     * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
16139     * [`Event::PaymentSent`] for obtaining the payment preimage.
16140     */
16141    LDKEvent_PaymentPathSuccessful,
16142    /**
16143     * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
16144     * handle the HTLC.
16145     *
16146     * Note that this does *not* indicate that all paths for an MPP payment have failed, see
16147     * [`Event::PaymentFailed`].
16148     *
16149     * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
16150     * been exhausted.
16151     *
16152     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
16153     */
16154    LDKEvent_PaymentPathFailed,
16155    /**
16156     * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
16157     */
16158    LDKEvent_ProbeSuccessful,
16159    /**
16160     * Indicates that a probe payment we sent failed at an intermediary node on the path.
16161     */
16162    LDKEvent_ProbeFailed,
16163    /**
16164     * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
16165     * a time in the future.
16166     *
16167     * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
16168     */
16169    LDKEvent_PendingHTLCsForwardable,
16170    /**
16171     * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
16172     * you've encoded an intercept scid in the receiver's invoice route hints using
16173     * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
16174     *
16175     * [`ChannelManager::forward_intercepted_htlc`] or
16176     * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
16177     * their docs for more information.
16178     *
16179     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
16180     * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
16181     * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
16182     * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
16183     */
16184    LDKEvent_HTLCIntercepted,
16185    /**
16186     * Used to indicate that an output which you should know how to spend was confirmed on chain
16187     * and is now spendable.
16188     * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
16189     * counterparty spending them due to some kind of timeout. Thus, you need to store them
16190     * somewhere and spend them when you create on-chain transactions.
16191     */
16192    LDKEvent_SpendableOutputs,
16193    /**
16194     * This event is generated when a payment has been successfully forwarded through us and a
16195     * forwarding fee earned.
16196     */
16197    LDKEvent_PaymentForwarded,
16198    /**
16199     * Used to indicate that a channel with the given `channel_id` is being opened and pending
16200     * confirmation on-chain.
16201     *
16202     * This event is emitted when the funding transaction has been signed and is broadcast to the
16203     * network. For 0conf channels it will be immediately followed by the corresponding
16204     * [`Event::ChannelReady`] event.
16205     */
16206    LDKEvent_ChannelPending,
16207    /**
16208     * Used to indicate that a channel with the given `channel_id` is ready to
16209     * be used. This event is emitted either when the funding transaction has been confirmed
16210     * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
16211     * establishment.
16212     */
16213    LDKEvent_ChannelReady,
16214    /**
16215     * Used to indicate that a previously opened channel with the given `channel_id` is in the
16216     * process of closure.
16217     *
16218     * Note that this event is only triggered for accepted channels: if the
16219     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
16220     * rejected, no `ChannelClosed` event will be sent.
16221     *
16222     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16223     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16224     */
16225    LDKEvent_ChannelClosed,
16226    /**
16227     * Used to indicate to the user that they can abandon the funding transaction and recycle the
16228     * inputs for another purpose.
16229     *
16230     * This event is not guaranteed to be generated for channels that are closed due to a restart.
16231     */
16232    LDKEvent_DiscardFunding,
16233    /**
16234     * Indicates a request to open a new channel by a peer.
16235     *
16236     * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
16237     * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
16238     * event will _not_ be triggered if the channel is rejected.
16239     *
16240     * The event is only triggered when a new open channel request is received and the
16241     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
16242     *
16243     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16244     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
16245     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16246     */
16247    LDKEvent_OpenChannelRequest,
16248    /**
16249     * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
16250     * forward it.
16251     *
16252     * Some scenarios where this event may be sent include:
16253     * * Insufficient capacity in the outbound channel
16254     * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
16255     * * When an unknown SCID is requested for forwarding a payment.
16256     * * Expected MPP amount has already been reached
16257     * * The HTLC has timed out
16258     *
16259     * This event, however, does not get generated if an HTLC fails to meet the forwarding
16260     * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
16261     */
16262    LDKEvent_HTLCHandlingFailed,
16263    /**
16264     * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
16265     * requires confirmed external funds to be readily available to spend.
16266     *
16267     * LDK does not currently generate this event unless the
16268     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
16269     * It is limited to the scope of channels with anchor outputs.
16270     *
16271     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
16272     */
16273    LDKEvent_BumpTransaction,
16274    /**
16275     * Must be last for serialization purposes
16276     */
16277    LDKEvent_Sentinel,
16278 } LDKEvent_Tag;
16279
16280 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
16281    /**
16282     * The random channel_id we picked which you'll need to pass into
16283     * [`ChannelManager::funding_transaction_generated`].
16284     *
16285     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
16286     */
16287    struct LDKThirtyTwoBytes temporary_channel_id;
16288    /**
16289     * The counterparty's node_id, which you'll need to pass back into
16290     * [`ChannelManager::funding_transaction_generated`].
16291     *
16292     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
16293     */
16294    struct LDKPublicKey counterparty_node_id;
16295    /**
16296     * The value, in satoshis, that the output should have.
16297     */
16298    uint64_t channel_value_satoshis;
16299    /**
16300     * The script which should be used in the transaction output.
16301     */
16302    struct LDKCVec_u8Z output_script;
16303    /**
16304     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
16305     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
16306     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
16307     * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
16308     * serialized with LDK versions prior to 0.0.113.
16309     *
16310     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
16311     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16312     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16313     */
16314    struct LDKU128 user_channel_id;
16315 } LDKEvent_LDKFundingGenerationReady_Body;
16316
16317 typedef struct LDKEvent_LDKPaymentClaimable_Body {
16318    /**
16319     * The node that will receive the payment after it has been claimed.
16320     * This is useful to identify payments received via [phantom nodes].
16321     * This field will always be filled in when the event was generated by LDK versions
16322     * 0.0.113 and above.
16323     *
16324     * [phantom nodes]: crate::sign::PhantomKeysManager
16325     *
16326     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16327     */
16328    struct LDKPublicKey receiver_node_id;
16329    /**
16330     * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
16331     * not stop you from registering duplicate payment hashes for inbound payments.
16332     */
16333    struct LDKThirtyTwoBytes payment_hash;
16334    /**
16335     * The fields in the onion which were received with each HTLC. Only fields which were
16336     * identical in each HTLC involved in the payment will be included here.
16337     *
16338     * Payments received on LDK versions prior to 0.0.115 will have this field unset.
16339     *
16340     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16341     */
16342    struct LDKRecipientOnionFields onion_fields;
16343    /**
16344     * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
16345     * than the invoice amount.
16346     *
16347     * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
16348     * and the previous hop took an extra fee.
16349     *
16350     * # Note
16351     * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
16352     * field, you may lose money!
16353     *
16354     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
16355     */
16356    uint64_t amount_msat;
16357    /**
16358     * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
16359     * taken by our channel counterparty.
16360     *
16361     * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
16362     *
16363     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
16364     */
16365    uint64_t counterparty_skimmed_fee_msat;
16366    /**
16367     * Information for claiming this received payment, based on whether the purpose of the
16368     * payment is to pay an invoice or to send a spontaneous payment.
16369     */
16370    struct LDKPaymentPurpose purpose;
16371    /**
16372     * The `channel_id` indicating over which channel we received the payment.
16373     */
16374    struct LDKCOption_ThirtyTwoBytesZ via_channel_id;
16375    /**
16376     * The `user_channel_id` indicating over which channel we received the payment.
16377     */
16378    struct LDKCOption_U128Z via_user_channel_id;
16379    /**
16380     * The block height at which this payment will be failed back and will no longer be
16381     * eligible for claiming.
16382     *
16383     * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
16384     * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
16385     *
16386     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
16387     */
16388    struct LDKCOption_u32Z claim_deadline;
16389 } LDKEvent_LDKPaymentClaimable_Body;
16390
16391 typedef struct LDKEvent_LDKPaymentClaimed_Body {
16392    /**
16393     * The node that received the payment.
16394     * This is useful to identify payments which were received via [phantom nodes].
16395     * This field will always be filled in when the event was generated by LDK versions
16396     * 0.0.113 and above.
16397     *
16398     * [phantom nodes]: crate::sign::PhantomKeysManager
16399     *
16400     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16401     */
16402    struct LDKPublicKey receiver_node_id;
16403    /**
16404     * The payment hash of the claimed payment. Note that LDK will not stop you from
16405     * registering duplicate payment hashes for inbound payments.
16406     */
16407    struct LDKThirtyTwoBytes payment_hash;
16408    /**
16409     * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
16410     * invoice amount.
16411     */
16412    uint64_t amount_msat;
16413    /**
16414     * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
16415     * spontaneous payment.
16416     */
16417    struct LDKPaymentPurpose purpose;
16418    /**
16419     * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
16420     * to LDK version 0.0.117.
16421     */
16422    struct LDKCVec_ClaimedHTLCZ htlcs;
16423    /**
16424     * The sender-intended sum total of all the MPP parts. This will be `None` for events
16425     * serialized prior to LDK version 0.0.117.
16426     */
16427    struct LDKCOption_u64Z sender_intended_total_msat;
16428 } LDKEvent_LDKPaymentClaimed_Body;
16429
16430 typedef struct LDKEvent_LDKConnectionNeeded_Body {
16431    /**
16432     * The node id for the node needing a connection.
16433     */
16434    struct LDKPublicKey node_id;
16435    /**
16436     * Sockets for connecting to the node.
16437     */
16438    struct LDKCVec_SocketAddressZ addresses;
16439 } LDKEvent_LDKConnectionNeeded_Body;
16440
16441 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
16442    /**
16443     * The `payment_id` to have been associated with payment for the requested invoice.
16444     */
16445    struct LDKThirtyTwoBytes payment_id;
16446 } LDKEvent_LDKInvoiceRequestFailed_Body;
16447
16448 typedef struct LDKEvent_LDKPaymentSent_Body {
16449    /**
16450     * The `payment_id` passed to [`ChannelManager::send_payment`].
16451     *
16452     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16453     */
16454    struct LDKCOption_ThirtyTwoBytesZ payment_id;
16455    /**
16456     * The preimage to the hash given to ChannelManager::send_payment.
16457     * Note that this serves as a payment receipt, if you wish to have such a thing, you must
16458     * store it somehow!
16459     */
16460    struct LDKThirtyTwoBytes payment_preimage;
16461    /**
16462     * The hash that was given to [`ChannelManager::send_payment`].
16463     *
16464     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16465     */
16466    struct LDKThirtyTwoBytes payment_hash;
16467    /**
16468     * The total fee which was spent at intermediate hops in this payment, across all paths.
16469     *
16470     * Note that, like [`Route::get_total_fees`] this does *not* include any potential
16471     * overpayment to the recipient node.
16472     *
16473     * If the recipient or an intermediate node misbehaves and gives us free money, this may
16474     * overstate the amount paid, though this is unlikely.
16475     *
16476     * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
16477     */
16478    struct LDKCOption_u64Z fee_paid_msat;
16479 } LDKEvent_LDKPaymentSent_Body;
16480
16481 typedef struct LDKEvent_LDKPaymentFailed_Body {
16482    /**
16483     * The `payment_id` passed to [`ChannelManager::send_payment`].
16484     *
16485     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16486     */
16487    struct LDKThirtyTwoBytes payment_id;
16488    /**
16489     * The hash that was given to [`ChannelManager::send_payment`].
16490     *
16491     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16492     */
16493    struct LDKThirtyTwoBytes payment_hash;
16494    /**
16495     * The reason the payment failed. This is only `None` for events generated or serialized
16496     * by versions prior to 0.0.115.
16497     */
16498    struct LDKCOption_PaymentFailureReasonZ reason;
16499 } LDKEvent_LDKPaymentFailed_Body;
16500
16501 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
16502    /**
16503     * The `payment_id` passed to [`ChannelManager::send_payment`].
16504     *
16505     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16506     */
16507    struct LDKThirtyTwoBytes payment_id;
16508    /**
16509     * The hash that was given to [`ChannelManager::send_payment`].
16510     *
16511     * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
16512     *
16513     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16514     */
16515    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
16516    /**
16517     * The payment path that was successful.
16518     *
16519     * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
16520     */
16521    struct LDKPath path;
16522 } LDKEvent_LDKPaymentPathSuccessful_Body;
16523
16524 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
16525    /**
16526     * The `payment_id` passed to [`ChannelManager::send_payment`].
16527     *
16528     * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
16529     *
16530     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16531     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
16532     */
16533    struct LDKCOption_ThirtyTwoBytesZ payment_id;
16534    /**
16535     * The hash that was given to [`ChannelManager::send_payment`].
16536     *
16537     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16538     */
16539    struct LDKThirtyTwoBytes payment_hash;
16540    /**
16541     * Indicates the payment was rejected for some reason by the recipient. This implies that
16542     * the payment has failed, not just the route in question. If this is not set, the payment may
16543     * be retried via a different route.
16544     */
16545    bool payment_failed_permanently;
16546    /**
16547     * Extra error details based on the failure type. May contain an update that needs to be
16548     * applied to the [`NetworkGraph`].
16549     *
16550     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
16551     */
16552    struct LDKPathFailure failure;
16553    /**
16554     * The payment path that failed.
16555     */
16556    struct LDKPath path;
16557    /**
16558     * The channel responsible for the failed payment path.
16559     *
16560     * Note that for route hints or for the first hop in a path this may be an SCID alias and
16561     * may not refer to a channel in the public network graph. These aliases may also collide
16562     * with channels in the public network graph.
16563     *
16564     * If this is `Some`, then the corresponding channel should be avoided when the payment is
16565     * retried. May be `None` for older [`Event`] serializations.
16566     */
16567    struct LDKCOption_u64Z short_channel_id;
16568 } LDKEvent_LDKPaymentPathFailed_Body;
16569
16570 typedef struct LDKEvent_LDKProbeSuccessful_Body {
16571    /**
16572     * The id returned by [`ChannelManager::send_probe`].
16573     *
16574     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
16575     */
16576    struct LDKThirtyTwoBytes payment_id;
16577    /**
16578     * The hash generated by [`ChannelManager::send_probe`].
16579     *
16580     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
16581     */
16582    struct LDKThirtyTwoBytes payment_hash;
16583    /**
16584     * The payment path that was successful.
16585     */
16586    struct LDKPath path;
16587 } LDKEvent_LDKProbeSuccessful_Body;
16588
16589 typedef struct LDKEvent_LDKProbeFailed_Body {
16590    /**
16591     * The id returned by [`ChannelManager::send_probe`].
16592     *
16593     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
16594     */
16595    struct LDKThirtyTwoBytes payment_id;
16596    /**
16597     * The hash generated by [`ChannelManager::send_probe`].
16598     *
16599     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
16600     */
16601    struct LDKThirtyTwoBytes payment_hash;
16602    /**
16603     * The payment path that failed.
16604     */
16605    struct LDKPath path;
16606    /**
16607     * The channel responsible for the failed probe.
16608     *
16609     * Note that for route hints or for the first hop in a path this may be an SCID alias and
16610     * may not refer to a channel in the public network graph. These aliases may also collide
16611     * with channels in the public network graph.
16612     */
16613    struct LDKCOption_u64Z short_channel_id;
16614 } LDKEvent_LDKProbeFailed_Body;
16615
16616 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
16617    /**
16618     * The minimum amount of time that should be waited prior to calling
16619     * process_pending_htlc_forwards. To increase the effort required to correlate payments,
16620     * you should wait a random amount of time in roughly the range (now + time_forwardable,
16621     * now + 5*time_forwardable).
16622     */
16623    uint64_t time_forwardable;
16624 } LDKEvent_LDKPendingHTLCsForwardable_Body;
16625
16626 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
16627    /**
16628     * An id to help LDK identify which HTLC is being forwarded or failed.
16629     */
16630    struct LDKThirtyTwoBytes intercept_id;
16631    /**
16632     * The fake scid that was programmed as the next hop's scid, generated using
16633     * [`ChannelManager::get_intercept_scid`].
16634     *
16635     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
16636     */
16637    uint64_t requested_next_hop_scid;
16638    /**
16639     * The payment hash used for this HTLC.
16640     */
16641    struct LDKThirtyTwoBytes payment_hash;
16642    /**
16643     * How many msats were received on the inbound edge of this HTLC.
16644     */
16645    uint64_t inbound_amount_msat;
16646    /**
16647     * How many msats the payer intended to route to the next node. Depending on the reason you are
16648     * intercepting this payment, you might take a fee by forwarding less than this amount.
16649     * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
16650     *
16651     * Note that LDK will NOT check that expected fees were factored into this value. You MUST
16652     * check that whatever fee you want has been included here or subtract it as required. Further,
16653     * LDK will not stop you from forwarding more than you received.
16654     */
16655    uint64_t expected_outbound_amount_msat;
16656 } LDKEvent_LDKHTLCIntercepted_Body;
16657
16658 typedef struct LDKEvent_LDKSpendableOutputs_Body {
16659    /**
16660     * The outputs which you should store as spendable by you.
16661     */
16662    struct LDKCVec_SpendableOutputDescriptorZ outputs;
16663    /**
16664     * The `channel_id` indicating which channel the spendable outputs belong to.
16665     *
16666     * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
16667     */
16668    struct LDKCOption_ThirtyTwoBytesZ channel_id;
16669 } LDKEvent_LDKSpendableOutputs_Body;
16670
16671 typedef struct LDKEvent_LDKPaymentForwarded_Body {
16672    /**
16673     * The incoming channel between the previous node and us. This is only `None` for events
16674     * generated or serialized by versions prior to 0.0.107.
16675     */
16676    struct LDKCOption_ThirtyTwoBytesZ prev_channel_id;
16677    /**
16678     * The outgoing channel between the next node and us. This is only `None` for events
16679     * generated or serialized by versions prior to 0.0.107.
16680     */
16681    struct LDKCOption_ThirtyTwoBytesZ next_channel_id;
16682    /**
16683     * The fee, in milli-satoshis, which was earned as a result of the payment.
16684     *
16685     * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
16686     * was pending, the amount the next hop claimed will have been rounded down to the nearest
16687     * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
16688     * claimed the full value in millisatoshis from the source. In this case,
16689     * `claim_from_onchain_tx` will be set.
16690     *
16691     * If the channel which sent us the payment has been force-closed, we will claim the funds
16692     * via an on-chain transaction. In that case we do not yet know the on-chain transaction
16693     * fees which we will spend and will instead set this to `None`. It is possible duplicate
16694     * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
16695     * `None`.
16696     */
16697    struct LDKCOption_u64Z fee_earned_msat;
16698    /**
16699     * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
16700     * transaction.
16701     */
16702    bool claim_from_onchain_tx;
16703    /**
16704     * The final amount forwarded, in milli-satoshis, after the fee is deducted.
16705     *
16706     * The caveat described above the `fee_earned_msat` field applies here as well.
16707     */
16708    struct LDKCOption_u64Z outbound_amount_forwarded_msat;
16709 } LDKEvent_LDKPaymentForwarded_Body;
16710
16711 typedef struct LDKEvent_LDKChannelPending_Body {
16712    /**
16713     * The `channel_id` of the channel that is pending confirmation.
16714     */
16715    struct LDKThirtyTwoBytes channel_id;
16716    /**
16717     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
16718     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
16719     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
16720     * `user_channel_id` will be randomized for an inbound channel.
16721     *
16722     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
16723     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16724     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16725     */
16726    struct LDKU128 user_channel_id;
16727    /**
16728     * The `temporary_channel_id` this channel used to be known by during channel establishment.
16729     *
16730     * Will be `None` for channels created prior to LDK version 0.0.115.
16731     */
16732    struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id;
16733    /**
16734     * The `node_id` of the channel counterparty.
16735     */
16736    struct LDKPublicKey counterparty_node_id;
16737    /**
16738     * The outpoint of the channel's funding transaction.
16739     */
16740    struct LDKOutPoint funding_txo;
16741 } LDKEvent_LDKChannelPending_Body;
16742
16743 typedef struct LDKEvent_LDKChannelReady_Body {
16744    /**
16745     * The `channel_id` of the channel that is ready.
16746     */
16747    struct LDKThirtyTwoBytes channel_id;
16748    /**
16749     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
16750     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
16751     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
16752     * `user_channel_id` will be randomized for an inbound channel.
16753     *
16754     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
16755     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16756     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16757     */
16758    struct LDKU128 user_channel_id;
16759    /**
16760     * The `node_id` of the channel counterparty.
16761     */
16762    struct LDKPublicKey counterparty_node_id;
16763    /**
16764     * The features that this channel will operate with.
16765     */
16766    struct LDKChannelTypeFeatures channel_type;
16767 } LDKEvent_LDKChannelReady_Body;
16768
16769 typedef struct LDKEvent_LDKChannelClosed_Body {
16770    /**
16771     * The `channel_id` of the channel which has been closed. Note that on-chain transactions
16772     * resolving the channel are likely still awaiting confirmation.
16773     */
16774    struct LDKThirtyTwoBytes channel_id;
16775    /**
16776     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
16777     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
16778     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
16779     * `user_channel_id` will be randomized for inbound channels.
16780     * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
16781     * zero for objects serialized with LDK versions prior to 0.0.102.
16782     *
16783     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
16784     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16785     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16786     */
16787    struct LDKU128 user_channel_id;
16788    /**
16789     * The reason the channel was closed.
16790     */
16791    struct LDKClosureReason reason;
16792    /**
16793     * Counterparty in the closed channel.
16794     *
16795     * This field will be `None` for objects serialized prior to LDK 0.0.117.
16796     *
16797     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16798     */
16799    struct LDKPublicKey counterparty_node_id;
16800    /**
16801     * Channel capacity of the closing channel (sats).
16802     *
16803     * This field will be `None` for objects serialized prior to LDK 0.0.117.
16804     */
16805    struct LDKCOption_u64Z channel_capacity_sats;
16806    /**
16807     * The original channel funding TXO; this helps checking for the existence and confirmation
16808     * status of the closing tx.
16809     * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
16810     *
16811     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16812     */
16813    struct LDKOutPoint channel_funding_txo;
16814 } LDKEvent_LDKChannelClosed_Body;
16815
16816 typedef struct LDKEvent_LDKDiscardFunding_Body {
16817    /**
16818     * The channel_id of the channel which has been closed.
16819     */
16820    struct LDKThirtyTwoBytes channel_id;
16821    /**
16822     * The full transaction received from the user
16823     */
16824    struct LDKTransaction transaction;
16825 } LDKEvent_LDKDiscardFunding_Body;
16826
16827 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
16828    /**
16829     * The temporary channel ID of the channel requested to be opened.
16830     *
16831     * When responding to the request, the `temporary_channel_id` should be passed
16832     * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
16833     * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
16834     *
16835     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16836     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
16837     */
16838    struct LDKThirtyTwoBytes temporary_channel_id;
16839    /**
16840     * The node_id of the counterparty requesting to open the channel.
16841     *
16842     * When responding to the request, the `counterparty_node_id` should be passed
16843     * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
16844     * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
16845     * request.
16846     *
16847     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16848     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
16849     */
16850    struct LDKPublicKey counterparty_node_id;
16851    /**
16852     * The channel value of the requested channel.
16853     */
16854    uint64_t funding_satoshis;
16855    /**
16856     * Our starting balance in the channel if the request is accepted, in milli-satoshi.
16857     */
16858    uint64_t push_msat;
16859    /**
16860     * The features that this channel will operate with. If you reject the channel, a
16861     * well-behaved counterparty may automatically re-attempt the channel with a new set of
16862     * feature flags.
16863     *
16864     * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
16865     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
16866     * 0.0.106.
16867     *
16868     * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
16869     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
16870     * 0.0.107. Channels setting this type also need to get manually accepted via
16871     * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
16872     * or will be rejected otherwise.
16873     *
16874     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16875     */
16876    struct LDKChannelTypeFeatures channel_type;
16877 } LDKEvent_LDKOpenChannelRequest_Body;
16878
16879 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
16880    /**
16881     * The channel over which the HTLC was received.
16882     */
16883    struct LDKThirtyTwoBytes prev_channel_id;
16884    /**
16885     * Destination of the HTLC that failed to be processed.
16886     */
16887    struct LDKHTLCDestination failed_next_destination;
16888 } LDKEvent_LDKHTLCHandlingFailed_Body;
16889
16890 typedef struct MUST_USE_STRUCT LDKEvent {
16891    LDKEvent_Tag tag;
16892    union {
16893       LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
16894       LDKEvent_LDKPaymentClaimable_Body payment_claimable;
16895       LDKEvent_LDKPaymentClaimed_Body payment_claimed;
16896       LDKEvent_LDKConnectionNeeded_Body connection_needed;
16897       LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
16898       LDKEvent_LDKPaymentSent_Body payment_sent;
16899       LDKEvent_LDKPaymentFailed_Body payment_failed;
16900       LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
16901       LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
16902       LDKEvent_LDKProbeSuccessful_Body probe_successful;
16903       LDKEvent_LDKProbeFailed_Body probe_failed;
16904       LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
16905       LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
16906       LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
16907       LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
16908       LDKEvent_LDKChannelPending_Body channel_pending;
16909       LDKEvent_LDKChannelReady_Body channel_ready;
16910       LDKEvent_LDKChannelClosed_Body channel_closed;
16911       LDKEvent_LDKDiscardFunding_Body discard_funding;
16912       LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
16913       LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
16914       struct {
16915          struct LDKBumpTransactionEvent bump_transaction;
16916       };
16917    };
16918 } LDKEvent;
16919
16920 /**
16921  * An enum which can either contain a crate::lightning::events::Event or not
16922  */
16923 typedef enum LDKCOption_EventZ_Tag {
16924    /**
16925     * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
16926     */
16927    LDKCOption_EventZ_Some,
16928    /**
16929     * When we're in this state, this COption_EventZ contains nothing
16930     */
16931    LDKCOption_EventZ_None,
16932    /**
16933     * Must be last for serialization purposes
16934     */
16935    LDKCOption_EventZ_Sentinel,
16936 } LDKCOption_EventZ_Tag;
16937
16938 typedef struct LDKCOption_EventZ {
16939    LDKCOption_EventZ_Tag tag;
16940    union {
16941       struct {
16942          struct LDKEvent some;
16943       };
16944    };
16945 } LDKCOption_EventZ;
16946
16947 /**
16948  * The contents of CResult_COption_EventZDecodeErrorZ
16949  */
16950 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
16951    /**
16952     * A pointer to the contents in the success state.
16953     * Reading from this pointer when `result_ok` is not set is undefined.
16954     */
16955    struct LDKCOption_EventZ *result;
16956    /**
16957     * A pointer to the contents in the error state.
16958     * Reading from this pointer when `result_ok` is set is undefined.
16959     */
16960    struct LDKDecodeError *err;
16961 } LDKCResult_COption_EventZDecodeErrorZPtr;
16962
16963 /**
16964  * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
16965  * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
16966  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16967  */
16968 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
16969    /**
16970     * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
16971     * `err` or `result` depending on the state of `result_ok`.
16972     */
16973    union LDKCResult_COption_EventZDecodeErrorZPtr contents;
16974    /**
16975     * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
16976     */
16977    bool result_ok;
16978 } LDKCResult_COption_EventZDecodeErrorZ;
16979
16980 /**
16981  * Sub-errors which don't have specific information in them use this type.
16982  */
16983 typedef struct LDKError {
16984    /**
16985     * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
16986     */
16987    uint8_t _dummy;
16988 } LDKError;
16989
16990 /**
16991  * Errors that indicate what is wrong with the invoice. They have some granularity for debug
16992  * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
16993  */
16994 typedef enum LDKBolt11ParseError_Tag {
16995    LDKBolt11ParseError_Bech32Error,
16996    LDKBolt11ParseError_ParseAmountError,
16997    LDKBolt11ParseError_MalformedSignature,
16998    LDKBolt11ParseError_BadPrefix,
16999    LDKBolt11ParseError_UnknownCurrency,
17000    LDKBolt11ParseError_UnknownSiPrefix,
17001    LDKBolt11ParseError_MalformedHRP,
17002    LDKBolt11ParseError_TooShortDataPart,
17003    LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
17004    LDKBolt11ParseError_DescriptionDecodeError,
17005    LDKBolt11ParseError_PaddingError,
17006    LDKBolt11ParseError_IntegerOverflowError,
17007    LDKBolt11ParseError_InvalidSegWitProgramLength,
17008    LDKBolt11ParseError_InvalidPubKeyHashLength,
17009    LDKBolt11ParseError_InvalidScriptHashLength,
17010    LDKBolt11ParseError_InvalidRecoveryId,
17011    LDKBolt11ParseError_InvalidSliceLength,
17012    /**
17013     * Not an error, but used internally to signal that a part of the invoice should be ignored
17014     * according to BOLT11
17015     */
17016    LDKBolt11ParseError_Skip,
17017    /**
17018     * Must be last for serialization purposes
17019     */
17020    LDKBolt11ParseError_Sentinel,
17021 } LDKBolt11ParseError_Tag;
17022
17023 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
17024    LDKBolt11ParseError_Tag tag;
17025    union {
17026       struct {
17027          struct LDKBech32Error bech32_error;
17028       };
17029       struct {
17030          struct LDKError parse_amount_error;
17031       };
17032       struct {
17033          enum LDKSecp256k1Error malformed_signature;
17034       };
17035       struct {
17036          struct LDKError description_decode_error;
17037       };
17038       struct {
17039          struct LDKStr invalid_slice_length;
17040       };
17041    };
17042 } LDKBolt11ParseError;
17043
17044 /**
17045  * The contents of CResult_SiPrefixBolt11ParseErrorZ
17046  */
17047 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
17048    /**
17049     * A pointer to the contents in the success state.
17050     * Reading from this pointer when `result_ok` is not set is undefined.
17051     */
17052    enum LDKSiPrefix *result;
17053    /**
17054     * A pointer to the contents in the error state.
17055     * Reading from this pointer when `result_ok` is set is undefined.
17056     */
17057    struct LDKBolt11ParseError *err;
17058 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
17059
17060 /**
17061  * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
17062  * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
17063  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17064  */
17065 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
17066    /**
17067     * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
17068     * `err` or `result` depending on the state of `result_ok`.
17069     */
17070    union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
17071    /**
17072     * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
17073     */
17074    bool result_ok;
17075 } LDKCResult_SiPrefixBolt11ParseErrorZ;
17076
17077 /**
17078  * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
17079  * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
17080  * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
17081  */
17082 typedef enum LDKParseOrSemanticError_Tag {
17083    /**
17084     * The invoice couldn't be decoded
17085     */
17086    LDKParseOrSemanticError_ParseError,
17087    /**
17088     * The invoice could be decoded but violates the BOLT11 standard
17089     */
17090    LDKParseOrSemanticError_SemanticError,
17091    /**
17092     * Must be last for serialization purposes
17093     */
17094    LDKParseOrSemanticError_Sentinel,
17095 } LDKParseOrSemanticError_Tag;
17096
17097 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
17098    LDKParseOrSemanticError_Tag tag;
17099    union {
17100       struct {
17101          struct LDKBolt11ParseError parse_error;
17102       };
17103       struct {
17104          enum LDKBolt11SemanticError semantic_error;
17105       };
17106    };
17107 } LDKParseOrSemanticError;
17108
17109 /**
17110  * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
17111  */
17112 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
17113    /**
17114     * A pointer to the contents in the success state.
17115     * Reading from this pointer when `result_ok` is not set is undefined.
17116     */
17117    struct LDKBolt11Invoice *result;
17118    /**
17119     * A pointer to the contents in the error state.
17120     * Reading from this pointer when `result_ok` is set is undefined.
17121     */
17122    struct LDKParseOrSemanticError *err;
17123 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
17124
17125 /**
17126  * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
17127  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
17128  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17129  */
17130 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
17131    /**
17132     * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
17133     * `err` or `result` depending on the state of `result_ok`.
17134     */
17135    union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
17136    /**
17137     * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
17138     */
17139    bool result_ok;
17140 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
17141
17142
17143
17144 /**
17145  * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
17146  * invalid.
17147  *
17148  * # Invariants
17149  * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
17150  */
17151 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
17152    /**
17153     * A pointer to the opaque Rust object.
17154     * Nearly everywhere, inner must be non-null, however in places where
17155     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17156     */
17157    LDKnativeSignedRawBolt11Invoice *inner;
17158    /**
17159     * Indicates that this is the only struct which contains the same pointer.
17160     * Rust functions which take ownership of an object provided via an argument require
17161     * this to be true and invalidate the object pointed to by inner.
17162     */
17163    bool is_owned;
17164 } LDKSignedRawBolt11Invoice;
17165
17166 /**
17167  * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
17168  */
17169 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
17170    /**
17171     * A pointer to the contents in the success state.
17172     * Reading from this pointer when `result_ok` is not set is undefined.
17173     */
17174    struct LDKSignedRawBolt11Invoice *result;
17175    /**
17176     * A pointer to the contents in the error state.
17177     * Reading from this pointer when `result_ok` is set is undefined.
17178     */
17179    struct LDKBolt11ParseError *err;
17180 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
17181
17182 /**
17183  * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
17184  * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
17185  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17186  */
17187 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
17188    /**
17189     * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
17190     * `err` or `result` depending on the state of `result_ok`.
17191     */
17192    union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
17193    /**
17194     * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
17195     */
17196    bool result_ok;
17197 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
17198
17199
17200
17201 /**
17202  * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
17203  * but without the signature information.
17204  * Decoding and encoding should not lead to information loss but may lead to different hashes.
17205  *
17206  * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
17207  */
17208 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
17209    /**
17210     * A pointer to the opaque Rust object.
17211     * Nearly everywhere, inner must be non-null, however in places where
17212     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17213     */
17214    LDKnativeRawBolt11Invoice *inner;
17215    /**
17216     * Indicates that this is the only struct which contains the same pointer.
17217     * Rust functions which take ownership of an object provided via an argument require
17218     * this to be true and invalidate the object pointed to by inner.
17219     */
17220    bool is_owned;
17221 } LDKRawBolt11Invoice;
17222
17223
17224
17225 /**
17226  * Recoverable signature
17227  */
17228 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
17229    /**
17230     * A pointer to the opaque Rust object.
17231     * Nearly everywhere, inner must be non-null, however in places where
17232     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17233     */
17234    LDKnativeBolt11InvoiceSignature *inner;
17235    /**
17236     * Indicates that this is the only struct which contains the same pointer.
17237     * Rust functions which take ownership of an object provided via an argument require
17238     * this to be true and invalidate the object pointed to by inner.
17239     */
17240    bool is_owned;
17241 } LDKBolt11InvoiceSignature;
17242
17243 /**
17244  * A tuple of 3 elements. See the individual fields for the types contained.
17245  */
17246 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
17247    /**
17248     * The element at position 0
17249     */
17250    struct LDKRawBolt11Invoice a;
17251    /**
17252     * The element at position 1
17253     */
17254    struct LDKThirtyTwoBytes b;
17255    /**
17256     * The element at position 2
17257     */
17258    struct LDKBolt11InvoiceSignature c;
17259 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
17260
17261
17262
17263 /**
17264  * Payee public key
17265  */
17266 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
17267    /**
17268     * A pointer to the opaque Rust object.
17269     * Nearly everywhere, inner must be non-null, however in places where
17270     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17271     */
17272    LDKnativePayeePubKey *inner;
17273    /**
17274     * Indicates that this is the only struct which contains the same pointer.
17275     * Rust functions which take ownership of an object provided via an argument require
17276     * this to be true and invalidate the object pointed to by inner.
17277     */
17278    bool is_owned;
17279 } LDKPayeePubKey;
17280
17281 /**
17282  * The contents of CResult_PayeePubKeySecp256k1ErrorZ
17283  */
17284 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
17285    /**
17286     * A pointer to the contents in the success state.
17287     * Reading from this pointer when `result_ok` is not set is undefined.
17288     */
17289    struct LDKPayeePubKey *result;
17290    /**
17291     * A pointer to the contents in the error state.
17292     * Reading from this pointer when `result_ok` is set is undefined.
17293     */
17294    enum LDKSecp256k1Error *err;
17295 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
17296
17297 /**
17298  * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
17299  * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
17300  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17301  */
17302 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
17303    /**
17304     * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
17305     * `err` or `result` depending on the state of `result_ok`.
17306     */
17307    union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
17308    /**
17309     * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
17310     */
17311    bool result_ok;
17312 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
17313
17314
17315
17316 /**
17317  * Private routing information
17318  *
17319  * # Invariants
17320  * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
17321  *
17322  */
17323 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
17324    /**
17325     * A pointer to the opaque Rust object.
17326     * Nearly everywhere, inner must be non-null, however in places where
17327     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17328     */
17329    LDKnativePrivateRoute *inner;
17330    /**
17331     * Indicates that this is the only struct which contains the same pointer.
17332     * Rust functions which take ownership of an object provided via an argument require
17333     * this to be true and invalidate the object pointed to by inner.
17334     */
17335    bool is_owned;
17336 } LDKPrivateRoute;
17337
17338 /**
17339  * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
17340  * This corresponds to std::vector in C++
17341  */
17342 typedef struct LDKCVec_PrivateRouteZ {
17343    /**
17344     * The elements in the array.
17345     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17346     */
17347    struct LDKPrivateRoute *data;
17348    /**
17349     * The number of elements pointed to by `data`.
17350     */
17351    uintptr_t datalen;
17352 } LDKCVec_PrivateRouteZ;
17353
17354
17355
17356 /**
17357  * A timestamp that refers to a date after 1 January 1970.
17358  *
17359  * # Invariants
17360  *
17361  * The Unix timestamp representing the stored time has to be positive and no greater than
17362  * [`MAX_TIMESTAMP`].
17363  */
17364 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
17365    /**
17366     * A pointer to the opaque Rust object.
17367     * Nearly everywhere, inner must be non-null, however in places where
17368     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17369     */
17370    LDKnativePositiveTimestamp *inner;
17371    /**
17372     * Indicates that this is the only struct which contains the same pointer.
17373     * Rust functions which take ownership of an object provided via an argument require
17374     * this to be true and invalidate the object pointed to by inner.
17375     */
17376    bool is_owned;
17377 } LDKPositiveTimestamp;
17378
17379 /**
17380  * The contents of CResult_PositiveTimestampCreationErrorZ
17381  */
17382 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
17383    /**
17384     * A pointer to the contents in the success state.
17385     * Reading from this pointer when `result_ok` is not set is undefined.
17386     */
17387    struct LDKPositiveTimestamp *result;
17388    /**
17389     * A pointer to the contents in the error state.
17390     * Reading from this pointer when `result_ok` is set is undefined.
17391     */
17392    enum LDKCreationError *err;
17393 } LDKCResult_PositiveTimestampCreationErrorZPtr;
17394
17395 /**
17396  * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
17397  * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
17398  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17399  */
17400 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
17401    /**
17402     * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
17403     * `err` or `result` depending on the state of `result_ok`.
17404     */
17405    union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
17406    /**
17407     * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
17408     */
17409    bool result_ok;
17410 } LDKCResult_PositiveTimestampCreationErrorZ;
17411
17412 /**
17413  * The contents of CResult_NoneBolt11SemanticErrorZ
17414  */
17415 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
17416    /**
17417     * Note that this value is always NULL, as there are no contents in the OK variant
17418     */
17419    void *result;
17420    /**
17421     * A pointer to the contents in the error state.
17422     * Reading from this pointer when `result_ok` is set is undefined.
17423     */
17424    enum LDKBolt11SemanticError *err;
17425 } LDKCResult_NoneBolt11SemanticErrorZPtr;
17426
17427 /**
17428  * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
17429  * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
17430  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17431  */
17432 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
17433    /**
17434     * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
17435     * `err` or `result` depending on the state of `result_ok`.
17436     */
17437    union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
17438    /**
17439     * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
17440     */
17441    bool result_ok;
17442 } LDKCResult_NoneBolt11SemanticErrorZ;
17443
17444 /**
17445  * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
17446  */
17447 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
17448    /**
17449     * A pointer to the contents in the success state.
17450     * Reading from this pointer when `result_ok` is not set is undefined.
17451     */
17452    struct LDKBolt11Invoice *result;
17453    /**
17454     * A pointer to the contents in the error state.
17455     * Reading from this pointer when `result_ok` is set is undefined.
17456     */
17457    enum LDKBolt11SemanticError *err;
17458 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
17459
17460 /**
17461  * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
17462  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
17463  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17464  */
17465 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
17466    /**
17467     * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
17468     * `err` or `result` depending on the state of `result_ok`.
17469     */
17470    union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
17471    /**
17472     * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
17473     */
17474    bool result_ok;
17475 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
17476
17477
17478
17479 /**
17480  * Description string
17481  *
17482  * # Invariants
17483  * The description can be at most 639 __bytes__ long
17484  */
17485 typedef struct MUST_USE_STRUCT LDKDescription {
17486    /**
17487     * A pointer to the opaque Rust object.
17488     * Nearly everywhere, inner must be non-null, however in places where
17489     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17490     */
17491    LDKnativeDescription *inner;
17492    /**
17493     * Indicates that this is the only struct which contains the same pointer.
17494     * Rust functions which take ownership of an object provided via an argument require
17495     * this to be true and invalidate the object pointed to by inner.
17496     */
17497    bool is_owned;
17498 } LDKDescription;
17499
17500 /**
17501  * The contents of CResult_DescriptionCreationErrorZ
17502  */
17503 typedef union LDKCResult_DescriptionCreationErrorZPtr {
17504    /**
17505     * A pointer to the contents in the success state.
17506     * Reading from this pointer when `result_ok` is not set is undefined.
17507     */
17508    struct LDKDescription *result;
17509    /**
17510     * A pointer to the contents in the error state.
17511     * Reading from this pointer when `result_ok` is set is undefined.
17512     */
17513    enum LDKCreationError *err;
17514 } LDKCResult_DescriptionCreationErrorZPtr;
17515
17516 /**
17517  * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
17518  * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
17519  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17520  */
17521 typedef struct LDKCResult_DescriptionCreationErrorZ {
17522    /**
17523     * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
17524     * `err` or `result` depending on the state of `result_ok`.
17525     */
17526    union LDKCResult_DescriptionCreationErrorZPtr contents;
17527    /**
17528     * Whether this CResult_DescriptionCreationErrorZ represents a success state.
17529     */
17530    bool result_ok;
17531 } LDKCResult_DescriptionCreationErrorZ;
17532
17533 /**
17534  * The contents of CResult_PrivateRouteCreationErrorZ
17535  */
17536 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
17537    /**
17538     * A pointer to the contents in the success state.
17539     * Reading from this pointer when `result_ok` is not set is undefined.
17540     */
17541    struct LDKPrivateRoute *result;
17542    /**
17543     * A pointer to the contents in the error state.
17544     * Reading from this pointer when `result_ok` is set is undefined.
17545     */
17546    enum LDKCreationError *err;
17547 } LDKCResult_PrivateRouteCreationErrorZPtr;
17548
17549 /**
17550  * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
17551  * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
17552  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17553  */
17554 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
17555    /**
17556     * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
17557     * `err` or `result` depending on the state of `result_ok`.
17558     */
17559    union LDKCResult_PrivateRouteCreationErrorZPtr contents;
17560    /**
17561     * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
17562     */
17563    bool result_ok;
17564 } LDKCResult_PrivateRouteCreationErrorZ;
17565
17566 /**
17567  * The contents of CResult_OutPointDecodeErrorZ
17568  */
17569 typedef union LDKCResult_OutPointDecodeErrorZPtr {
17570    /**
17571     * A pointer to the contents in the success state.
17572     * Reading from this pointer when `result_ok` is not set is undefined.
17573     */
17574    struct LDKOutPoint *result;
17575    /**
17576     * A pointer to the contents in the error state.
17577     * Reading from this pointer when `result_ok` is set is undefined.
17578     */
17579    struct LDKDecodeError *err;
17580 } LDKCResult_OutPointDecodeErrorZPtr;
17581
17582 /**
17583  * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
17584  * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
17585  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17586  */
17587 typedef struct LDKCResult_OutPointDecodeErrorZ {
17588    /**
17589     * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
17590     * `err` or `result` depending on the state of `result_ok`.
17591     */
17592    union LDKCResult_OutPointDecodeErrorZPtr contents;
17593    /**
17594     * Whether this CResult_OutPointDecodeErrorZ represents a success state.
17595     */
17596    bool result_ok;
17597 } LDKCResult_OutPointDecodeErrorZ;
17598
17599
17600
17601 /**
17602  * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
17603  * variable-length integers except that it is serialized in big-endian instead of little-endian.
17604  *
17605  * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
17606  * encoded in several different ways, which we must check for at deserialization-time. Thus, if
17607  * you're looking for an example of a variable-length integer to use for your own project, move
17608  * along, this is a rather poor design.
17609  */
17610 typedef struct MUST_USE_STRUCT LDKBigSize {
17611    /**
17612     * A pointer to the opaque Rust object.
17613     * Nearly everywhere, inner must be non-null, however in places where
17614     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17615     */
17616    LDKnativeBigSize *inner;
17617    /**
17618     * Indicates that this is the only struct which contains the same pointer.
17619     * Rust functions which take ownership of an object provided via an argument require
17620     * this to be true and invalidate the object pointed to by inner.
17621     */
17622    bool is_owned;
17623 } LDKBigSize;
17624
17625 /**
17626  * The contents of CResult_BigSizeDecodeErrorZ
17627  */
17628 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
17629    /**
17630     * A pointer to the contents in the success state.
17631     * Reading from this pointer when `result_ok` is not set is undefined.
17632     */
17633    struct LDKBigSize *result;
17634    /**
17635     * A pointer to the contents in the error state.
17636     * Reading from this pointer when `result_ok` is set is undefined.
17637     */
17638    struct LDKDecodeError *err;
17639 } LDKCResult_BigSizeDecodeErrorZPtr;
17640
17641 /**
17642  * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
17643  * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
17644  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17645  */
17646 typedef struct LDKCResult_BigSizeDecodeErrorZ {
17647    /**
17648     * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
17649     * `err` or `result` depending on the state of `result_ok`.
17650     */
17651    union LDKCResult_BigSizeDecodeErrorZPtr contents;
17652    /**
17653     * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
17654     */
17655    bool result_ok;
17656 } LDKCResult_BigSizeDecodeErrorZ;
17657
17658 /**
17659  * The contents of CResult_HostnameDecodeErrorZ
17660  */
17661 typedef union LDKCResult_HostnameDecodeErrorZPtr {
17662    /**
17663     * A pointer to the contents in the success state.
17664     * Reading from this pointer when `result_ok` is not set is undefined.
17665     */
17666    struct LDKHostname *result;
17667    /**
17668     * A pointer to the contents in the error state.
17669     * Reading from this pointer when `result_ok` is set is undefined.
17670     */
17671    struct LDKDecodeError *err;
17672 } LDKCResult_HostnameDecodeErrorZPtr;
17673
17674 /**
17675  * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
17676  * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
17677  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17678  */
17679 typedef struct LDKCResult_HostnameDecodeErrorZ {
17680    /**
17681     * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
17682     * `err` or `result` depending on the state of `result_ok`.
17683     */
17684    union LDKCResult_HostnameDecodeErrorZPtr contents;
17685    /**
17686     * Whether this CResult_HostnameDecodeErrorZ represents a success state.
17687     */
17688    bool result_ok;
17689 } LDKCResult_HostnameDecodeErrorZ;
17690
17691
17692
17693 /**
17694  * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
17695  * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
17696  *
17697  * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
17698  */
17699 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
17700    /**
17701     * A pointer to the opaque Rust object.
17702     * Nearly everywhere, inner must be non-null, however in places where
17703     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17704     */
17705    LDKnativeTransactionU16LenLimited *inner;
17706    /**
17707     * Indicates that this is the only struct which contains the same pointer.
17708     * Rust functions which take ownership of an object provided via an argument require
17709     * this to be true and invalidate the object pointed to by inner.
17710     */
17711    bool is_owned;
17712 } LDKTransactionU16LenLimited;
17713
17714 /**
17715  * The contents of CResult_TransactionU16LenLimitedNoneZ
17716  */
17717 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
17718    /**
17719     * A pointer to the contents in the success state.
17720     * Reading from this pointer when `result_ok` is not set is undefined.
17721     */
17722    struct LDKTransactionU16LenLimited *result;
17723    /**
17724     * Note that this value is always NULL, as there are no contents in the Err variant
17725     */
17726    void *err;
17727 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
17728
17729 /**
17730  * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
17731  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
17732  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17733  */
17734 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
17735    /**
17736     * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
17737     * `err` or `result` depending on the state of `result_ok`.
17738     */
17739    union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
17740    /**
17741     * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
17742     */
17743    bool result_ok;
17744 } LDKCResult_TransactionU16LenLimitedNoneZ;
17745
17746 /**
17747  * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
17748  */
17749 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
17750    /**
17751     * A pointer to the contents in the success state.
17752     * Reading from this pointer when `result_ok` is not set is undefined.
17753     */
17754    struct LDKTransactionU16LenLimited *result;
17755    /**
17756     * A pointer to the contents in the error state.
17757     * Reading from this pointer when `result_ok` is set is undefined.
17758     */
17759    struct LDKDecodeError *err;
17760 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
17761
17762 /**
17763  * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
17764  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
17765  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17766  */
17767 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
17768    /**
17769     * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
17770     * `err` or `result` depending on the state of `result_ok`.
17771     */
17772    union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
17773    /**
17774     * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
17775     */
17776    bool result_ok;
17777 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
17778
17779 /**
17780  * The contents of CResult_UntrustedStringDecodeErrorZ
17781  */
17782 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
17783    /**
17784     * A pointer to the contents in the success state.
17785     * Reading from this pointer when `result_ok` is not set is undefined.
17786     */
17787    struct LDKUntrustedString *result;
17788    /**
17789     * A pointer to the contents in the error state.
17790     * Reading from this pointer when `result_ok` is set is undefined.
17791     */
17792    struct LDKDecodeError *err;
17793 } LDKCResult_UntrustedStringDecodeErrorZPtr;
17794
17795 /**
17796  * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
17797  * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
17798  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17799  */
17800 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
17801    /**
17802     * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
17803     * `err` or `result` depending on the state of `result_ok`.
17804     */
17805    union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
17806    /**
17807     * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
17808     */
17809    bool result_ok;
17810 } LDKCResult_UntrustedStringDecodeErrorZ;
17811
17812 /**
17813  * A tuple of 2 elements. See the individual fields for the types contained.
17814  */
17815 typedef struct LDKC2Tuple__u832u16Z {
17816    /**
17817     * The element at position 0
17818     */
17819    struct LDKThirtyTwoBytes a;
17820    /**
17821     * The element at position 1
17822     */
17823    uint16_t b;
17824 } LDKC2Tuple__u832u16Z;
17825
17826
17827
17828 /**
17829  * Parameters for relaying over a given [`BlindedHop`].
17830  *
17831  * [`BlindedHop`]: crate::blinded_path::BlindedHop
17832  */
17833 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
17834    /**
17835     * A pointer to the opaque Rust object.
17836     * Nearly everywhere, inner must be non-null, however in places where
17837     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17838     */
17839    LDKnativePaymentRelay *inner;
17840    /**
17841     * Indicates that this is the only struct which contains the same pointer.
17842     * Rust functions which take ownership of an object provided via an argument require
17843     * this to be true and invalidate the object pointed to by inner.
17844     */
17845    bool is_owned;
17846 } LDKPaymentRelay;
17847
17848 /**
17849  * The contents of CResult_PaymentRelayDecodeErrorZ
17850  */
17851 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
17852    /**
17853     * A pointer to the contents in the success state.
17854     * Reading from this pointer when `result_ok` is not set is undefined.
17855     */
17856    struct LDKPaymentRelay *result;
17857    /**
17858     * A pointer to the contents in the error state.
17859     * Reading from this pointer when `result_ok` is set is undefined.
17860     */
17861    struct LDKDecodeError *err;
17862 } LDKCResult_PaymentRelayDecodeErrorZPtr;
17863
17864 /**
17865  * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
17866  * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
17867  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17868  */
17869 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
17870    /**
17871     * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
17872     * `err` or `result` depending on the state of `result_ok`.
17873     */
17874    union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
17875    /**
17876     * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
17877     */
17878    bool result_ok;
17879 } LDKCResult_PaymentRelayDecodeErrorZ;
17880
17881
17882
17883 /**
17884  * Constraints for relaying over a given [`BlindedHop`].
17885  *
17886  * [`BlindedHop`]: crate::blinded_path::BlindedHop
17887  */
17888 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
17889    /**
17890     * A pointer to the opaque Rust object.
17891     * Nearly everywhere, inner must be non-null, however in places where
17892     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17893     */
17894    LDKnativePaymentConstraints *inner;
17895    /**
17896     * Indicates that this is the only struct which contains the same pointer.
17897     * Rust functions which take ownership of an object provided via an argument require
17898     * this to be true and invalidate the object pointed to by inner.
17899     */
17900    bool is_owned;
17901 } LDKPaymentConstraints;
17902
17903 /**
17904  * The contents of CResult_PaymentConstraintsDecodeErrorZ
17905  */
17906 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
17907    /**
17908     * A pointer to the contents in the success state.
17909     * Reading from this pointer when `result_ok` is not set is undefined.
17910     */
17911    struct LDKPaymentConstraints *result;
17912    /**
17913     * A pointer to the contents in the error state.
17914     * Reading from this pointer when `result_ok` is set is undefined.
17915     */
17916    struct LDKDecodeError *err;
17917 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
17918
17919 /**
17920  * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
17921  * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
17922  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17923  */
17924 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
17925    /**
17926     * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
17927     * `err` or `result` depending on the state of `result_ok`.
17928     */
17929    union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
17930    /**
17931     * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
17932     */
17933    bool result_ok;
17934 } LDKCResult_PaymentConstraintsDecodeErrorZ;
17935
17936 /**
17937  * A tuple of 3 elements. See the individual fields for the types contained.
17938  */
17939 typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
17940    /**
17941     * The element at position 0
17942     */
17943    struct LDKThirtyTwoBytes a;
17944    /**
17945     * The element at position 1
17946     */
17947    struct LDKRecipientOnionFields b;
17948    /**
17949     * The element at position 2
17950     */
17951    struct LDKRouteParameters c;
17952 } LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
17953
17954 /**
17955  * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
17956  */
17957 typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
17958    /**
17959     * A pointer to the contents in the success state.
17960     * Reading from this pointer when `result_ok` is not set is undefined.
17961     */
17962    struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
17963    /**
17964     * Note that this value is always NULL, as there are no contents in the Err variant
17965     */
17966    void *err;
17967 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
17968
17969 /**
17970  * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
17971  * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
17972  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17973  */
17974 typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
17975    /**
17976     * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
17977     * `err` or `result` depending on the state of `result_ok`.
17978     */
17979    union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
17980    /**
17981     * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
17982     */
17983    bool result_ok;
17984 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
17985
17986 /**
17987  * The contents of CResult_StrSecp256k1ErrorZ
17988  */
17989 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
17990    /**
17991     * A pointer to the contents in the success state.
17992     * Reading from this pointer when `result_ok` is not set is undefined.
17993     */
17994    struct LDKStr *result;
17995    /**
17996     * A pointer to the contents in the error state.
17997     * Reading from this pointer when `result_ok` is set is undefined.
17998     */
17999    enum LDKSecp256k1Error *err;
18000 } LDKCResult_StrSecp256k1ErrorZPtr;
18001
18002 /**
18003  * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
18004  * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
18005  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18006  */
18007 typedef struct LDKCResult_StrSecp256k1ErrorZ {
18008    /**
18009     * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
18010     * `err` or `result` depending on the state of `result_ok`.
18011     */
18012    union LDKCResult_StrSecp256k1ErrorZPtr contents;
18013    /**
18014     * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
18015     */
18016    bool result_ok;
18017 } LDKCResult_StrSecp256k1ErrorZ;
18018
18019 /**
18020  * A tuple of 3 elements. See the individual fields for the types contained.
18021  */
18022 typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
18023    /**
18024     * The element at position 0
18025     */
18026    struct LDKPublicKey a;
18027    /**
18028     * The element at position 1
18029     */
18030    struct LDKOnionMessage b;
18031    /**
18032     * The element at position 2
18033     */
18034    struct LDKCOption_CVec_SocketAddressZZ c;
18035 } LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
18036
18037 /**
18038  * Errors that may occur when [sending an onion message].
18039  *
18040  * [sending an onion message]: OnionMessenger::send_onion_message
18041  */
18042 typedef enum LDKSendError_Tag {
18043    /**
18044     * Errored computing onion message packet keys.
18045     */
18046    LDKSendError_Secp256k1,
18047    /**
18048     * Because implementations such as Eclair will drop onion messages where the message packet
18049     * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
18050     */
18051    LDKSendError_TooBigPacket,
18052    /**
18053     * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
18054     * hops.
18055     */
18056    LDKSendError_TooFewBlindedHops,
18057    /**
18058     * The first hop is not a peer and doesn't have a known [`SocketAddress`].
18059     */
18060    LDKSendError_InvalidFirstHop,
18061    /**
18062     * A path from the sender to the destination could not be found by the [`MessageRouter`].
18063     */
18064    LDKSendError_PathNotFound,
18065    /**
18066     * Onion message contents must have a TLV type >= 64.
18067     */
18068    LDKSendError_InvalidMessage,
18069    /**
18070     * Our next-hop peer's buffer was full or our total outbound buffer was full.
18071     */
18072    LDKSendError_BufferFull,
18073    /**
18074     * Failed to retrieve our node id from the provided [`NodeSigner`].
18075     *
18076     * [`NodeSigner`]: crate::sign::NodeSigner
18077     */
18078    LDKSendError_GetNodeIdFailed,
18079    /**
18080     * We attempted to send to a blinded path where we are the introduction node, and failed to
18081     * advance the blinded path to make the second hop the new introduction node. Either
18082     * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
18083     * new blinding point, or we were attempting to send to ourselves.
18084     */
18085    LDKSendError_BlindedPathAdvanceFailed,
18086    /**
18087     * Must be last for serialization purposes
18088     */
18089    LDKSendError_Sentinel,
18090 } LDKSendError_Tag;
18091
18092 typedef struct MUST_USE_STRUCT LDKSendError {
18093    LDKSendError_Tag tag;
18094    union {
18095       struct {
18096          enum LDKSecp256k1Error secp256k1;
18097       };
18098       struct {
18099          struct LDKPublicKey invalid_first_hop;
18100       };
18101    };
18102 } LDKSendError;
18103
18104 /**
18105  * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
18106  */
18107 typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
18108    /**
18109     * A pointer to the contents in the success state.
18110     * Reading from this pointer when `result_ok` is not set is undefined.
18111     */
18112    struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
18113    /**
18114     * A pointer to the contents in the error state.
18115     * Reading from this pointer when `result_ok` is set is undefined.
18116     */
18117    struct LDKSendError *err;
18118 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
18119
18120 /**
18121  * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
18122  * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
18123  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18124  */
18125 typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
18126    /**
18127     * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
18128     * `err` or `result` depending on the state of `result_ok`.
18129     */
18130    union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
18131    /**
18132     * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
18133     */
18134    bool result_ok;
18135 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
18136
18137 /**
18138  * The contents of an [`OnionMessage`] as read from the wire.
18139  *
18140  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
18141  */
18142 typedef enum LDKParsedOnionMessageContents_Tag {
18143    /**
18144     * A message related to BOLT 12 Offers.
18145     */
18146    LDKParsedOnionMessageContents_Offers,
18147    /**
18148     * A custom onion message specified by the user.
18149     */
18150    LDKParsedOnionMessageContents_Custom,
18151    /**
18152     * Must be last for serialization purposes
18153     */
18154    LDKParsedOnionMessageContents_Sentinel,
18155 } LDKParsedOnionMessageContents_Tag;
18156
18157 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
18158    LDKParsedOnionMessageContents_Tag tag;
18159    union {
18160       struct {
18161          struct LDKOffersMessage offers;
18162       };
18163       struct {
18164          struct LDKOnionMessageContents custom;
18165       };
18166    };
18167 } LDKParsedOnionMessageContents;
18168
18169 /**
18170  * A processed incoming onion message, containing either a Forward (another onion message)
18171  * or a Receive payload with decrypted contents.
18172  */
18173 typedef enum LDKPeeledOnion_Tag {
18174    /**
18175     * Forwarded onion, with the next node id and a new onion
18176     */
18177    LDKPeeledOnion_Forward,
18178    /**
18179     * Received onion message, with decrypted contents, path_id, and reply path
18180     */
18181    LDKPeeledOnion_Receive,
18182    /**
18183     * Must be last for serialization purposes
18184     */
18185    LDKPeeledOnion_Sentinel,
18186 } LDKPeeledOnion_Tag;
18187
18188 typedef struct LDKPeeledOnion_LDKForward_Body {
18189    struct LDKPublicKey _0;
18190    struct LDKOnionMessage _1;
18191 } LDKPeeledOnion_LDKForward_Body;
18192
18193 typedef struct LDKPeeledOnion_LDKReceive_Body {
18194    struct LDKParsedOnionMessageContents _0;
18195    /**
18196     *
18197     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18198     */
18199    struct LDKThirtyTwoBytes _1;
18200    /**
18201     *
18202     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18203     */
18204    struct LDKBlindedPath _2;
18205 } LDKPeeledOnion_LDKReceive_Body;
18206
18207 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
18208    LDKPeeledOnion_Tag tag;
18209    union {
18210       LDKPeeledOnion_LDKForward_Body forward;
18211       LDKPeeledOnion_LDKReceive_Body receive;
18212    };
18213 } LDKPeeledOnion;
18214
18215 /**
18216  * The contents of CResult_PeeledOnionNoneZ
18217  */
18218 typedef union LDKCResult_PeeledOnionNoneZPtr {
18219    /**
18220     * A pointer to the contents in the success state.
18221     * Reading from this pointer when `result_ok` is not set is undefined.
18222     */
18223    struct LDKPeeledOnion *result;
18224    /**
18225     * Note that this value is always NULL, as there are no contents in the Err variant
18226     */
18227    void *err;
18228 } LDKCResult_PeeledOnionNoneZPtr;
18229
18230 /**
18231  * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
18232  * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
18233  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18234  */
18235 typedef struct LDKCResult_PeeledOnionNoneZ {
18236    /**
18237     * The contents of this CResult_PeeledOnionNoneZ, accessible via either
18238     * `err` or `result` depending on the state of `result_ok`.
18239     */
18240    union LDKCResult_PeeledOnionNoneZPtr contents;
18241    /**
18242     * Whether this CResult_PeeledOnionNoneZ represents a success state.
18243     */
18244    bool result_ok;
18245 } LDKCResult_PeeledOnionNoneZ;
18246
18247 /**
18248  * Result of successfully [sending an onion message].
18249  *
18250  * [sending an onion message]: OnionMessenger::send_onion_message
18251  */
18252 typedef enum LDKSendSuccess_Tag {
18253    /**
18254     * The message was buffered and will be sent once it is processed by
18255     * [`OnionMessageHandler::next_onion_message_for_peer`].
18256     */
18257    LDKSendSuccess_Buffered,
18258    /**
18259     * The message was buffered and will be sent once the node is connected as a peer and it is
18260     * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
18261     */
18262    LDKSendSuccess_BufferedAwaitingConnection,
18263    /**
18264     * Must be last for serialization purposes
18265     */
18266    LDKSendSuccess_Sentinel,
18267 } LDKSendSuccess_Tag;
18268
18269 typedef struct MUST_USE_STRUCT LDKSendSuccess {
18270    LDKSendSuccess_Tag tag;
18271    union {
18272       struct {
18273          struct LDKPublicKey buffered_awaiting_connection;
18274       };
18275    };
18276 } LDKSendSuccess;
18277
18278 /**
18279  * The contents of CResult_SendSuccessSendErrorZ
18280  */
18281 typedef union LDKCResult_SendSuccessSendErrorZPtr {
18282    /**
18283     * A pointer to the contents in the success state.
18284     * Reading from this pointer when `result_ok` is not set is undefined.
18285     */
18286    struct LDKSendSuccess *result;
18287    /**
18288     * A pointer to the contents in the error state.
18289     * Reading from this pointer when `result_ok` is set is undefined.
18290     */
18291    struct LDKSendError *err;
18292 } LDKCResult_SendSuccessSendErrorZPtr;
18293
18294 /**
18295  * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
18296  * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
18297  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18298  */
18299 typedef struct LDKCResult_SendSuccessSendErrorZ {
18300    /**
18301     * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
18302     * `err` or `result` depending on the state of `result_ok`.
18303     */
18304    union LDKCResult_SendSuccessSendErrorZPtr contents;
18305    /**
18306     * Whether this CResult_SendSuccessSendErrorZ represents a success state.
18307     */
18308    bool result_ok;
18309 } LDKCResult_SendSuccessSendErrorZ;
18310
18311 /**
18312  * The contents of CResult_BlindedPathNoneZ
18313  */
18314 typedef union LDKCResult_BlindedPathNoneZPtr {
18315    /**
18316     * A pointer to the contents in the success state.
18317     * Reading from this pointer when `result_ok` is not set is undefined.
18318     */
18319    struct LDKBlindedPath *result;
18320    /**
18321     * Note that this value is always NULL, as there are no contents in the Err variant
18322     */
18323    void *err;
18324 } LDKCResult_BlindedPathNoneZPtr;
18325
18326 /**
18327  * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
18328  * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
18329  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18330  */
18331 typedef struct LDKCResult_BlindedPathNoneZ {
18332    /**
18333     * The contents of this CResult_BlindedPathNoneZ, accessible via either
18334     * `err` or `result` depending on the state of `result_ok`.
18335     */
18336    union LDKCResult_BlindedPathNoneZPtr contents;
18337    /**
18338     * Whether this CResult_BlindedPathNoneZ represents a success state.
18339     */
18340    bool result_ok;
18341 } LDKCResult_BlindedPathNoneZ;
18342
18343 /**
18344  * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
18345  */
18346 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
18347    /**
18348     * A pointer to the contents in the success state.
18349     * Reading from this pointer when `result_ok` is not set is undefined.
18350     */
18351    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
18352    /**
18353     * Note that this value is always NULL, as there are no contents in the Err variant
18354     */
18355    void *err;
18356 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
18357
18358 /**
18359  * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
18360  * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
18361  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18362  */
18363 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
18364    /**
18365     * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
18366     * `err` or `result` depending on the state of `result_ok`.
18367     */
18368    union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
18369    /**
18370     * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
18371     */
18372    bool result_ok;
18373 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
18374
18375
18376
18377 /**
18378  * An intermediate node, its outbound channel, and relay parameters.
18379  */
18380 typedef struct MUST_USE_STRUCT LDKForwardNode {
18381    /**
18382     * A pointer to the opaque Rust object.
18383     * Nearly everywhere, inner must be non-null, however in places where
18384     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18385     */
18386    LDKnativeForwardNode *inner;
18387    /**
18388     * Indicates that this is the only struct which contains the same pointer.
18389     * Rust functions which take ownership of an object provided via an argument require
18390     * this to be true and invalidate the object pointed to by inner.
18391     */
18392    bool is_owned;
18393 } LDKForwardNode;
18394
18395 /**
18396  * A dynamically-allocated array of crate::lightning::blinded_path::payment::ForwardNodes of arbitrary size.
18397  * This corresponds to std::vector in C++
18398  */
18399 typedef struct LDKCVec_ForwardNodeZ {
18400    /**
18401     * The elements in the array.
18402     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
18403     */
18404    struct LDKForwardNode *data;
18405    /**
18406     * The number of elements pointed to by `data`.
18407     */
18408    uintptr_t datalen;
18409 } LDKCVec_ForwardNodeZ;
18410
18411 /**
18412  * The contents of CResult_BlindedPathDecodeErrorZ
18413  */
18414 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
18415    /**
18416     * A pointer to the contents in the success state.
18417     * Reading from this pointer when `result_ok` is not set is undefined.
18418     */
18419    struct LDKBlindedPath *result;
18420    /**
18421     * A pointer to the contents in the error state.
18422     * Reading from this pointer when `result_ok` is set is undefined.
18423     */
18424    struct LDKDecodeError *err;
18425 } LDKCResult_BlindedPathDecodeErrorZPtr;
18426
18427 /**
18428  * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
18429  * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
18430  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18431  */
18432 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
18433    /**
18434     * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
18435     * `err` or `result` depending on the state of `result_ok`.
18436     */
18437    union LDKCResult_BlindedPathDecodeErrorZPtr contents;
18438    /**
18439     * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
18440     */
18441    bool result_ok;
18442 } LDKCResult_BlindedPathDecodeErrorZ;
18443
18444 /**
18445  * The contents of CResult_BlindedHopDecodeErrorZ
18446  */
18447 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
18448    /**
18449     * A pointer to the contents in the success state.
18450     * Reading from this pointer when `result_ok` is not set is undefined.
18451     */
18452    struct LDKBlindedHop *result;
18453    /**
18454     * A pointer to the contents in the error state.
18455     * Reading from this pointer when `result_ok` is set is undefined.
18456     */
18457    struct LDKDecodeError *err;
18458 } LDKCResult_BlindedHopDecodeErrorZPtr;
18459
18460 /**
18461  * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
18462  * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
18463  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18464  */
18465 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
18466    /**
18467     * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
18468     * `err` or `result` depending on the state of `result_ok`.
18469     */
18470    union LDKCResult_BlindedHopDecodeErrorZPtr contents;
18471    /**
18472     * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
18473     */
18474    bool result_ok;
18475 } LDKCResult_BlindedHopDecodeErrorZ;
18476
18477 /**
18478  * The contents of CResult_InvoiceErrorDecodeErrorZ
18479  */
18480 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
18481    /**
18482     * A pointer to the contents in the success state.
18483     * Reading from this pointer when `result_ok` is not set is undefined.
18484     */
18485    struct LDKInvoiceError *result;
18486    /**
18487     * A pointer to the contents in the error state.
18488     * Reading from this pointer when `result_ok` is set is undefined.
18489     */
18490    struct LDKDecodeError *err;
18491 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
18492
18493 /**
18494  * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
18495  * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
18496  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18497  */
18498 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
18499    /**
18500     * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
18501     * `err` or `result` depending on the state of `result_ok`.
18502     */
18503    union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
18504    /**
18505     * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
18506     */
18507    bool result_ok;
18508 } LDKCResult_InvoiceErrorDecodeErrorZ;
18509
18510
18511
18512 /**
18513  * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
18514  *
18515  * The delayed payment key is used to pay the commitment state broadcaster their
18516  * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
18517  * state broadcasted was previously revoked.
18518  */
18519 typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
18520    /**
18521     * A pointer to the opaque Rust object.
18522     * Nearly everywhere, inner must be non-null, however in places where
18523     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18524     */
18525    LDKnativeDelayedPaymentBasepoint *inner;
18526    /**
18527     * Indicates that this is the only struct which contains the same pointer.
18528     * Rust functions which take ownership of an object provided via an argument require
18529     * this to be true and invalidate the object pointed to by inner.
18530     */
18531    bool is_owned;
18532 } LDKDelayedPaymentBasepoint;
18533
18534 /**
18535  * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
18536  */
18537 typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
18538    /**
18539     * A pointer to the contents in the success state.
18540     * Reading from this pointer when `result_ok` is not set is undefined.
18541     */
18542    struct LDKDelayedPaymentBasepoint *result;
18543    /**
18544     * A pointer to the contents in the error state.
18545     * Reading from this pointer when `result_ok` is set is undefined.
18546     */
18547    struct LDKDecodeError *err;
18548 } LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
18549
18550 /**
18551  * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
18552  * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
18553  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18554  */
18555 typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
18556    /**
18557     * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
18558     * `err` or `result` depending on the state of `result_ok`.
18559     */
18560    union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
18561    /**
18562     * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
18563     */
18564    bool result_ok;
18565 } LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
18566
18567
18568
18569 /**
18570  * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
18571  *
18572  * The delayed payment key is used to pay the commitment state broadcaster their
18573  * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
18574  * punish and claim all the channel funds if the state broadcasted was previously revoked.
18575  *
18576  * [See the BOLT specs]
18577  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
18578  * for more information on key derivation details.
18579  */
18580 typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
18581    /**
18582     * A pointer to the opaque Rust object.
18583     * Nearly everywhere, inner must be non-null, however in places where
18584     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18585     */
18586    LDKnativeDelayedPaymentKey *inner;
18587    /**
18588     * Indicates that this is the only struct which contains the same pointer.
18589     * Rust functions which take ownership of an object provided via an argument require
18590     * this to be true and invalidate the object pointed to by inner.
18591     */
18592    bool is_owned;
18593 } LDKDelayedPaymentKey;
18594
18595 /**
18596  * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
18597  */
18598 typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
18599    /**
18600     * A pointer to the contents in the success state.
18601     * Reading from this pointer when `result_ok` is not set is undefined.
18602     */
18603    struct LDKDelayedPaymentKey *result;
18604    /**
18605     * A pointer to the contents in the error state.
18606     * Reading from this pointer when `result_ok` is set is undefined.
18607     */
18608    struct LDKDecodeError *err;
18609 } LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
18610
18611 /**
18612  * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
18613  * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
18614  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18615  */
18616 typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
18617    /**
18618     * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
18619     * `err` or `result` depending on the state of `result_ok`.
18620     */
18621    union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
18622    /**
18623     * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
18624     */
18625    bool result_ok;
18626 } LDKCResult_DelayedPaymentKeyDecodeErrorZ;
18627
18628
18629
18630 /**
18631  * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
18632  *
18633  * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
18634  * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
18635  * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
18636  */
18637 typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
18638    /**
18639     * A pointer to the opaque Rust object.
18640     * Nearly everywhere, inner must be non-null, however in places where
18641     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18642     */
18643    LDKnativeHtlcBasepoint *inner;
18644    /**
18645     * Indicates that this is the only struct which contains the same pointer.
18646     * Rust functions which take ownership of an object provided via an argument require
18647     * this to be true and invalidate the object pointed to by inner.
18648     */
18649    bool is_owned;
18650 } LDKHtlcBasepoint;
18651
18652 /**
18653  * The contents of CResult_HtlcBasepointDecodeErrorZ
18654  */
18655 typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
18656    /**
18657     * A pointer to the contents in the success state.
18658     * Reading from this pointer when `result_ok` is not set is undefined.
18659     */
18660    struct LDKHtlcBasepoint *result;
18661    /**
18662     * A pointer to the contents in the error state.
18663     * Reading from this pointer when `result_ok` is set is undefined.
18664     */
18665    struct LDKDecodeError *err;
18666 } LDKCResult_HtlcBasepointDecodeErrorZPtr;
18667
18668 /**
18669  * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
18670  * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
18671  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18672  */
18673 typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
18674    /**
18675     * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
18676     * `err` or `result` depending on the state of `result_ok`.
18677     */
18678    union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
18679    /**
18680     * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
18681     */
18682    bool result_ok;
18683 } LDKCResult_HtlcBasepointDecodeErrorZ;
18684
18685
18686
18687 /**
18688  * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
18689  *
18690  * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
18691  * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
18692  * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
18693  *
18694  * [See the BOLT specs]
18695  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
18696  * for more information on key derivation details.
18697  */
18698 typedef struct MUST_USE_STRUCT LDKHtlcKey {
18699    /**
18700     * A pointer to the opaque Rust object.
18701     * Nearly everywhere, inner must be non-null, however in places where
18702     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18703     */
18704    LDKnativeHtlcKey *inner;
18705    /**
18706     * Indicates that this is the only struct which contains the same pointer.
18707     * Rust functions which take ownership of an object provided via an argument require
18708     * this to be true and invalidate the object pointed to by inner.
18709     */
18710    bool is_owned;
18711 } LDKHtlcKey;
18712
18713 /**
18714  * The contents of CResult_HtlcKeyDecodeErrorZ
18715  */
18716 typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
18717    /**
18718     * A pointer to the contents in the success state.
18719     * Reading from this pointer when `result_ok` is not set is undefined.
18720     */
18721    struct LDKHtlcKey *result;
18722    /**
18723     * A pointer to the contents in the error state.
18724     * Reading from this pointer when `result_ok` is set is undefined.
18725     */
18726    struct LDKDecodeError *err;
18727 } LDKCResult_HtlcKeyDecodeErrorZPtr;
18728
18729 /**
18730  * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
18731  * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
18732  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18733  */
18734 typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
18735    /**
18736     * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
18737     * `err` or `result` depending on the state of `result_ok`.
18738     */
18739    union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
18740    /**
18741     * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
18742     */
18743    bool result_ok;
18744 } LDKCResult_HtlcKeyDecodeErrorZ;
18745
18746
18747
18748 /**
18749  * Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
18750  * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
18751  */
18752 typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
18753    /**
18754     * A pointer to the opaque Rust object.
18755     * Nearly everywhere, inner must be non-null, however in places where
18756     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18757     */
18758    LDKnativeRevocationBasepoint *inner;
18759    /**
18760     * Indicates that this is the only struct which contains the same pointer.
18761     * Rust functions which take ownership of an object provided via an argument require
18762     * this to be true and invalidate the object pointed to by inner.
18763     */
18764    bool is_owned;
18765 } LDKRevocationBasepoint;
18766
18767 /**
18768  * The contents of CResult_RevocationBasepointDecodeErrorZ
18769  */
18770 typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
18771    /**
18772     * A pointer to the contents in the success state.
18773     * Reading from this pointer when `result_ok` is not set is undefined.
18774     */
18775    struct LDKRevocationBasepoint *result;
18776    /**
18777     * A pointer to the contents in the error state.
18778     * Reading from this pointer when `result_ok` is set is undefined.
18779     */
18780    struct LDKDecodeError *err;
18781 } LDKCResult_RevocationBasepointDecodeErrorZPtr;
18782
18783 /**
18784  * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
18785  * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
18786  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18787  */
18788 typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
18789    /**
18790     * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
18791     * `err` or `result` depending on the state of `result_ok`.
18792     */
18793    union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
18794    /**
18795     * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
18796     */
18797    bool result_ok;
18798 } LDKCResult_RevocationBasepointDecodeErrorZ;
18799
18800
18801
18802 /**
18803  * The revocation key is used to allow a channel party to revoke their state - giving their
18804  * counterparty the required material to claim all of their funds if they broadcast that state.
18805  *
18806  * Each commitment transaction has a revocation key based on the basepoint and
18807  * per_commitment_point which is used in both commitment and HTLC transactions.
18808  *
18809  * See [the BOLT spec for derivation details]
18810  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
18811  */
18812 typedef struct MUST_USE_STRUCT LDKRevocationKey {
18813    /**
18814     * A pointer to the opaque Rust object.
18815     * Nearly everywhere, inner must be non-null, however in places where
18816     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18817     */
18818    LDKnativeRevocationKey *inner;
18819    /**
18820     * Indicates that this is the only struct which contains the same pointer.
18821     * Rust functions which take ownership of an object provided via an argument require
18822     * this to be true and invalidate the object pointed to by inner.
18823     */
18824    bool is_owned;
18825 } LDKRevocationKey;
18826
18827 /**
18828  * The contents of CResult_RevocationKeyDecodeErrorZ
18829  */
18830 typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
18831    /**
18832     * A pointer to the contents in the success state.
18833     * Reading from this pointer when `result_ok` is not set is undefined.
18834     */
18835    struct LDKRevocationKey *result;
18836    /**
18837     * A pointer to the contents in the error state.
18838     * Reading from this pointer when `result_ok` is set is undefined.
18839     */
18840    struct LDKDecodeError *err;
18841 } LDKCResult_RevocationKeyDecodeErrorZPtr;
18842
18843 /**
18844  * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
18845  * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
18846  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18847  */
18848 typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
18849    /**
18850     * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
18851     * `err` or `result` depending on the state of `result_ok`.
18852     */
18853    union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
18854    /**
18855     * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
18856     */
18857    bool result_ok;
18858 } LDKCResult_RevocationKeyDecodeErrorZ;
18859
18860
18861
18862 /**
18863  * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
18864  *
18865  * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
18866  * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
18867  * [`Confirm::transactions_confirmed`].
18868  *
18869  * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
18870  * may have been spent there. See [`Filter::register_output`] for details.
18871  *
18872  * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
18873  * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
18874  */
18875 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
18876    /**
18877     * A pointer to the opaque Rust object.
18878     * Nearly everywhere, inner must be non-null, however in places where
18879     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18880     */
18881    LDKnativeWatchedOutput *inner;
18882    /**
18883     * Indicates that this is the only struct which contains the same pointer.
18884     * Rust functions which take ownership of an object provided via an argument require
18885     * this to be true and invalidate the object pointed to by inner.
18886     */
18887    bool is_owned;
18888 } LDKWatchedOutput;
18889
18890 /**
18891  * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
18892  * channels.
18893  *
18894  * This is useful in order to have a [`Watch`] implementation convey to a chain source which
18895  * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
18896  * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
18897  * receiving full blocks from a chain source, any further filtering is unnecessary.
18898  *
18899  * After an output has been registered, subsequent block retrievals from the chain source must not
18900  * exclude any transactions matching the new criteria nor any in-block descendants of such
18901  * transactions.
18902  *
18903  * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
18904  * should not block on I/O. Implementations should instead queue the newly monitored data to be
18905  * processed later. Then, in order to block until the data has been processed, any [`Watch`]
18906  * invocation that has called the `Filter` must return [`InProgress`].
18907  *
18908  * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
18909  * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
18910  * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
18911  */
18912 typedef struct LDKFilter {
18913    /**
18914     * An opaque pointer which is passed to your function implementations as an argument.
18915     * This has no meaning in the LDK, and can be NULL or any other value.
18916     */
18917    void *this_arg;
18918    /**
18919     * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
18920     * a spending condition.
18921     */
18922    void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
18923    /**
18924     * Registers interest in spends of a transaction output.
18925     *
18926     * Note that this method might be called during processing of a new block. You therefore need
18927     * to ensure that also dependent output spents within an already connected block are correctly
18928     * handled, e.g., by re-scanning the block in question whenever new outputs have been
18929     * registered mid-processing.
18930     */
18931    void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
18932    /**
18933     * Frees any resources associated with this object given its this_arg pointer.
18934     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18935     */
18936    void (*free)(void *this_arg);
18937 } LDKFilter;
18938
18939 /**
18940  * An enum which can either contain a crate::lightning::chain::Filter or not
18941  */
18942 typedef enum LDKCOption_FilterZ_Tag {
18943    /**
18944     * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
18945     */
18946    LDKCOption_FilterZ_Some,
18947    /**
18948     * When we're in this state, this COption_FilterZ contains nothing
18949     */
18950    LDKCOption_FilterZ_None,
18951    /**
18952     * Must be last for serialization purposes
18953     */
18954    LDKCOption_FilterZ_Sentinel,
18955 } LDKCOption_FilterZ_Tag;
18956
18957 typedef struct LDKCOption_FilterZ {
18958    LDKCOption_FilterZ_Tag tag;
18959    union {
18960       struct {
18961          struct LDKFilter some;
18962       };
18963    };
18964 } LDKCOption_FilterZ;
18965
18966
18967
18968 /**
18969  * A read-only reference to a current ChannelMonitor.
18970  *
18971  * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
18972  * released.
18973  */
18974 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
18975    /**
18976     * A pointer to the opaque Rust object.
18977     * Nearly everywhere, inner must be non-null, however in places where
18978     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18979     */
18980    LDKnativeLockedChannelMonitor *inner;
18981    /**
18982     * Indicates that this is the only struct which contains the same pointer.
18983     * Rust functions which take ownership of an object provided via an argument require
18984     * this to be true and invalidate the object pointed to by inner.
18985     */
18986    bool is_owned;
18987 } LDKLockedChannelMonitor;
18988
18989 /**
18990  * The contents of CResult_LockedChannelMonitorNoneZ
18991  */
18992 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
18993    /**
18994     * A pointer to the contents in the success state.
18995     * Reading from this pointer when `result_ok` is not set is undefined.
18996     */
18997    struct LDKLockedChannelMonitor *result;
18998    /**
18999     * Note that this value is always NULL, as there are no contents in the Err variant
19000     */
19001    void *err;
19002 } LDKCResult_LockedChannelMonitorNoneZPtr;
19003
19004 /**
19005  * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
19006  * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
19007  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19008  */
19009 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
19010    /**
19011     * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
19012     * `err` or `result` depending on the state of `result_ok`.
19013     */
19014    union LDKCResult_LockedChannelMonitorNoneZPtr contents;
19015    /**
19016     * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
19017     */
19018    bool result_ok;
19019 } LDKCResult_LockedChannelMonitorNoneZ;
19020
19021 /**
19022  * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
19023  * This corresponds to std::vector in C++
19024  */
19025 typedef struct LDKCVec_OutPointZ {
19026    /**
19027     * The elements in the array.
19028     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19029     */
19030    struct LDKOutPoint *data;
19031    /**
19032     * The number of elements pointed to by `data`.
19033     */
19034    uintptr_t datalen;
19035 } LDKCVec_OutPointZ;
19036
19037
19038
19039 /**
19040  * An opaque identifier describing a specific [`Persist`] method call.
19041  */
19042 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
19043    /**
19044     * A pointer to the opaque Rust object.
19045     * Nearly everywhere, inner must be non-null, however in places where
19046     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19047     */
19048    LDKnativeMonitorUpdateId *inner;
19049    /**
19050     * Indicates that this is the only struct which contains the same pointer.
19051     * Rust functions which take ownership of an object provided via an argument require
19052     * this to be true and invalidate the object pointed to by inner.
19053     */
19054    bool is_owned;
19055 } LDKMonitorUpdateId;
19056
19057 /**
19058  * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
19059  * This corresponds to std::vector in C++
19060  */
19061 typedef struct LDKCVec_MonitorUpdateIdZ {
19062    /**
19063     * The elements in the array.
19064     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19065     */
19066    struct LDKMonitorUpdateId *data;
19067    /**
19068     * The number of elements pointed to by `data`.
19069     */
19070    uintptr_t datalen;
19071 } LDKCVec_MonitorUpdateIdZ;
19072
19073 /**
19074  * A tuple of 2 elements. See the individual fields for the types contained.
19075  */
19076 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
19077    /**
19078     * The element at position 0
19079     */
19080    struct LDKOutPoint a;
19081    /**
19082     * The element at position 1
19083     */
19084    struct LDKCVec_MonitorUpdateIdZ b;
19085 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
19086
19087 /**
19088  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
19089  * This corresponds to std::vector in C++
19090  */
19091 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
19092    /**
19093     * The elements in the array.
19094     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19095     */
19096    struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
19097    /**
19098     * The number of elements pointed to by `data`.
19099     */
19100    uintptr_t datalen;
19101 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
19102
19103 /**
19104  * Provides an interface that allows storage and retrieval of persisted values that are associated
19105  * with given keys.
19106  *
19107  * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
19108  * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
19109  * ways, as long as per-namespace key uniqueness is asserted.
19110  *
19111  * Keys and namespaces are required to be valid ASCII strings in the range of
19112  * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
19113  * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
19114  * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
19115  * that concerns should always be separated by primary namespace first, before secondary
19116  * namespaces are used. While the number of primary namespaces will be relatively small and is
19117  * determined at compile time, there may be many secondary namespaces per primary namespace. Note
19118  * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
19119  * namespace, i.e., conflicts between keys and equally named
19120  * primary namespaces/secondary namespaces must be avoided.
19121  *
19122  * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
19123  * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
19124  * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
19125  */
19126 typedef struct LDKKVStore {
19127    /**
19128     * An opaque pointer which is passed to your function implementations as an argument.
19129     * This has no meaning in the LDK, and can be NULL or any other value.
19130     */
19131    void *this_arg;
19132    /**
19133     * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
19134     * `key`.
19135     *
19136     * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
19137     * `primary_namespace` and `secondary_namespace`.
19138     *
19139     * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
19140     */
19141    struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
19142    /**
19143     * Persists the given data under the given `key`.
19144     *
19145     * Will create the given `primary_namespace` and `secondary_namespace` if not already present
19146     * in the store.
19147     */
19148    struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
19149    /**
19150     * Removes any data that had previously been persisted under the given `key`.
19151     *
19152     * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
19153     * remove the given `key` at some point in time after the method returns, e.g., as part of an
19154     * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
19155     * [`KVStore::list`] might include the removed key until the changes are actually persisted.
19156     *
19157     * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
19158     * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
19159     * potentially get lost on crash after the method returns. Therefore, this flag should only be
19160     * set for `remove` operations that can be safely replayed at a later time.
19161     *
19162     * Returns successfully if no data will be stored for the given `primary_namespace`,
19163     * `secondary_namespace`, and `key`, independently of whether it was present before its
19164     * invokation or not.
19165     */
19166    struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
19167    /**
19168     * Returns a list of keys that are stored under the given `secondary_namespace` in
19169     * `primary_namespace`.
19170     *
19171     * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
19172     * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
19173     */
19174    struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
19175    /**
19176     * Frees any resources associated with this object given its this_arg pointer.
19177     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19178     */
19179    void (*free)(void *this_arg);
19180 } LDKKVStore;
19181
19182 /**
19183  * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
19184  */
19185 typedef struct LDKPersister {
19186    /**
19187     * An opaque pointer which is passed to your function implementations as an argument.
19188     * This has no meaning in the LDK, and can be NULL or any other value.
19189     */
19190    void *this_arg;
19191    /**
19192     * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
19193     */
19194    struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
19195    /**
19196     * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
19197     */
19198    struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
19199    /**
19200     * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
19201     */
19202    struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
19203    /**
19204     * Frees any resources associated with this object given its this_arg pointer.
19205     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19206     */
19207    void (*free)(void *this_arg);
19208 } LDKPersister;
19209
19210
19211
19212 /**
19213  * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
19214  * [`ChannelMonitorUpdate`]s.
19215  *
19216  * # Overview
19217  *
19218  * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
19219  * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
19220  * deleting) and complexity. This is because it writes channel monitor differential updates,
19221  * whereas the other (default) implementation rewrites the entire monitor on each update. For
19222  * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
19223  * of megabytes (or more). Updates can be as small as a few hundred bytes.
19224  *
19225  * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
19226  * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
19227  * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
19228  * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
19229  * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
19230  * sentinel bytes.
19231  *
19232  * # Storing monitors
19233  *
19234  * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
19235  *
19236  *   - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
19237  *   - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
19238  *
19239  * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
19240  * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
19241  *
19242  * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
19243  *
19244  *   - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
19245  *   - secondary namespace: [the monitor's encoded outpoint name]
19246  *
19247  * Under that secondary namespace, each update is stored with a number string, like `21`, which
19248  * represents its `update_id` value.
19249  *
19250  * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
19251  *
19252  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
19253  *   - Index: `1`
19254  *
19255  * Full channel monitors would be stored at a single key:
19256  *
19257  * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
19258  *
19259  * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
19260  *
19261  * ```text
19262  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
19263  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
19264  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
19265  * ```
19266  * ... and so on.
19267  *
19268  * # Reading channel state from storage
19269  *
19270  * Channel state can be reconstructed by calling
19271  * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
19272  * list channel monitors themselves and load channels individually using
19273  * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
19274  *
19275  * ## EXTREMELY IMPORTANT
19276  *
19277  * It is extremely important that your [`KVStore::read`] implementation uses the
19278  * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
19279  * that circumstance (not when there is really a permissions error, for example). This is because
19280  * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
19281  * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
19282  * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
19283  *
19284  * # Pruning stale channel updates
19285  *
19286  * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
19287  * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
19288  * are deleted.
19289  * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
19290  * will complete. However, stale updates are not a problem for data integrity, since updates are
19291  * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
19292  *
19293  * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
19294  * would like to get rid of them, consider using the
19295  * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
19296  */
19297 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
19298    /**
19299     * A pointer to the opaque Rust object.
19300     * Nearly everywhere, inner must be non-null, however in places where
19301     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19302     */
19303    LDKnativeMonitorUpdatingPersister *inner;
19304    /**
19305     * Indicates that this is the only struct which contains the same pointer.
19306     * Rust functions which take ownership of an object provided via an argument require
19307     * this to be true and invalidate the object pointed to by inner.
19308     */
19309    bool is_owned;
19310 } LDKMonitorUpdatingPersister;
19311
19312 /**
19313  * `Persist` defines behavior for persisting channel monitors: this could mean
19314  * writing once to disk, and/or uploading to one or more backup services.
19315  *
19316  * Persistence can happen in one of two ways - synchronously completing before the trait method
19317  * calls return or asynchronously in the background.
19318  *
19319  * # For those implementing synchronous persistence
19320  *
19321  *  * If persistence completes fully (including any relevant `fsync()` calls), the implementation
19322  *    should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
19323  *    should continue.
19324  *
19325  *  * If persistence fails for some reason, implementations should consider returning
19326  *    [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
19327  *    the background with [`ChainMonitor::list_pending_monitor_updates`] and
19328  *    [`ChainMonitor::get_monitor`].
19329  *
19330  *    Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
19331  *    be marked as complete via [`ChainMonitor::channel_monitor_updated`].
19332  *
19333  *    If at some point no further progress can be made towards persisting the pending updates, the
19334  *    node should simply shut down.
19335  *
19336  *  * If the persistence has failed and cannot be retried further (e.g. because of an outage),
19337  *    [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
19338  *    an immediate panic and future operations in LDK generally failing.
19339  *
19340  * # For those implementing asynchronous persistence
19341  *
19342  *  All calls should generally spawn a background task and immediately return
19343  *  [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
19344  *  [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
19345  *  [`MonitorUpdateId`].
19346  *
19347  *  Note that unlike the direct [`chain::Watch`] interface,
19348  *  [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
19349  *
19350  *  If at some point no further progress can be made towards persisting a pending update, the node
19351  *  should simply shut down. Until then, the background task should either loop indefinitely, or
19352  *  persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
19353  *  and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
19354  *  monitor updates may be marked completed).
19355  *
19356  * # Using remote watchtowers
19357  *
19358  * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
19359  * update process described above while the watchtower is being updated. The following methods are
19360  * provided for bulding transactions for a watchtower:
19361  * [`ChannelMonitor::initial_counterparty_commitment_tx`],
19362  * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
19363  * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
19364  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
19365  *
19366  * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
19367  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
19368  */
19369 typedef struct LDKPersist {
19370    /**
19371     * An opaque pointer which is passed to your function implementations as an argument.
19372     * This has no meaning in the LDK, and can be NULL or any other value.
19373     */
19374    void *this_arg;
19375    /**
19376     * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
19377     * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
19378     *
19379     * The data can be stored any way you want, but the identifier provided by LDK is the
19380     * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
19381     * and the stored channel data). Note that you **must** persist every new monitor to disk.
19382     *
19383     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
19384     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
19385     *
19386     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
19387     * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
19388     *
19389     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19390     * [`Writeable::write`]: crate::util::ser::Writeable::write
19391     */
19392    enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
19393    /**
19394     * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
19395     * update.
19396     *
19397     * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
19398     * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
19399     * details.
19400     *
19401     * During blockchain synchronization operations, and in some rare cases, this may be called with
19402     * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
19403     * Note that after the full [`ChannelMonitor`] is persisted any previous
19404     * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
19405     * applied to the persisted [`ChannelMonitor`] as they were already applied.
19406     *
19407     * If an implementer chooses to persist the updates only, they need to make
19408     * sure that all the updates are applied to the `ChannelMonitors` *before*
19409     * the set of channel monitors is given to the `ChannelManager`
19410     * deserialization routine. See [`ChannelMonitor::update_monitor`] for
19411     * applying a monitor update to a monitor. If full `ChannelMonitors` are
19412     * persisted, then there is no need to persist individual updates.
19413     *
19414     * Note that there could be a performance tradeoff between persisting complete
19415     * channel monitors on every update vs. persisting only updates and applying
19416     * them in batches. The size of each monitor grows `O(number of state updates)`
19417     * whereas updates are small and `O(1)`.
19418     *
19419     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
19420     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
19421     *
19422     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
19423     * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
19424     * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
19425     *
19426     * [`Writeable::write`]: crate::util::ser::Writeable::write
19427     *
19428     * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
19429     */
19430    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);
19431    /**
19432     * Frees any resources associated with this object given its this_arg pointer.
19433     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19434     */
19435    void (*free)(void *this_arg);
19436 } LDKPersist;
19437
19438
19439
19440 /**
19441  * A string that displays only printable characters, replacing control characters with
19442  * [`core::char::REPLACEMENT_CHARACTER`].
19443  */
19444 typedef struct MUST_USE_STRUCT LDKPrintableString {
19445    /**
19446     * A pointer to the opaque Rust object.
19447     * Nearly everywhere, inner must be non-null, however in places where
19448     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19449     */
19450    LDKnativePrintableString *inner;
19451    /**
19452     * Indicates that this is the only struct which contains the same pointer.
19453     * Rust functions which take ownership of an object provided via an argument require
19454     * this to be true and invalidate the object pointed to by inner.
19455     */
19456    bool is_owned;
19457 } LDKPrintableString;
19458
19459 /**
19460  * A callback which is called when a [`Future`] completes.
19461  *
19462  * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
19463  * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
19464  * instead.
19465  *
19466  * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
19467  * futures when they receive a wake, rather than immediately executing them.
19468  */
19469 typedef struct LDKFutureCallback {
19470    /**
19471     * An opaque pointer which is passed to your function implementations as an argument.
19472     * This has no meaning in the LDK, and can be NULL or any other value.
19473     */
19474    void *this_arg;
19475    /**
19476     * The method which is called.
19477     */
19478    void (*call)(const void *this_arg);
19479    /**
19480     * Frees any resources associated with this object given its this_arg pointer.
19481     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19482     */
19483    void (*free)(void *this_arg);
19484 } LDKFutureCallback;
19485
19486
19487
19488 /**
19489  * A struct which can be used to select across many [`Future`]s at once without relying on a full
19490  * async context.
19491  */
19492 typedef struct MUST_USE_STRUCT LDKSleeper {
19493    /**
19494     * A pointer to the opaque Rust object.
19495     * Nearly everywhere, inner must be non-null, however in places where
19496     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19497     */
19498    LDKnativeSleeper *inner;
19499    /**
19500     * Indicates that this is the only struct which contains the same pointer.
19501     * Rust functions which take ownership of an object provided via an argument require
19502     * this to be true and invalidate the object pointed to by inner.
19503     */
19504    bool is_owned;
19505 } LDKSleeper;
19506
19507
19508
19509 /**
19510  * Configuration we set when applicable.
19511  *
19512  * Default::default() provides sane defaults.
19513  */
19514 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
19515    /**
19516     * A pointer to the opaque Rust object.
19517     * Nearly everywhere, inner must be non-null, however in places where
19518     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19519     */
19520    LDKnativeChannelHandshakeConfig *inner;
19521    /**
19522     * Indicates that this is the only struct which contains the same pointer.
19523     * Rust functions which take ownership of an object provided via an argument require
19524     * this to be true and invalidate the object pointed to by inner.
19525     */
19526    bool is_owned;
19527 } LDKChannelHandshakeConfig;
19528
19529
19530
19531 /**
19532  * Optional channel limits which are applied during channel creation.
19533  *
19534  * These limits are only applied to our counterparty's limits, not our own.
19535  *
19536  * Use 0/`<type>::max_value()` as appropriate to skip checking.
19537  *
19538  * Provides sane defaults for most configurations.
19539  *
19540  * Most additional limits are disabled except those with which specify a default in individual
19541  * field documentation. Note that this may result in barely-usable channels, but since they
19542  * are applied mostly only to incoming channels that's not much of a problem.
19543  */
19544 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
19545    /**
19546     * A pointer to the opaque Rust object.
19547     * Nearly everywhere, inner must be non-null, however in places where
19548     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19549     */
19550    LDKnativeChannelHandshakeLimits *inner;
19551    /**
19552     * Indicates that this is the only struct which contains the same pointer.
19553     * Rust functions which take ownership of an object provided via an argument require
19554     * this to be true and invalidate the object pointed to by inner.
19555     */
19556    bool is_owned;
19557 } LDKChannelHandshakeLimits;
19558
19559
19560
19561 /**
19562  * A parallel struct to [`ChannelConfig`] to define partial updates.
19563  */
19564 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
19565    /**
19566     * A pointer to the opaque Rust object.
19567     * Nearly everywhere, inner must be non-null, however in places where
19568     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19569     */
19570    LDKnativeChannelConfigUpdate *inner;
19571    /**
19572     * Indicates that this is the only struct which contains the same pointer.
19573     * Rust functions which take ownership of an object provided via an argument require
19574     * this to be true and invalidate the object pointed to by inner.
19575     */
19576    bool is_owned;
19577 } LDKChannelConfigUpdate;
19578
19579
19580
19581 /**
19582  * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
19583  *
19584  * Default::default() provides sane defaults for most configurations
19585  * (but currently with 0 relay fees!)
19586  */
19587 typedef struct MUST_USE_STRUCT LDKUserConfig {
19588    /**
19589     * A pointer to the opaque Rust object.
19590     * Nearly everywhere, inner must be non-null, however in places where
19591     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19592     */
19593    LDKnativeUserConfig *inner;
19594    /**
19595     * Indicates that this is the only struct which contains the same pointer.
19596     * Rust functions which take ownership of an object provided via an argument require
19597     * this to be true and invalidate the object pointed to by inner.
19598     */
19599    bool is_owned;
19600 } LDKUserConfig;
19601
19602
19603
19604 /**
19605  * The best known block as identified by its hash and height.
19606  */
19607 typedef struct MUST_USE_STRUCT LDKBestBlock {
19608    /**
19609     * A pointer to the opaque Rust object.
19610     * Nearly everywhere, inner must be non-null, however in places where
19611     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19612     */
19613    LDKnativeBestBlock *inner;
19614    /**
19615     * Indicates that this is the only struct which contains the same pointer.
19616     * Rust functions which take ownership of an object provided via an argument require
19617     * this to be true and invalidate the object pointed to by inner.
19618     */
19619    bool is_owned;
19620 } LDKBestBlock;
19621
19622 /**
19623  * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
19624  * chain.
19625  *
19626  * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
19627  * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
19628  * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
19629  * when needed.
19630  *
19631  * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
19632  * entire header chain and only blocks with matching transaction data using BIP 157 filters or
19633  * other similar filtering.
19634  */
19635 typedef struct LDKListen {
19636    /**
19637     * An opaque pointer which is passed to your function implementations as an argument.
19638     * This has no meaning in the LDK, and can be NULL or any other value.
19639     */
19640    void *this_arg;
19641    /**
19642     * Notifies the listener that a block was added at the given height, with the transaction data
19643     * possibly filtered.
19644     */
19645    void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
19646    /**
19647     * Notifies the listener that a block was added at the given height.
19648     */
19649    void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
19650    /**
19651     * Notifies the listener that a block was removed at the given height.
19652     */
19653    void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
19654    /**
19655     * Frees any resources associated with this object given its this_arg pointer.
19656     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19657     */
19658    void (*free)(void *this_arg);
19659 } LDKListen;
19660
19661 /**
19662  * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
19663  * chain or unconfirmed during a chain reorganization.
19664  *
19665  * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
19666  * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
19667  * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
19668  * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
19669  * with reference to the confirmation status of the monitored objects.
19670  *
19671  * # Use
19672  * The intended use is as follows:
19673  * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
19674  *   outputs are, respectively, confirmed or spent on chain.
19675  * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
19676  *   [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
19677  * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
19678  *
19679  * # Order
19680  *
19681  * Clients must call these methods in chain order. Specifically:
19682  * - Transactions which are confirmed in a particular block must be given before transactions
19683  *   confirmed in a later block.
19684  * - Dependent transactions within the same block must be given in topological order, possibly in
19685  *   separate calls.
19686  * - All unconfirmed transactions must be given after the original confirmations and before *any*
19687  *   reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
19688  *   never be interleaved, but always conduced *en bloc*.
19689  * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
19690  *   in regard to the new block.
19691  *
19692  * See individual method documentation for further details.
19693  *
19694  * [`transactions_confirmed`]: Self::transactions_confirmed
19695  * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
19696  * [`best_block_updated`]: Self::best_block_updated
19697  * [`get_relevant_txids`]: Self::get_relevant_txids
19698  */
19699 typedef struct LDKConfirm {
19700    /**
19701     * An opaque pointer which is passed to your function implementations as an argument.
19702     * This has no meaning in the LDK, and can be NULL or any other value.
19703     */
19704    void *this_arg;
19705    /**
19706     * Notifies LDK of transactions confirmed in a block with a given header and height.
19707     *
19708     * Must be called for any transactions registered by [`Filter::register_tx`] or any
19709     * transactions spending an output registered by [`Filter::register_output`]. Such transactions
19710     * appearing in the same block do not need to be included in the same call; instead, multiple
19711     * calls with additional transactions may be made so long as they are made in [chain order].
19712     *
19713     * May be called before or after [`best_block_updated`] for the corresponding block. However,
19714     * in the event of a chain reorganization, it must not be called with a `header` that is no
19715     * longer in the chain as of the last call to [`best_block_updated`].
19716     *
19717     * [chain order]: Confirm#order
19718     * [`best_block_updated`]: Self::best_block_updated
19719     */
19720    void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
19721    /**
19722     * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
19723     *
19724     * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
19725     * reorganized out of the best chain or if it is no longer confirmed in the block with the
19726     * given block hash. Once called, the given transaction will not be returned
19727     * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
19728     *
19729     * [`get_relevant_txids`]: Self::get_relevant_txids
19730     * [`transactions_confirmed`]: Self::transactions_confirmed
19731     */
19732    void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
19733    /**
19734     * Notifies LDK of an update to the best header connected at the given height.
19735     *
19736     * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
19737     * blocks.
19738     */
19739    void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
19740    /**
19741     * Returns transactions that must be monitored for reorganization out of the chain along
19742     * with the height and the hash of the block as part of which it had been previously confirmed.
19743     *
19744     * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
19745     * 0.0.112 and prior, in which case you need to manually track previous confirmations.
19746     *
19747     * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
19748     * confirmations to be safe from a chain reorganization. Will not include any transactions
19749     * passed to [`transaction_unconfirmed`], unless later reconfirmed.
19750     *
19751     * Must be called to determine the subset of transactions that must be monitored for
19752     * reorganization. Will be idempotent between calls but may change as a result of calls to the
19753     * other interface methods. Thus, this is useful to determine which transactions must be
19754     * given to [`transaction_unconfirmed`].
19755     *
19756     * If any of the returned transactions are confirmed in a block other than the one with the
19757     * given hash at the given height, they need to be unconfirmed and reconfirmed via
19758     * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
19759     *
19760     * [`transactions_confirmed`]: Self::transactions_confirmed
19761     * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
19762     */
19763    struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
19764    /**
19765     * Frees any resources associated with this object given its this_arg pointer.
19766     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19767     */
19768    void (*free)(void *this_arg);
19769 } LDKConfirm;
19770
19771
19772
19773 /**
19774  * An implementation of [`chain::Watch`] for monitoring channels.
19775  *
19776  * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
19777  * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
19778  * or used independently to monitor channels remotely. See the [module-level documentation] for
19779  * details.
19780  *
19781  * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
19782  * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
19783  * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
19784  * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
19785  * environment with spotty connections, like on mobile.
19786  *
19787  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19788  * [module-level documentation]: crate::chain::chainmonitor
19789  * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
19790  */
19791 typedef struct MUST_USE_STRUCT LDKChainMonitor {
19792    /**
19793     * A pointer to the opaque Rust object.
19794     * Nearly everywhere, inner must be non-null, however in places where
19795     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19796     */
19797    LDKnativeChainMonitor *inner;
19798    /**
19799     * Indicates that this is the only struct which contains the same pointer.
19800     * Rust functions which take ownership of an object provided via an argument require
19801     * this to be true and invalidate the object pointed to by inner.
19802     */
19803    bool is_owned;
19804 } LDKChainMonitor;
19805
19806 /**
19807  * A trait implemented for objects handling events from [`EventsProvider`].
19808  *
19809  * An async variation also exists for implementations of [`EventsProvider`] that support async
19810  * event handling. The async event handler should satisfy the generic bounds: `F:
19811  * core::future::Future, H: Fn(Event) -> F`.
19812  */
19813 typedef struct LDKEventHandler {
19814    /**
19815     * An opaque pointer which is passed to your function implementations as an argument.
19816     * This has no meaning in the LDK, and can be NULL or any other value.
19817     */
19818    void *this_arg;
19819    /**
19820     * Handles the given [`Event`].
19821     *
19822     * See [`EventsProvider`] for details that must be considered when implementing this method.
19823     */
19824    void (*handle_event)(const void *this_arg, struct LDKEvent event);
19825    /**
19826     * Frees any resources associated with this object given its this_arg pointer.
19827     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19828     */
19829    void (*free)(void *this_arg);
19830 } LDKEventHandler;
19831
19832 /**
19833  * A trait indicating an object may generate events.
19834  *
19835  * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
19836  *
19837  * Implementations of this trait may also feature an async version of event handling, as shown with
19838  * [`ChannelManager::process_pending_events_async`] and
19839  * [`ChainMonitor::process_pending_events_async`].
19840  *
19841  * # Requirements
19842  *
19843  * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
19844  * event since the last invocation.
19845  *
19846  * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
19847  * and replay any unhandled events on startup. An [`Event`] is considered handled when
19848  * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
19849  * relevant changes to disk *before* returning.
19850  *
19851  * Further, because an application may crash between an [`Event`] being handled and the
19852  * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
19853  * effect, [`Event`]s may be replayed.
19854  *
19855  * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
19856  * consult the provider's documentation on the implication of processing events and how a handler
19857  * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
19858  * [`ChainMonitor::process_pending_events`]).
19859  *
19860  * (C-not implementable) As there is likely no reason for a user to implement this trait on their
19861  * own type(s).
19862  *
19863  * [`process_pending_events`]: Self::process_pending_events
19864  * [`handle_event`]: EventHandler::handle_event
19865  * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
19866  * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
19867  * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
19868  * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
19869  */
19870 typedef struct LDKEventsProvider {
19871    /**
19872     * An opaque pointer which is passed to your function implementations as an argument.
19873     * This has no meaning in the LDK, and can be NULL or any other value.
19874     */
19875    void *this_arg;
19876    /**
19877     * Processes any events generated since the last call using the given event handler.
19878     *
19879     * See the trait-level documentation for requirements.
19880     */
19881    void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
19882    /**
19883     * Frees any resources associated with this object given its this_arg pointer.
19884     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19885     */
19886    void (*free)(void *this_arg);
19887 } LDKEventsProvider;
19888
19889 /**
19890  * This enum is used to specify which error data to send to peers when failing back an HTLC
19891  * using [`ChannelManager::fail_htlc_backwards_with_reason`].
19892  *
19893  * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
19894  */
19895 typedef enum LDKFailureCode_Tag {
19896    /**
19897     * We had a temporary error processing the payment. Useful if no other error codes fit
19898     * and you want to indicate that the payer may want to retry.
19899     */
19900    LDKFailureCode_TemporaryNodeFailure,
19901    /**
19902     * We have a required feature which was not in this onion. For example, you may require
19903     * some additional metadata that was not provided with this payment.
19904     */
19905    LDKFailureCode_RequiredNodeFeatureMissing,
19906    /**
19907     * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
19908     * the HTLC is too close to the current block height for safe handling.
19909     * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
19910     * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
19911     */
19912    LDKFailureCode_IncorrectOrUnknownPaymentDetails,
19913    /**
19914     * We failed to process the payload after the onion was decrypted. You may wish to
19915     * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
19916     *
19917     * If available, the tuple data may include the type number and byte offset in the
19918     * decrypted byte stream where the failure occurred.
19919     */
19920    LDKFailureCode_InvalidOnionPayload,
19921    /**
19922     * Must be last for serialization purposes
19923     */
19924    LDKFailureCode_Sentinel,
19925 } LDKFailureCode_Tag;
19926
19927 typedef struct MUST_USE_STRUCT LDKFailureCode {
19928    LDKFailureCode_Tag tag;
19929    union {
19930       struct {
19931          struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
19932       };
19933    };
19934 } LDKFailureCode;
19935
19936
19937
19938 /**
19939  * Chain-related parameters used to construct a new `ChannelManager`.
19940  *
19941  * Typically, the block-specific parameters are derived from the best block hash for the network,
19942  * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
19943  * are not needed when deserializing a previously constructed `ChannelManager`.
19944  */
19945 typedef struct MUST_USE_STRUCT LDKChainParameters {
19946    /**
19947     * A pointer to the opaque Rust object.
19948     * Nearly everywhere, inner must be non-null, however in places where
19949     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19950     */
19951    LDKnativeChainParameters *inner;
19952    /**
19953     * Indicates that this is the only struct which contains the same pointer.
19954     * Rust functions which take ownership of an object provided via an argument require
19955     * this to be true and invalidate the object pointed to by inner.
19956     */
19957    bool is_owned;
19958 } LDKChainParameters;
19959
19960 /**
19961  * A trait indicating an object may generate message send events
19962  */
19963 typedef struct LDKMessageSendEventsProvider {
19964    /**
19965     * An opaque pointer which is passed to your function implementations as an argument.
19966     * This has no meaning in the LDK, and can be NULL or any other value.
19967     */
19968    void *this_arg;
19969    /**
19970     * Gets the list of pending events which were generated by previous actions, clearing the list
19971     * in the process.
19972     */
19973    struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
19974    /**
19975     * Frees any resources associated with this object given its this_arg pointer.
19976     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19977     */
19978    void (*free)(void *this_arg);
19979 } LDKMessageSendEventsProvider;
19980
19981 /**
19982  * A trait to describe an object which can receive channel messages.
19983  *
19984  * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
19985  * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
19986  */
19987 typedef struct LDKChannelMessageHandler {
19988    /**
19989     * An opaque pointer which is passed to your function implementations as an argument.
19990     * This has no meaning in the LDK, and can be NULL or any other value.
19991     */
19992    void *this_arg;
19993    /**
19994     * Handle an incoming `open_channel` message from the given peer.
19995     */
19996    void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
19997    /**
19998     * Handle an incoming `open_channel2` message from the given peer.
19999     */
20000    void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
20001    /**
20002     * Handle an incoming `accept_channel` message from the given peer.
20003     */
20004    void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
20005    /**
20006     * Handle an incoming `accept_channel2` message from the given peer.
20007     */
20008    void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
20009    /**
20010     * Handle an incoming `funding_created` message from the given peer.
20011     */
20012    void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
20013    /**
20014     * Handle an incoming `funding_signed` message from the given peer.
20015     */
20016    void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
20017    /**
20018     * Handle an incoming `channel_ready` message from the given peer.
20019     */
20020    void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
20021    /**
20022     * Handle an incoming `shutdown` message from the given peer.
20023     */
20024    void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
20025    /**
20026     * Handle an incoming `closing_signed` message from the given peer.
20027     */
20028    void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
20029    /**
20030     * Handle an incoming `stfu` message from the given peer.
20031     */
20032    void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
20033    /**
20034     * Handle an incoming `splice` message from the given peer.
20035     */
20036    void (*handle_splice)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKSplice *NONNULL_PTR msg);
20037    /**
20038     * Handle an incoming `splice_ack` message from the given peer.
20039     */
20040    void (*handle_splice_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKSpliceAck *NONNULL_PTR msg);
20041    /**
20042     * Handle an incoming `splice_locked` message from the given peer.
20043     */
20044    void (*handle_splice_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKSpliceLocked *NONNULL_PTR msg);
20045    /**
20046     * Handle an incoming `tx_add_input message` from the given peer.
20047     */
20048    void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
20049    /**
20050     * Handle an incoming `tx_add_output` message from the given peer.
20051     */
20052    void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
20053    /**
20054     * Handle an incoming `tx_remove_input` message from the given peer.
20055     */
20056    void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
20057    /**
20058     * Handle an incoming `tx_remove_output` message from the given peer.
20059     */
20060    void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
20061    /**
20062     * Handle an incoming `tx_complete message` from the given peer.
20063     */
20064    void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
20065    /**
20066     * Handle an incoming `tx_signatures` message from the given peer.
20067     */
20068    void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
20069    /**
20070     * Handle an incoming `tx_init_rbf` message from the given peer.
20071     */
20072    void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
20073    /**
20074     * Handle an incoming `tx_ack_rbf` message from the given peer.
20075     */
20076    void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
20077    /**
20078     * Handle an incoming `tx_abort message` from the given peer.
20079     */
20080    void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
20081    /**
20082     * Handle an incoming `update_add_htlc` message from the given peer.
20083     */
20084    void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
20085    /**
20086     * Handle an incoming `update_fulfill_htlc` message from the given peer.
20087     */
20088    void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
20089    /**
20090     * Handle an incoming `update_fail_htlc` message from the given peer.
20091     */
20092    void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
20093    /**
20094     * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
20095     */
20096    void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
20097    /**
20098     * Handle an incoming `commitment_signed` message from the given peer.
20099     */
20100    void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
20101    /**
20102     * Handle an incoming `revoke_and_ack` message from the given peer.
20103     */
20104    void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
20105    /**
20106     * Handle an incoming `update_fee` message from the given peer.
20107     */
20108    void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
20109    /**
20110     * Handle an incoming `announcement_signatures` message from the given peer.
20111     */
20112    void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
20113    /**
20114     * Indicates a connection to the peer failed/an existing connection was lost.
20115     */
20116    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
20117    /**
20118     * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
20119     *
20120     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
20121     * with us. Implementors should be somewhat conservative about doing so, however, as other
20122     * message handlers may still wish to communicate with this peer.
20123     */
20124    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
20125    /**
20126     * Handle an incoming `channel_reestablish` message from the given peer.
20127     */
20128    void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
20129    /**
20130     * Handle an incoming `channel_update` message from the given peer.
20131     */
20132    void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
20133    /**
20134     * Handle an incoming `error` message from the given peer.
20135     */
20136    void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
20137    /**
20138     * Gets the node feature flags which this handler itself supports. All available handlers are
20139     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
20140     * which are broadcasted in our [`NodeAnnouncement`] message.
20141     */
20142    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
20143    /**
20144     * Gets the init feature flags which should be sent to the given peer. All available handlers
20145     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
20146     * which are sent in our [`Init`] message.
20147     *
20148     * Note that this method is called before [`Self::peer_connected`].
20149     */
20150    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
20151    /**
20152     * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
20153     *
20154     * If it's `None`, then no particular network chain hash compatibility will be enforced when
20155     * connecting to peers.
20156     */
20157    struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
20158    /**
20159     * Implementation of MessageSendEventsProvider for this object.
20160     */
20161    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
20162    /**
20163     * Frees any resources associated with this object given its this_arg pointer.
20164     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20165     */
20166    void (*free)(void *this_arg);
20167 } LDKChannelMessageHandler;
20168
20169 /**
20170  * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
20171  *
20172  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
20173  */
20174 typedef struct LDKOffersMessageHandler {
20175    /**
20176     * An opaque pointer which is passed to your function implementations as an argument.
20177     * This has no meaning in the LDK, and can be NULL or any other value.
20178     */
20179    void *this_arg;
20180    /**
20181     * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
20182     * or replying with an error.
20183     *
20184     * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
20185     *
20186     * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
20187     */
20188    struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
20189    /**
20190     * Releases any [`OffersMessage`]s that need to be sent.
20191     *
20192     * Typically, this is used for messages initiating a payment flow rather than in response to
20193     * another message. The latter should use the return value of [`Self::handle_message`].
20194     */
20195    struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
20196    /**
20197     * Frees any resources associated with this object given its this_arg pointer.
20198     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20199     */
20200    void (*free)(void *this_arg);
20201 } LDKOffersMessageHandler;
20202
20203
20204
20205 /**
20206  * Arguments for the creation of a ChannelManager that are not deserialized.
20207  *
20208  * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
20209  * is:
20210  * 1) Deserialize all stored [`ChannelMonitor`]s.
20211  * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
20212  *    `<(BlockHash, ChannelManager)>::read(reader, args)`
20213  *    This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
20214  *    [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
20215  * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
20216  *    same way you would handle a [`chain::Filter`] call using
20217  *    [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
20218  * 4) Reconnect blocks on your [`ChannelMonitor`]s.
20219  * 5) Disconnect/connect blocks on the [`ChannelManager`].
20220  * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
20221  *    Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
20222  *    will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
20223  *    the next step.
20224  * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
20225  *    [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
20226  *
20227  * Note that the ordering of #4-7 is not of importance, however all four must occur before you
20228  * call any other methods on the newly-deserialized [`ChannelManager`].
20229  *
20230  * Note that because some channels may be closed during deserialization, it is critical that you
20231  * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
20232  * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
20233  * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
20234  * not force-close the same channels but consider them live), you may end up revoking a state for
20235  * which you've already broadcasted the transaction.
20236  *
20237  * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
20238  */
20239 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
20240    /**
20241     * A pointer to the opaque Rust object.
20242     * Nearly everywhere, inner must be non-null, however in places where
20243     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20244     */
20245    LDKnativeChannelManagerReadArgs *inner;
20246    /**
20247     * Indicates that this is the only struct which contains the same pointer.
20248     * Rust functions which take ownership of an object provided via an argument require
20249     * this to be true and invalidate the object pointed to by inner.
20250     */
20251    bool is_owned;
20252 } LDKChannelManagerReadArgs;
20253
20254
20255
20256 /**
20257  * A set of keys that were HKDF-expanded from an initial call to
20258  * [`NodeSigner::get_inbound_payment_key_material`].
20259  *
20260  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
20261  */
20262 typedef struct MUST_USE_STRUCT LDKExpandedKey {
20263    /**
20264     * A pointer to the opaque Rust object.
20265     * Nearly everywhere, inner must be non-null, however in places where
20266     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20267     */
20268    LDKnativeExpandedKey *inner;
20269    /**
20270     * Indicates that this is the only struct which contains the same pointer.
20271     * Rust functions which take ownership of an object provided via an argument require
20272     * this to be true and invalidate the object pointed to by inner.
20273     */
20274    bool is_owned;
20275 } LDKExpandedKey;
20276
20277
20278
20279 /**
20280  * Packet of hop data for next peer
20281  */
20282 typedef struct MUST_USE_STRUCT LDKPacket {
20283    /**
20284     * A pointer to the opaque Rust object.
20285     * Nearly everywhere, inner must be non-null, however in places where
20286     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20287     */
20288    LDKnativePacket *inner;
20289    /**
20290     * Indicates that this is the only struct which contains the same pointer.
20291     * Rust functions which take ownership of an object provided via an argument require
20292     * this to be true and invalidate the object pointed to by inner.
20293     */
20294    bool is_owned;
20295 } LDKPacket;
20296
20297 /**
20298  * A 3-byte byte array.
20299  */
20300 typedef struct LDKThreeBytes {
20301    /**
20302     * The three bytes
20303     */
20304    uint8_t data[3];
20305 } LDKThreeBytes;
20306
20307 /**
20308  * A trait to describe an object which can receive routing messages.
20309  *
20310  * # Implementor DoS Warnings
20311  *
20312  * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
20313  * handling inbound queries. Implementors using an on-disk network graph should be aware of
20314  * repeated disk I/O for queries accessing different parts of the network graph.
20315  */
20316 typedef struct LDKRoutingMessageHandler {
20317    /**
20318     * An opaque pointer which is passed to your function implementations as an argument.
20319     * This has no meaning in the LDK, and can be NULL or any other value.
20320     */
20321    void *this_arg;
20322    /**
20323     * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
20324     * `false` or returning an `Err` otherwise.
20325     */
20326    struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
20327    /**
20328     * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
20329     * or returning an `Err` otherwise.
20330     */
20331    struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
20332    /**
20333     * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
20334     * `false` or returning an `Err` otherwise.
20335     */
20336    struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
20337    /**
20338     * Gets channel announcements and updates required to dump our routing table to a remote node,
20339     * starting at the `short_channel_id` indicated by `starting_point` and including announcements
20340     * for a single channel.
20341     */
20342    struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
20343    /**
20344     * Gets a node announcement required to dump our routing table to a remote node, starting at
20345     * the node *after* the provided pubkey and including up to one announcement immediately
20346     * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
20347     * If `None` is provided for `starting_point`, we start at the first node.
20348     *
20349     * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
20350     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20351     */
20352    struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
20353    /**
20354     * Called when a connection is established with a peer. This can be used to
20355     * perform routing table synchronization using a strategy defined by the
20356     * implementor.
20357     *
20358     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
20359     * with us. Implementors should be somewhat conservative about doing so, however, as other
20360     * message handlers may still wish to communicate with this peer.
20361     */
20362    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
20363    /**
20364     * Handles the reply of a query we initiated to learn about channels
20365     * for a given range of blocks. We can expect to receive one or more
20366     * replies to a single query.
20367     */
20368    struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
20369    /**
20370     * Handles the reply of a query we initiated asking for routing gossip
20371     * messages for a list of channels. We should receive this message when
20372     * a node has completed its best effort to send us the pertaining routing
20373     * gossip messages.
20374     */
20375    struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
20376    /**
20377     * Handles when a peer asks us to send a list of `short_channel_id`s
20378     * for the requested range of blocks.
20379     */
20380    struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
20381    /**
20382     * Handles when a peer asks us to send routing gossip messages for a
20383     * list of `short_channel_id`s.
20384     */
20385    struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
20386    /**
20387     * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
20388     * pending some async action. While there is no guarantee of the rate of future messages, the
20389     * caller should seek to reduce the rate of new gossip messages handled, especially
20390     * [`ChannelAnnouncement`]s.
20391     */
20392    bool (*processing_queue_high)(const void *this_arg);
20393    /**
20394     * Gets the node feature flags which this handler itself supports. All available handlers are
20395     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
20396     * which are broadcasted in our [`NodeAnnouncement`] message.
20397     */
20398    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
20399    /**
20400     * Gets the init feature flags which should be sent to the given peer. All available handlers
20401     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
20402     * which are sent in our [`Init`] message.
20403     *
20404     * Note that this method is called before [`Self::peer_connected`].
20405     */
20406    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
20407    /**
20408     * Implementation of MessageSendEventsProvider for this object.
20409     */
20410    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
20411    /**
20412     * Frees any resources associated with this object given its this_arg pointer.
20413     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20414     */
20415    void (*free)(void *this_arg);
20416 } LDKRoutingMessageHandler;
20417
20418 /**
20419  * A handler for received [`OnionMessage`]s and for providing generated ones to send.
20420  */
20421 typedef struct LDKOnionMessageHandler {
20422    /**
20423     * An opaque pointer which is passed to your function implementations as an argument.
20424     * This has no meaning in the LDK, and can be NULL or any other value.
20425     */
20426    void *this_arg;
20427    /**
20428     * Because much of the lightning network does not yet support forwarding onion messages, we
20429     * may need to directly connect to a node which will forward a message for us. In such a case,
20430     * this method will return the set of nodes which need connection by node_id and the
20431     * corresponding socket addresses where they may accept incoming connections.
20432     *
20433     * Thus, this method should be polled regularly to detect messages await such a direct
20434     * connection.
20435     */
20436    struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ (*get_and_clear_connections_needed)(const void *this_arg);
20437    /**
20438     * Handle an incoming `onion_message` message from the given peer.
20439     */
20440    void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
20441    /**
20442     * Returns the next pending onion message for the peer with the given node id.
20443     *
20444     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20445     */
20446    struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
20447    /**
20448     * Called when a connection is established with a peer. Can be used to track which peers
20449     * advertise onion message support and are online.
20450     *
20451     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
20452     * with us. Implementors should be somewhat conservative about doing so, however, as other
20453     * message handlers may still wish to communicate with this peer.
20454     */
20455    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
20456    /**
20457     * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
20458     * drop and refuse to forward onion messages to this peer.
20459     */
20460    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
20461    /**
20462     * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
20463     * to drop any buffered onion messages intended for prospective peers.
20464     */
20465    void (*timer_tick_occurred)(const void *this_arg);
20466    /**
20467     * Gets the node feature flags which this handler itself supports. All available handlers are
20468     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
20469     * which are broadcasted in our [`NodeAnnouncement`] message.
20470     */
20471    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
20472    /**
20473     * Gets the init feature flags which should be sent to the given peer. All available handlers
20474     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
20475     * which are sent in our [`Init`] message.
20476     *
20477     * Note that this method is called before [`Self::peer_connected`].
20478     */
20479    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
20480    /**
20481     * Frees any resources associated with this object given its this_arg pointer.
20482     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20483     */
20484    void (*free)(void *this_arg);
20485 } LDKOnionMessageHandler;
20486
20487 /**
20488  * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
20489  * decoders.
20490  */
20491 typedef struct LDKCustomMessageReader {
20492    /**
20493     * An opaque pointer which is passed to your function implementations as an argument.
20494     * This has no meaning in the LDK, and can be NULL or any other value.
20495     */
20496    void *this_arg;
20497    /**
20498     * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
20499     * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
20500     * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
20501     * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
20502     */
20503    struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
20504    /**
20505     * Frees any resources associated with this object given its this_arg pointer.
20506     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20507     */
20508    void (*free)(void *this_arg);
20509 } LDKCustomMessageReader;
20510
20511 /**
20512  * A handler provided to [`PeerManager`] for reading and handling custom messages.
20513  *
20514  * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
20515  * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
20516  * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
20517  *
20518  * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
20519  * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
20520  */
20521 typedef struct LDKCustomMessageHandler {
20522    /**
20523     * An opaque pointer which is passed to your function implementations as an argument.
20524     * This has no meaning in the LDK, and can be NULL or any other value.
20525     */
20526    void *this_arg;
20527    /**
20528     * Handles the given message sent from `sender_node_id`, possibly producing messages for
20529     * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
20530     * to send.
20531     */
20532    struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
20533    /**
20534     * Returns the list of pending messages that were generated by the handler, clearing the list
20535     * in the process. Each message is paired with the node id of the intended recipient. If no
20536     * connection to the node exists, then the message is simply not sent.
20537     */
20538    struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
20539    /**
20540     * Gets the node feature flags which this handler itself supports. All available handlers are
20541     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
20542     * which are broadcasted in our [`NodeAnnouncement`] message.
20543     *
20544     * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
20545     */
20546    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
20547    /**
20548     * Gets the init feature flags which should be sent to the given peer. All available handlers
20549     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
20550     * which are sent in our [`Init`] message.
20551     *
20552     * [`Init`]: crate::ln::msgs::Init
20553     */
20554    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
20555    /**
20556     * Implementation of CustomMessageReader for this object.
20557     */
20558    struct LDKCustomMessageReader CustomMessageReader;
20559    /**
20560     * Frees any resources associated with this object given its this_arg pointer.
20561     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20562     */
20563    void (*free)(void *this_arg);
20564 } LDKCustomMessageHandler;
20565
20566
20567
20568 /**
20569  * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
20570  * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
20571  */
20572 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
20573    /**
20574     * A pointer to the opaque Rust object.
20575     * Nearly everywhere, inner must be non-null, however in places where
20576     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20577     */
20578    LDKnativeIgnoringMessageHandler *inner;
20579    /**
20580     * Indicates that this is the only struct which contains the same pointer.
20581     * Rust functions which take ownership of an object provided via an argument require
20582     * this to be true and invalidate the object pointed to by inner.
20583     */
20584    bool is_owned;
20585 } LDKIgnoringMessageHandler;
20586
20587 /**
20588  * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
20589  * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
20590  * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
20591  * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
20592  * message types.
20593  *
20594  * See [`OnionMessenger`] for example usage.
20595  *
20596  * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
20597  * [`CustomMessage`]: Self::CustomMessage
20598  */
20599 typedef struct LDKCustomOnionMessageHandler {
20600    /**
20601     * An opaque pointer which is passed to your function implementations as an argument.
20602     * This has no meaning in the LDK, and can be NULL or any other value.
20603     */
20604    void *this_arg;
20605    /**
20606     * Called with the custom message that was received, returning a response to send, if any.
20607     *
20608     * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
20609     */
20610    struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
20611    /**
20612     * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
20613     * message type is unknown.
20614     */
20615    struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
20616    /**
20617     * Releases any [`Self::CustomMessage`]s that need to be sent.
20618     *
20619     * Typically, this is used for messages initiating a message flow rather than in response to
20620     * another message. The latter should use the return value of [`Self::handle_custom_message`].
20621     */
20622    struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
20623    /**
20624     * Frees any resources associated with this object given its this_arg pointer.
20625     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20626     */
20627    void (*free)(void *this_arg);
20628 } LDKCustomOnionMessageHandler;
20629
20630
20631
20632 /**
20633  * A dummy struct which implements `ChannelMessageHandler` without having any channels.
20634  * You can provide one of these as the route_handler in a MessageHandler.
20635  */
20636 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
20637    /**
20638     * A pointer to the opaque Rust object.
20639     * Nearly everywhere, inner must be non-null, however in places where
20640     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20641     */
20642    LDKnativeErroringMessageHandler *inner;
20643    /**
20644     * Indicates that this is the only struct which contains the same pointer.
20645     * Rust functions which take ownership of an object provided via an argument require
20646     * this to be true and invalidate the object pointed to by inner.
20647     */
20648    bool is_owned;
20649 } LDKErroringMessageHandler;
20650
20651
20652
20653 /**
20654  * Provides references to trait impls which handle different types of messages.
20655  */
20656 typedef struct MUST_USE_STRUCT LDKMessageHandler {
20657    /**
20658     * A pointer to the opaque Rust object.
20659     * Nearly everywhere, inner must be non-null, however in places where
20660     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20661     */
20662    LDKnativeMessageHandler *inner;
20663    /**
20664     * Indicates that this is the only struct which contains the same pointer.
20665     * Rust functions which take ownership of an object provided via an argument require
20666     * this to be true and invalidate the object pointed to by inner.
20667     */
20668    bool is_owned;
20669 } LDKMessageHandler;
20670
20671 /**
20672  * Provides an object which can be used to send data to and which uniquely identifies a connection
20673  * to a remote host. You will need to be able to generate multiple of these which meet Eq and
20674  * implement Hash to meet the PeerManager API.
20675  *
20676  * For efficiency, [`Clone`] should be relatively cheap for this type.
20677  *
20678  * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
20679  * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
20680  * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
20681  * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
20682  * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
20683  * to simply use another value which is guaranteed to be globally unique instead.
20684  */
20685 typedef struct LDKSocketDescriptor {
20686    /**
20687     * An opaque pointer which is passed to your function implementations as an argument.
20688     * This has no meaning in the LDK, and can be NULL or any other value.
20689     */
20690    void *this_arg;
20691    /**
20692     * Attempts to send some data from the given slice to the peer.
20693     *
20694     * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
20695     * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
20696     * called and further write attempts may occur until that time.
20697     *
20698     * If the returned size is smaller than `data.len()`, a
20699     * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
20700     * written. Additionally, until a `send_data` event completes fully, no further
20701     * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
20702     * prevent denial-of-service issues, you should not read or buffer any data from the socket
20703     * until then.
20704     *
20705     * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
20706     * (indicating that read events should be paused to prevent DoS in the send buffer),
20707     * `resume_read` may be set indicating that read events on this descriptor should resume. A
20708     * `resume_read` of false carries no meaning, and should not cause any action.
20709     */
20710    uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
20711    /**
20712     * Disconnect the socket pointed to by this SocketDescriptor.
20713     *
20714     * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
20715     * call (doing so is a noop).
20716     */
20717    void (*disconnect_socket)(void *this_arg);
20718    /**
20719     * Checks if two objects are equal given this object's this_arg pointer and another object.
20720     */
20721    bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
20722    /**
20723     * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
20724     * This is used, for example, for inclusion of this object in a hash map.
20725     */
20726    uint64_t (*hash)(const void *this_arg);
20727    /**
20728     * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
20729     * The new SocketDescriptor is provided, and should be mutated as needed to perform a
20730     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
20731     */
20732    void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
20733    /**
20734     * Frees any resources associated with this object given its this_arg pointer.
20735     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20736     */
20737    void (*free)(void *this_arg);
20738 } LDKSocketDescriptor;
20739
20740
20741
20742 /**
20743  * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
20744  * socket events into messages which it passes on to its [`MessageHandler`].
20745  *
20746  * Locks are taken internally, so you must never assume that reentrancy from a
20747  * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
20748  *
20749  * Calls to [`read_event`] will decode relevant messages and pass them to the
20750  * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
20751  * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
20752  * [`PeerManager`] functions related to the same connection must occur only in serial, making new
20753  * calls only after previous ones have returned.
20754  *
20755  * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
20756  * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
20757  * essentially you should default to using a [`SimpleRefPeerManager`], and use a
20758  * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
20759  * you're using lightning-net-tokio.
20760  *
20761  * [`read_event`]: PeerManager::read_event
20762  */
20763 typedef struct MUST_USE_STRUCT LDKPeerManager {
20764    /**
20765     * A pointer to the opaque Rust object.
20766     * Nearly everywhere, inner must be non-null, however in places where
20767     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20768     */
20769    LDKnativePeerManager *inner;
20770    /**
20771     * Indicates that this is the only struct which contains the same pointer.
20772     * Rust functions which take ownership of an object provided via an argument require
20773     * this to be true and invalidate the object pointed to by inner.
20774     */
20775    bool is_owned;
20776 } LDKPeerManager;
20777
20778
20779
20780 /**
20781  * Static channel fields used to build transactions given per-commitment fields, organized by
20782  * broadcaster/countersignatory.
20783  *
20784  * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
20785  * as_holder_broadcastable and as_counterparty_broadcastable functions.
20786  */
20787 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
20788    /**
20789     * A pointer to the opaque Rust object.
20790     * Nearly everywhere, inner must be non-null, however in places where
20791     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20792     */
20793    LDKnativeDirectedChannelTransactionParameters *inner;
20794    /**
20795     * Indicates that this is the only struct which contains the same pointer.
20796     * Rust functions which take ownership of an object provided via an argument require
20797     * this to be true and invalidate the object pointed to by inner.
20798     */
20799    bool is_owned;
20800 } LDKDirectedChannelTransactionParameters;
20801
20802
20803
20804 /**
20805  * Features used within an `offer`.
20806  */
20807 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
20808    /**
20809     * A pointer to the opaque Rust object.
20810     * Nearly everywhere, inner must be non-null, however in places where
20811     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20812     */
20813    LDKnativeOfferFeatures *inner;
20814    /**
20815     * Indicates that this is the only struct which contains the same pointer.
20816     * Rust functions which take ownership of an object provided via an argument require
20817     * this to be true and invalidate the object pointed to by inner.
20818     */
20819    bool is_owned;
20820 } LDKOfferFeatures;
20821
20822
20823
20824 /**
20825  * Features used within an `invoice_request`.
20826  */
20827 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
20828    /**
20829     * A pointer to the opaque Rust object.
20830     * Nearly everywhere, inner must be non-null, however in places where
20831     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20832     */
20833    LDKnativeInvoiceRequestFeatures *inner;
20834    /**
20835     * Indicates that this is the only struct which contains the same pointer.
20836     * Rust functions which take ownership of an object provided via an argument require
20837     * this to be true and invalidate the object pointed to by inner.
20838     */
20839    bool is_owned;
20840 } LDKInvoiceRequestFeatures;
20841
20842
20843
20844 /**
20845  * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
20846  * another currency.
20847  */
20848 typedef struct MUST_USE_STRUCT LDKAmount {
20849    /**
20850     * A pointer to the opaque Rust object.
20851     * Nearly everywhere, inner must be non-null, however in places where
20852     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20853     */
20854    LDKnativeAmount *inner;
20855    /**
20856     * Indicates that this is the only struct which contains the same pointer.
20857     * Rust functions which take ownership of an object provided via an argument require
20858     * this to be true and invalidate the object pointed to by inner.
20859     */
20860    bool is_owned;
20861 } LDKAmount;
20862
20863
20864
20865 /**
20866  * Quantity of items supported by an [`Offer`].
20867  */
20868 typedef struct MUST_USE_STRUCT LDKQuantity {
20869    /**
20870     * A pointer to the opaque Rust object.
20871     * Nearly everywhere, inner must be non-null, however in places where
20872     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20873     */
20874    LDKnativeQuantity *inner;
20875    /**
20876     * Indicates that this is the only struct which contains the same pointer.
20877     * Rust functions which take ownership of an object provided via an argument require
20878     * this to be true and invalidate the object pointed to by inner.
20879     */
20880    bool is_owned;
20881 } LDKQuantity;
20882
20883
20884
20885 /**
20886  * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
20887  * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
20888  *
20889  * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
20890  * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
20891  */
20892 typedef struct MUST_USE_STRUCT LDKTaggedHash {
20893    /**
20894     * A pointer to the opaque Rust object.
20895     * Nearly everywhere, inner must be non-null, however in places where
20896     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20897     */
20898    LDKnativeTaggedHash *inner;
20899    /**
20900     * Indicates that this is the only struct which contains the same pointer.
20901     * Rust functions which take ownership of an object provided via an argument require
20902     * this to be true and invalidate the object pointed to by inner.
20903     */
20904    bool is_owned;
20905 } LDKTaggedHash;
20906
20907
20908
20909 /**
20910  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
20911  *
20912  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
20913  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
20914  */
20915 typedef struct MUST_USE_STRUCT LDKErroneousField {
20916    /**
20917     * A pointer to the opaque Rust object.
20918     * Nearly everywhere, inner must be non-null, however in places where
20919     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20920     */
20921    LDKnativeErroneousField *inner;
20922    /**
20923     * Indicates that this is the only struct which contains the same pointer.
20924     * Rust functions which take ownership of an object provided via an argument require
20925     * this to be true and invalidate the object pointed to by inner.
20926     */
20927    bool is_owned;
20928 } LDKErroneousField;
20929
20930
20931
20932 /**
20933  * Receives and validates network updates from peers,
20934  * stores authentic and relevant data as a network graph.
20935  * This network graph is then used for routing payments.
20936  * Provides interface to help with initial routing sync by
20937  * serving historical announcements.
20938  */
20939 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
20940    /**
20941     * A pointer to the opaque Rust object.
20942     * Nearly everywhere, inner must be non-null, however in places where
20943     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20944     */
20945    LDKnativeP2PGossipSync *inner;
20946    /**
20947     * Indicates that this is the only struct which contains the same pointer.
20948     * Rust functions which take ownership of an object provided via an argument require
20949     * this to be true and invalidate the object pointed to by inner.
20950     */
20951    bool is_owned;
20952 } LDKP2PGossipSync;
20953
20954
20955
20956 /**
20957  * A read-only view of [`NetworkGraph`].
20958  */
20959 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
20960    /**
20961     * A pointer to the opaque Rust object.
20962     * Nearly everywhere, inner must be non-null, however in places where
20963     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20964     */
20965    LDKnativeReadOnlyNetworkGraph *inner;
20966    /**
20967     * Indicates that this is the only struct which contains the same pointer.
20968     * Rust functions which take ownership of an object provided via an argument require
20969     * this to be true and invalidate the object pointed to by inner.
20970     */
20971    bool is_owned;
20972 } LDKReadOnlyNetworkGraph;
20973
20974
20975
20976 /**
20977  * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
20978  * source node to a target node.
20979  */
20980 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
20981    /**
20982     * A pointer to the opaque Rust object.
20983     * Nearly everywhere, inner must be non-null, however in places where
20984     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20985     */
20986    LDKnativeDirectedChannelInfo *inner;
20987    /**
20988     * Indicates that this is the only struct which contains the same pointer.
20989     * Rust functions which take ownership of an object provided via an argument require
20990     * this to be true and invalidate the object pointed to by inner.
20991     */
20992    bool is_owned;
20993 } LDKDirectedChannelInfo;
20994
20995 /**
20996  * The effective capacity of a channel for routing purposes.
20997  *
20998  * While this may be smaller than the actual channel capacity, amounts greater than
20999  * [`Self::as_msat`] should not be routed through the channel.
21000  */
21001 typedef enum LDKEffectiveCapacity_Tag {
21002    /**
21003     * The available liquidity in the channel known from being a channel counterparty, and thus a
21004     * direct hop.
21005     */
21006    LDKEffectiveCapacity_ExactLiquidity,
21007    /**
21008     * The maximum HTLC amount in one direction as advertised on the gossip network.
21009     */
21010    LDKEffectiveCapacity_AdvertisedMaxHTLC,
21011    /**
21012     * The total capacity of the channel as determined by the funding transaction.
21013     */
21014    LDKEffectiveCapacity_Total,
21015    /**
21016     * A capacity sufficient to route any payment, typically used for private channels provided by
21017     * an invoice.
21018     */
21019    LDKEffectiveCapacity_Infinite,
21020    /**
21021     * The maximum HTLC amount as provided by an invoice route hint.
21022     */
21023    LDKEffectiveCapacity_HintMaxHTLC,
21024    /**
21025     * A capacity that is unknown possibly because either the chain state is unavailable to know
21026     * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
21027     */
21028    LDKEffectiveCapacity_Unknown,
21029    /**
21030     * Must be last for serialization purposes
21031     */
21032    LDKEffectiveCapacity_Sentinel,
21033 } LDKEffectiveCapacity_Tag;
21034
21035 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
21036    /**
21037     * Either the inbound or outbound liquidity depending on the direction, denominated in
21038     * millisatoshi.
21039     */
21040    uint64_t liquidity_msat;
21041 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
21042
21043 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
21044    /**
21045     * The maximum HTLC amount denominated in millisatoshi.
21046     */
21047    uint64_t amount_msat;
21048 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
21049
21050 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
21051    /**
21052     * The funding amount denominated in millisatoshi.
21053     */
21054    uint64_t capacity_msat;
21055    /**
21056     * The maximum HTLC amount denominated in millisatoshi.
21057     */
21058    uint64_t htlc_maximum_msat;
21059 } LDKEffectiveCapacity_LDKTotal_Body;
21060
21061 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
21062    /**
21063     * The maximum HTLC amount denominated in millisatoshi.
21064     */
21065    uint64_t amount_msat;
21066 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
21067
21068 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
21069    LDKEffectiveCapacity_Tag tag;
21070    union {
21071       LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
21072       LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
21073       LDKEffectiveCapacity_LDKTotal_Body total;
21074       LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
21075    };
21076 } LDKEffectiveCapacity;
21077
21078
21079
21080 /**
21081  * A [`Router`] implemented using [`find_route`].
21082  */
21083 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
21084    /**
21085     * A pointer to the opaque Rust object.
21086     * Nearly everywhere, inner must be non-null, however in places where
21087     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21088     */
21089    LDKnativeDefaultRouter *inner;
21090    /**
21091     * Indicates that this is the only struct which contains the same pointer.
21092     * Rust functions which take ownership of an object provided via an argument require
21093     * this to be true and invalidate the object pointed to by inner.
21094     */
21095    bool is_owned;
21096 } LDKDefaultRouter;
21097
21098
21099
21100 /**
21101  * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
21102  *
21103  * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
21104  * [`find_route`].
21105  *
21106  * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
21107  */
21108 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
21109    /**
21110     * A pointer to the opaque Rust object.
21111     * Nearly everywhere, inner must be non-null, however in places where
21112     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21113     */
21114    LDKnativeScorerAccountingForInFlightHtlcs *inner;
21115    /**
21116     * Indicates that this is the only struct which contains the same pointer.
21117     * Rust functions which take ownership of an object provided via an argument require
21118     * this to be true and invalidate the object pointed to by inner.
21119     */
21120    bool is_owned;
21121 } LDKScorerAccountingForInFlightHtlcs;
21122
21123 /**
21124  * The recipient of a payment, differing based on whether they've hidden their identity with route
21125  * blinding.
21126  */
21127 typedef enum LDKPayee_Tag {
21128    /**
21129     * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
21130     * will be included in the final [`Route`].
21131     */
21132    LDKPayee_Blinded,
21133    /**
21134     * The recipient included these route hints in their BOLT11 invoice.
21135     */
21136    LDKPayee_Clear,
21137    /**
21138     * Must be last for serialization purposes
21139     */
21140    LDKPayee_Sentinel,
21141 } LDKPayee_Tag;
21142
21143 typedef struct LDKPayee_LDKBlinded_Body {
21144    /**
21145     * Aggregated routing info and blinded paths, for routing to the payee without knowing their
21146     * node id.
21147     */
21148    struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
21149    /**
21150     * Features supported by the payee.
21151     *
21152     * May be set from the payee's invoice. May be `None` if the invoice does not contain any
21153     * features.
21154     *
21155     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
21156     */
21157    struct LDKBolt12InvoiceFeatures features;
21158 } LDKPayee_LDKBlinded_Body;
21159
21160 typedef struct LDKPayee_LDKClear_Body {
21161    /**
21162     * The node id of the payee.
21163     */
21164    struct LDKPublicKey node_id;
21165    /**
21166     * Hints for routing to the payee, containing channels connecting the payee to public nodes.
21167     */
21168    struct LDKCVec_RouteHintZ route_hints;
21169    /**
21170     * Features supported by the payee.
21171     *
21172     * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
21173     * does not contain any features.
21174     *
21175     * [`for_keysend`]: PaymentParameters::for_keysend
21176     *
21177     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
21178     */
21179    struct LDKBolt11InvoiceFeatures features;
21180    /**
21181     * The minimum CLTV delta at the end of the route. This value must not be zero.
21182     */
21183    uint32_t final_cltv_expiry_delta;
21184 } LDKPayee_LDKClear_Body;
21185
21186 typedef struct MUST_USE_STRUCT LDKPayee {
21187    LDKPayee_Tag tag;
21188    union {
21189       LDKPayee_LDKBlinded_Body blinded;
21190       LDKPayee_LDKClear_Body clear;
21191    };
21192 } LDKPayee;
21193
21194 /**
21195  * A trait which can both lookup and update routing channel penalty scores.
21196  *
21197  * This is used in places where both bounds are required and implemented for all types which
21198  * implement [`ScoreLookUp`] and [`ScoreUpdate`].
21199  *
21200  * Bindings users may need to manually implement this for their custom scoring implementations.
21201  */
21202 typedef struct LDKScore {
21203    /**
21204     * An opaque pointer which is passed to your function implementations as an argument.
21205     * This has no meaning in the LDK, and can be NULL or any other value.
21206     */
21207    void *this_arg;
21208    /**
21209     * Implementation of ScoreLookUp for this object.
21210     */
21211    struct LDKScoreLookUp ScoreLookUp;
21212    /**
21213     * Implementation of ScoreUpdate for this object.
21214     */
21215    struct LDKScoreUpdate ScoreUpdate;
21216    /**
21217     * Serialize the object into a byte array
21218     */
21219    struct LDKCVec_u8Z (*write)(const void *this_arg);
21220    /**
21221     * Frees any resources associated with this object given its this_arg pointer.
21222     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21223     */
21224    void (*free)(void *this_arg);
21225 } LDKScore;
21226
21227
21228
21229 /**
21230  * A concrete implementation of [`LockableScore`] which supports multi-threading.
21231  */
21232 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
21233    /**
21234     * A pointer to the opaque Rust object.
21235     * Nearly everywhere, inner must be non-null, however in places where
21236     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21237     */
21238    LDKnativeMultiThreadedLockableScore *inner;
21239    /**
21240     * Indicates that this is the only struct which contains the same pointer.
21241     * Rust functions which take ownership of an object provided via an argument require
21242     * this to be true and invalidate the object pointed to by inner.
21243     */
21244    bool is_owned;
21245 } LDKMultiThreadedLockableScore;
21246
21247
21248
21249 /**
21250  * A locked `MultiThreadedLockableScore`.
21251  */
21252 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
21253    /**
21254     * A pointer to the opaque Rust object.
21255     * Nearly everywhere, inner must be non-null, however in places where
21256     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21257     */
21258    LDKnativeMultiThreadedScoreLockRead *inner;
21259    /**
21260     * Indicates that this is the only struct which contains the same pointer.
21261     * Rust functions which take ownership of an object provided via an argument require
21262     * this to be true and invalidate the object pointed to by inner.
21263     */
21264    bool is_owned;
21265 } LDKMultiThreadedScoreLockRead;
21266
21267
21268
21269 /**
21270  * A locked `MultiThreadedLockableScore`.
21271  */
21272 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
21273    /**
21274     * A pointer to the opaque Rust object.
21275     * Nearly everywhere, inner must be non-null, however in places where
21276     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21277     */
21278    LDKnativeMultiThreadedScoreLockWrite *inner;
21279    /**
21280     * Indicates that this is the only struct which contains the same pointer.
21281     * Rust functions which take ownership of an object provided via an argument require
21282     * this to be true and invalidate the object pointed to by inner.
21283     */
21284    bool is_owned;
21285 } LDKMultiThreadedScoreLockWrite;
21286
21287
21288
21289 /**
21290  * Parameters for configuring [`ProbabilisticScorer`].
21291  *
21292  * Used to configure decay parameters that are static throughout the lifetime of the scorer.
21293  * these decay parameters affect the score of the channel penalty and are not changed on a
21294  * per-route penalty cost call.
21295  */
21296 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
21297    /**
21298     * A pointer to the opaque Rust object.
21299     * Nearly everywhere, inner must be non-null, however in places where
21300     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21301     */
21302    LDKnativeProbabilisticScoringDecayParameters *inner;
21303    /**
21304     * Indicates that this is the only struct which contains the same pointer.
21305     * Rust functions which take ownership of an object provided via an argument require
21306     * this to be true and invalidate the object pointed to by inner.
21307     */
21308    bool is_owned;
21309 } LDKProbabilisticScoringDecayParameters;
21310
21311
21312
21313 /**
21314  * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
21315  * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
21316  *
21317  * Your `node_id` is seed/0'.
21318  * Unilateral closes may use seed/1'.
21319  * Cooperative closes may use seed/2'.
21320  * The two close keys may be needed to claim on-chain funds!
21321  *
21322  * This struct cannot be used for nodes that wish to support receiving phantom payments;
21323  * [`PhantomKeysManager`] must be used instead.
21324  *
21325  * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
21326  * previously issued invoices and attempts to pay previous invoices will fail.
21327  */
21328 typedef struct MUST_USE_STRUCT LDKKeysManager {
21329    /**
21330     * A pointer to the opaque Rust object.
21331     * Nearly everywhere, inner must be non-null, however in places where
21332     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21333     */
21334    LDKnativeKeysManager *inner;
21335    /**
21336     * Indicates that this is the only struct which contains the same pointer.
21337     * Rust functions which take ownership of an object provided via an argument require
21338     * this to be true and invalidate the object pointed to by inner.
21339     */
21340    bool is_owned;
21341 } LDKKeysManager;
21342
21343
21344
21345 /**
21346  * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
21347  * payments.
21348  *
21349  * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
21350  * paid to one of multiple nodes. This works because we encode the invoice route hints such that
21351  * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
21352  * itself without ever needing to forward to this fake node.
21353  *
21354  * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
21355  * provide some fault tolerance, because payers will automatically retry paying other provided
21356  * nodes in the case that one node goes down.
21357  *
21358  * Note that multi-path payments are not supported in phantom invoices for security reasons.
21359  * Switching between this struct and [`KeysManager`] will invalidate any previously issued
21360  * invoices and attempts to pay previous invoices will fail.
21361  */
21362 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
21363    /**
21364     * A pointer to the opaque Rust object.
21365     * Nearly everywhere, inner must be non-null, however in places where
21366     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21367     */
21368    LDKnativePhantomKeysManager *inner;
21369    /**
21370     * Indicates that this is the only struct which contains the same pointer.
21371     * Rust functions which take ownership of an object provided via an argument require
21372     * this to be true and invalidate the object pointed to by inner.
21373     */
21374    bool is_owned;
21375 } LDKPhantomKeysManager;
21376
21377
21378
21379 /**
21380  * A sender, receiver and forwarder of [`OnionMessage`]s.
21381  *
21382  * # Handling Messages
21383  *
21384  * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
21385  * messages to peers or delegating to the appropriate handler for the message type. Currently, the
21386  * available handlers are:
21387  * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
21388  * * [`CustomOnionMessageHandler`], for handling user-defined message types
21389  *
21390  * # Sending Messages
21391  *
21392  * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
21393  * a message, the matched handler may return a response message which `OnionMessenger` will send
21394  * on its behalf.
21395  *
21396  * # Example
21397  *
21398  * ```
21399  * # extern crate bitcoin;
21400  * # use bitcoin::hashes::_export::_core::time::Duration;
21401  * # use bitcoin::hashes::hex::FromHex;
21402  * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
21403  * # use lightning::blinded_path::BlindedPath;
21404  * # use lightning::sign::{EntropySource, KeysManager};
21405  * # use lightning::ln::peer_handler::IgnoringMessageHandler;
21406  * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
21407  * # use lightning::onion_message::packet::OnionMessageContents;
21408  * # use lightning::util::logger::{Logger, Record};
21409  * # use lightning::util::ser::{Writeable, Writer};
21410  * # use lightning::io;
21411  * # use std::sync::Arc;
21412  * # struct FakeLogger;
21413  * # impl Logger for FakeLogger {
21414  * #     fn log(&self, record: Record) { println!(\"{:?}\" , record); }
21415  * # }
21416  * # struct FakeMessageRouter {}
21417  * # impl MessageRouter for FakeMessageRouter {
21418  * #     fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
21419  * #         let secp_ctx = Secp256k1::new();
21420  * #         let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
21421  * #         let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
21422  * #         let hop_node_id2 = hop_node_id1;
21423  * #         Ok(OnionMessagePath {
21424  * #             intermediate_nodes: vec![hop_node_id1, hop_node_id2],
21425  * #             destination,
21426  * #             first_node_addresses: None,
21427  * #         })
21428  * #     }
21429  * #     fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
21430  * #         &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
21431  * #     ) -> Result<Vec<BlindedPath>, ()> {
21432  * #         unreachable!()
21433  * #     }
21434  * # }
21435  * # let seed = [42u8; 32];
21436  * # let time = Duration::from_secs(123456);
21437  * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
21438  * # let logger = Arc::new(FakeLogger {});
21439  * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
21440  * # let secp_ctx = Secp256k1::new();
21441  * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
21442  * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
21443  * # let destination_node_id = hop_node_id1;
21444  * # let message_router = Arc::new(FakeMessageRouter {});
21445  * # let custom_message_handler = IgnoringMessageHandler {};
21446  * # let offers_message_handler = IgnoringMessageHandler {};
21447  * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
21448  * // ChannelManager.
21449  * let onion_messenger = OnionMessenger::new(
21450  *     &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
21451  *     &custom_message_handler
21452  * );
21453  *
21454  * # #[derive(Debug, Clone)]
21455  * # struct YourCustomMessage {}
21456  * impl Writeable for YourCustomMessage {
21457  * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
21458  * \t\t# Ok(())
21459  * \t\t// Write your custom onion message to `w`
21460  * \t}
21461  * }
21462  * impl OnionMessageContents for YourCustomMessage {
21463  * \tfn tlv_type(&self) -> u64 {
21464  * \t\t# let your_custom_message_type = 42;
21465  * \t\tyour_custom_message_type
21466  * \t}
21467  * }
21468  * // Send a custom onion message to a node id.
21469  * let destination = Destination::Node(destination_node_id);
21470  * let reply_path = None;
21471  * # let message = YourCustomMessage {};
21472  * onion_messenger.send_onion_message(message, destination, reply_path);
21473  *
21474  * // Create a blinded path to yourself, for someone to send an onion message to.
21475  * # let your_node_id = hop_node_id1;
21476  * let hops = [hop_node_id3, hop_node_id4, your_node_id];
21477  * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
21478  *
21479  * // Send a custom onion message to a blinded path.
21480  * let destination = Destination::BlindedPath(blinded_path);
21481  * let reply_path = None;
21482  * # let message = YourCustomMessage {};
21483  * onion_messenger.send_onion_message(message, destination, reply_path);
21484  * ```
21485  *
21486  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
21487  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
21488  */
21489 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
21490    /**
21491     * A pointer to the opaque Rust object.
21492     * Nearly everywhere, inner must be non-null, however in places where
21493     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21494     */
21495    LDKnativeOnionMessenger *inner;
21496    /**
21497     * Indicates that this is the only struct which contains the same pointer.
21498     * Rust functions which take ownership of an object provided via an argument require
21499     * this to be true and invalidate the object pointed to by inner.
21500     */
21501    bool is_owned;
21502 } LDKOnionMessenger;
21503
21504
21505
21506 /**
21507  * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
21508  */
21509 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
21510    /**
21511     * A pointer to the opaque Rust object.
21512     * Nearly everywhere, inner must be non-null, however in places where
21513     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21514     */
21515    LDKnativeDefaultMessageRouter *inner;
21516    /**
21517     * Indicates that this is the only struct which contains the same pointer.
21518     * Rust functions which take ownership of an object provided via an argument require
21519     * this to be true and invalidate the object pointed to by inner.
21520     */
21521    bool is_owned;
21522 } LDKDefaultMessageRouter;
21523
21524
21525
21526 /**
21527  * Data to construct a [`BlindedHop`] for forwarding a payment.
21528  */
21529 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
21530    /**
21531     * A pointer to the opaque Rust object.
21532     * Nearly everywhere, inner must be non-null, however in places where
21533     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21534     */
21535    LDKnativeForwardTlvs *inner;
21536    /**
21537     * Indicates that this is the only struct which contains the same pointer.
21538     * Rust functions which take ownership of an object provided via an argument require
21539     * this to be true and invalidate the object pointed to by inner.
21540     */
21541    bool is_owned;
21542 } LDKForwardTlvs;
21543
21544 /**
21545  * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
21546  * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
21547  * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
21548  * which can provide a default implementation of this trait when used with [`Wallet`].
21549  */
21550 typedef struct LDKCoinSelectionSource {
21551    /**
21552     * An opaque pointer which is passed to your function implementations as an argument.
21553     * This has no meaning in the LDK, and can be NULL or any other value.
21554     */
21555    void *this_arg;
21556    /**
21557     * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
21558     * available to spend. Implementations are free to pick their coin selection algorithm of
21559     * choice, as long as the following requirements are met:
21560     *
21561     * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
21562     *    throughout coin selection, but must not be returned as part of the result.
21563     * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
21564     *    throughout coin selection. In some cases, like when funding an anchor transaction, this
21565     *    set is empty. Implementations should ensure they handle this correctly on their end,
21566     *    e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
21567     *    provided, in which case a zero-value empty OP_RETURN output can be used instead.
21568     * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
21569     *    inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
21570     *
21571     * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
21572     * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
21573     * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
21574     * delaying block inclusion.
21575     *
21576     * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
21577     * can be re-used within new fee-bumped iterations of the original claiming transaction,
21578     * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
21579     * transaction associated with it, and all of the available UTXOs have already been assigned to
21580     * other claims, implementations must be willing to double spend their UTXOs. The choice of
21581     * which UTXOs to double spend is left to the implementation, but it must strive to keep the
21582     * set of other claims being double spent to a minimum.
21583     */
21584    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);
21585    /**
21586     * Signs and provides the full witness for all inputs within the transaction known to the
21587     * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
21588     *
21589     * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
21590     * unsigned transaction and then sign it with your wallet.
21591     */
21592    struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
21593    /**
21594     * Frees any resources associated with this object given its this_arg pointer.
21595     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21596     */
21597    void (*free)(void *this_arg);
21598 } LDKCoinSelectionSource;
21599
21600 /**
21601  * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
21602  * provide a default implementation to [`CoinSelectionSource`].
21603  */
21604 typedef struct LDKWalletSource {
21605    /**
21606     * An opaque pointer which is passed to your function implementations as an argument.
21607     * This has no meaning in the LDK, and can be NULL or any other value.
21608     */
21609    void *this_arg;
21610    /**
21611     * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
21612     */
21613    struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
21614    /**
21615     * Returns a script to use for change above dust resulting from a successful coin selection
21616     * attempt.
21617     */
21618    struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
21619    /**
21620     * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
21621     * the transaction known to the wallet (i.e., any provided via
21622     * [`WalletSource::list_confirmed_utxos`]).
21623     *
21624     * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
21625     * unsigned transaction and then sign it with your wallet.
21626     */
21627    struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
21628    /**
21629     * Frees any resources associated with this object given its this_arg pointer.
21630     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21631     */
21632    void (*free)(void *this_arg);
21633 } LDKWalletSource;
21634
21635
21636
21637 /**
21638  * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
21639  * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
21640  * spends may happen.
21641  */
21642 typedef struct MUST_USE_STRUCT LDKWallet {
21643    /**
21644     * A pointer to the opaque Rust object.
21645     * Nearly everywhere, inner must be non-null, however in places where
21646     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21647     */
21648    LDKnativeWallet *inner;
21649    /**
21650     * Indicates that this is the only struct which contains the same pointer.
21651     * Rust functions which take ownership of an object provided via an argument require
21652     * this to be true and invalidate the object pointed to by inner.
21653     */
21654    bool is_owned;
21655 } LDKWallet;
21656
21657
21658
21659 /**
21660  * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
21661  * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
21662  * Replace-By-Fee (RBF).
21663  *
21664  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
21665  */
21666 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
21667    /**
21668     * A pointer to the opaque Rust object.
21669     * Nearly everywhere, inner must be non-null, however in places where
21670     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21671     */
21672    LDKnativeBumpTransactionEventHandler *inner;
21673    /**
21674     * Indicates that this is the only struct which contains the same pointer.
21675     * Rust functions which take ownership of an object provided via an argument require
21676     * this to be true and invalidate the object pointed to by inner.
21677     */
21678    bool is_owned;
21679 } LDKBumpTransactionEventHandler;
21680
21681
21682
21683 /**
21684  * A [`KVStore`] implementation that writes to and reads from the file system.
21685  */
21686 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
21687    /**
21688     * A pointer to the opaque Rust object.
21689     * Nearly everywhere, inner must be non-null, however in places where
21690     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21691     */
21692    LDKnativeFilesystemStore *inner;
21693    /**
21694     * Indicates that this is the only struct which contains the same pointer.
21695     * Rust functions which take ownership of an object provided via an argument require
21696     * this to be true and invalidate the object pointed to by inner.
21697     */
21698    bool is_owned;
21699 } LDKFilesystemStore;
21700
21701
21702
21703 /**
21704  * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
21705  * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
21706  * responsibilities are:
21707  * * Processing [`Event`]s with a user-provided [`EventHandler`].
21708  * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
21709  *   writing it to disk/backups by invoking the callback given to it at startup.
21710  *   [`ChannelManager`] persistence should be done in the background.
21711  * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
21712  *   and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
21713  * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
21714  *   [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
21715  *
21716  * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
21717  * upon as doing so may result in high latency.
21718  *
21719  * # Note
21720  *
21721  * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
21722  * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
21723  * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
21724  * unilateral chain closure fees are at risk.
21725  *
21726  * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
21727  * [`Event`]: lightning::events::Event
21728  * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
21729  * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
21730  *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
21731  */
21732 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
21733    /**
21734     * A pointer to the opaque Rust object.
21735     * Nearly everywhere, inner must be non-null, however in places where
21736     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21737     */
21738    LDKnativeBackgroundProcessor *inner;
21739    /**
21740     * Indicates that this is the only struct which contains the same pointer.
21741     * Rust functions which take ownership of an object provided via an argument require
21742     * this to be true and invalidate the object pointed to by inner.
21743     */
21744    bool is_owned;
21745 } LDKBackgroundProcessor;
21746
21747
21748
21749 /**
21750  * The main Rapid Gossip Sync object.
21751  *
21752  * See [crate-level documentation] for usage.
21753  *
21754  * [crate-level documentation]: crate
21755  */
21756 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
21757    /**
21758     * A pointer to the opaque Rust object.
21759     * Nearly everywhere, inner must be non-null, however in places where
21760     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21761     */
21762    LDKnativeRapidGossipSync *inner;
21763    /**
21764     * Indicates that this is the only struct which contains the same pointer.
21765     * Rust functions which take ownership of an object provided via an argument require
21766     * this to be true and invalidate the object pointed to by inner.
21767     */
21768    bool is_owned;
21769 } LDKRapidGossipSync;
21770
21771 /**
21772  * Either [`P2PGossipSync`] or [`RapidGossipSync`].
21773  */
21774 typedef enum LDKGossipSync_Tag {
21775    /**
21776     * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
21777     */
21778    LDKGossipSync_P2P,
21779    /**
21780     * Rapid gossip sync from a trusted server.
21781     */
21782    LDKGossipSync_Rapid,
21783    /**
21784     * No gossip sync.
21785     */
21786    LDKGossipSync_None,
21787    /**
21788     * Must be last for serialization purposes
21789     */
21790    LDKGossipSync_Sentinel,
21791 } LDKGossipSync_Tag;
21792
21793 typedef struct MUST_USE_STRUCT LDKGossipSync {
21794    LDKGossipSync_Tag tag;
21795    union {
21796       struct {
21797          /**
21798           * Note that this field is expected to be a reference.
21799           */
21800          struct LDKP2PGossipSync p2p;
21801       };
21802       struct {
21803          /**
21804           * Note that this field is expected to be a reference.
21805           */
21806          struct LDKRapidGossipSync rapid;
21807       };
21808    };
21809 } LDKGossipSync;
21810
21811
21812
21813 /**
21814  * Data of the [`RawBolt11Invoice`] that is encoded in the data part
21815  */
21816 typedef struct MUST_USE_STRUCT LDKRawDataPart {
21817    /**
21818     * A pointer to the opaque Rust object.
21819     * Nearly everywhere, inner must be non-null, however in places where
21820     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21821     */
21822    LDKnativeRawDataPart *inner;
21823    /**
21824     * Indicates that this is the only struct which contains the same pointer.
21825     * Rust functions which take ownership of an object provided via an argument require
21826     * this to be true and invalidate the object pointed to by inner.
21827     */
21828    bool is_owned;
21829 } LDKRawDataPart;
21830
21831
21832
21833 /**
21834  * SHA-256 hash
21835  */
21836 typedef struct MUST_USE_STRUCT LDKSha256 {
21837    /**
21838     * A pointer to the opaque Rust object.
21839     * Nearly everywhere, inner must be non-null, however in places where
21840     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21841     */
21842    LDKnativeSha256 *inner;
21843    /**
21844     * Indicates that this is the only struct which contains the same pointer.
21845     * Rust functions which take ownership of an object provided via an argument require
21846     * this to be true and invalidate the object pointed to by inner.
21847     */
21848    bool is_owned;
21849 } LDKSha256;
21850
21851
21852
21853 /**
21854  * Positive duration that defines when (relatively to the timestamp) in the future the invoice
21855  * expires
21856  */
21857 typedef struct MUST_USE_STRUCT LDKExpiryTime {
21858    /**
21859     * A pointer to the opaque Rust object.
21860     * Nearly everywhere, inner must be non-null, however in places where
21861     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21862     */
21863    LDKnativeExpiryTime *inner;
21864    /**
21865     * Indicates that this is the only struct which contains the same pointer.
21866     * Rust functions which take ownership of an object provided via an argument require
21867     * this to be true and invalidate the object pointed to by inner.
21868     */
21869    bool is_owned;
21870 } LDKExpiryTime;
21871
21872
21873
21874 /**
21875  * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
21876  */
21877 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
21878    /**
21879     * A pointer to the opaque Rust object.
21880     * Nearly everywhere, inner must be non-null, however in places where
21881     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21882     */
21883    LDKnativeMinFinalCltvExpiryDelta *inner;
21884    /**
21885     * Indicates that this is the only struct which contains the same pointer.
21886     * Rust functions which take ownership of an object provided via an argument require
21887     * this to be true and invalidate the object pointed to by inner.
21888     */
21889    bool is_owned;
21890 } LDKMinFinalCltvExpiryDelta;
21891
21892 /**
21893  * A 20-byte byte array.
21894  */
21895 typedef struct LDKTwentyBytes {
21896    /**
21897     * The twenty bytes
21898     */
21899    uint8_t data[20];
21900 } LDKTwentyBytes;
21901
21902 /**
21903  * Fallback address in case no LN payment is possible
21904  */
21905 typedef enum LDKFallback_Tag {
21906    LDKFallback_SegWitProgram,
21907    LDKFallback_PubKeyHash,
21908    LDKFallback_ScriptHash,
21909    /**
21910     * Must be last for serialization purposes
21911     */
21912    LDKFallback_Sentinel,
21913 } LDKFallback_Tag;
21914
21915 typedef struct LDKFallback_LDKSegWitProgram_Body {
21916    struct LDKWitnessVersion version;
21917    struct LDKCVec_u8Z program;
21918 } LDKFallback_LDKSegWitProgram_Body;
21919
21920 typedef struct MUST_USE_STRUCT LDKFallback {
21921    LDKFallback_Tag tag;
21922    union {
21923       LDKFallback_LDKSegWitProgram_Body seg_wit_program;
21924       struct {
21925          struct LDKTwentyBytes pub_key_hash;
21926       };
21927       struct {
21928          struct LDKTwentyBytes script_hash;
21929       };
21930    };
21931 } LDKFallback;
21932
21933 extern const uintptr_t MAX_BUF_SIZE;
21934
21935 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
21936
21937 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
21938
21939 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
21940
21941 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
21942
21943 extern const uint32_t ANTI_REORG_DELAY;
21944
21945 extern const uint16_t BREAKDOWN_TIMEOUT;
21946
21947 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
21948
21949 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
21950
21951 extern const uint16_t MAX_HTLCS;
21952
21953 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
21954
21955 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
21956
21957 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
21958
21959 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
21960
21961 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
21962
21963 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
21964
21965 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
21966
21967 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
21968
21969 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
21970
21971 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
21972
21973 extern const uint64_t MAX_TIMESTAMP;
21974
21975 extern const uint64_t DEFAULT_EXPIRY_TIME;
21976
21977 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
21978
21979 extern const uint8_t TAG_PAYMENT_HASH;
21980
21981 extern const uint8_t TAG_DESCRIPTION;
21982
21983 extern const uint8_t TAG_PAYEE_PUB_KEY;
21984
21985 extern const uint8_t TAG_DESCRIPTION_HASH;
21986
21987 extern const uint8_t TAG_EXPIRY_TIME;
21988
21989 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
21990
21991 extern const uint8_t TAG_FALLBACK;
21992
21993 extern const uint8_t TAG_PRIVATE_ROUTE;
21994
21995 extern const uint8_t TAG_PAYMENT_SECRET;
21996
21997 extern const uint8_t TAG_PAYMENT_METADATA;
21998
21999 extern const uint8_t TAG_FEATURES;
22000
22001 struct LDKStr _ldk_get_compiled_version(void);
22002
22003 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
22004
22005 /**
22006  * Gets the 128-bit integer, as 16 little-endian bytes
22007  */
22008 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
22009
22010 /**
22011  * Constructs a new U128 from 16 little-endian bytes
22012  */
22013 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
22014
22015 /**
22016  * Constructs a new WitnessProgram given a version and program bytes.
22017  *
22018  * The program MUST be at least 2 bytes and no longer than 40 bytes long.
22019  * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
22020  */
22021 struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
22022
22023 /**
22024  * Gets the `WitnessVersion` of the given `WitnessProgram`
22025  */
22026 struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
22027
22028 /**
22029  * Gets the witness program bytes of the given `WitnessProgram`
22030  */
22031 struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
22032
22033 /**
22034  * Creates a new WitnessProgram which has the same data as `orig`
22035  */
22036 struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
22037
22038 /**
22039  * Releases any memory held by the given `WitnessProgram` (which is currently none)
22040  */
22041 void WitnessProgram_free(struct LDKWitnessProgram o);
22042
22043 /**
22044  * Convenience function for constructing a new BigEndianScalar
22045  */
22046 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
22047
22048 /**
22049  * Creates a new Bech32Error which has the same data as `orig`
22050  */
22051 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
22052
22053 /**
22054  * Releases any memory held by the given `Bech32Error` (which is currently none)
22055  */
22056 void Bech32Error_free(struct LDKBech32Error o);
22057
22058 /**
22059  * Frees the data buffer, if data_is_owned is set and datalen > 0.
22060  */
22061 void Transaction_free(struct LDKTransaction _res);
22062
22063 /**
22064  * Creates a new Witness which has the same data as `orig` but with a new buffer.
22065  */
22066 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
22067
22068 /**
22069  * Frees the data pointed to by data
22070  */
22071 void Witness_free(struct LDKWitness _res);
22072
22073 /**
22074  * Convenience function for constructing a new TxIn
22075  */
22076 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
22077
22078 /**
22079  * Gets the `witness` in the given `TxIn`.
22080  */
22081 struct LDKWitness TxIn_get_witness(const struct LDKTxIn *NONNULL_PTR txin);
22082
22083 /**
22084  * Gets the `script_sig` in the given `TxIn`.
22085  */
22086 struct LDKu8slice TxIn_get_script_sig(const struct LDKTxIn *NONNULL_PTR txin);
22087
22088 /**
22089  * Gets the `sequence` in the given `TxIn`.
22090  */
22091 uint32_t TxIn_get_sequence(const struct LDKTxIn *NONNULL_PTR txin);
22092
22093 /**
22094  * Gets the previous outpoint txid in the given `TxIn`.
22095  */
22096 struct LDKThirtyTwoBytes TxIn_get_previous_txid(const struct LDKTxIn *NONNULL_PTR txin);
22097
22098 /**
22099  * Gets the previout outpoint index in the given `TxIn`.
22100  */
22101 uint32_t TxIn_get_previous_vout(const struct LDKTxIn *NONNULL_PTR txin);
22102
22103 /**
22104  * Frees the witness and script_sig in a TxIn
22105  */
22106 void TxIn_free(struct LDKTxIn _res);
22107
22108 /**
22109  * Convenience function for constructing a new TxOut
22110  */
22111 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
22112
22113 /**
22114  * Gets the `script_pubkey` in the given `TxOut`.
22115  */
22116 struct LDKu8slice TxOut_get_script_pubkey(const struct LDKTxOut *NONNULL_PTR txout);
22117
22118 /**
22119  * Gets the value in the given `TxOut`.
22120  */
22121 uint64_t TxOut_get_value(const struct LDKTxOut *NONNULL_PTR txout);
22122
22123 /**
22124  * Frees the data pointed to by script_pubkey.
22125  */
22126 void TxOut_free(struct LDKTxOut _res);
22127
22128 /**
22129  * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
22130  */
22131 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
22132
22133 /**
22134  * Frees the data buffer, if chars_is_owned is set and len > 0.
22135  */
22136 void Str_free(struct LDKStr _res);
22137
22138 #if defined(LDK_DEBUG_BUILD)
22139 /**
22140  * This function exists for memory safety testing purposes. It should never be used in production
22141  * code
22142  */
22143 const void *__unmangle_inner_ptr(const void *ptr);
22144 #endif
22145
22146 /**
22147  * Constructs a new COption_u64Z containing a u64
22148  */
22149 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
22150
22151 /**
22152  * Constructs a new COption_u64Z containing nothing
22153  */
22154 struct LDKCOption_u64Z COption_u64Z_none(void);
22155
22156 /**
22157  * Frees any resources associated with the u64, if we are in the Some state
22158  */
22159 void COption_u64Z_free(struct LDKCOption_u64Z _res);
22160
22161 /**
22162  * Creates a new COption_u64Z which has the same data as `orig`
22163  * but with all dynamically-allocated buffers duplicated in new buffers.
22164  */
22165 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
22166
22167 /**
22168  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22169  */
22170 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
22171
22172 /**
22173  * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
22174  */
22175 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
22176
22177 /**
22178  * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
22179  */
22180 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
22181
22182 /**
22183  * Checks if the given object is currently in the success state
22184  */
22185 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
22186
22187 /**
22188  * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
22189  */
22190 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
22191
22192 /**
22193  * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
22194  * but with all dynamically-allocated buffers duplicated in new buffers.
22195  */
22196 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
22197
22198 /**
22199  * Creates a new CResult_RetryDecodeErrorZ in the success state.
22200  */
22201 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
22202
22203 /**
22204  * Creates a new CResult_RetryDecodeErrorZ in the error state.
22205  */
22206 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
22207
22208 /**
22209  * Checks if the given object is currently in the success state
22210  */
22211 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
22212
22213 /**
22214  * Frees any resources used by the CResult_RetryDecodeErrorZ.
22215  */
22216 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
22217
22218 /**
22219  * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
22220  * but with all dynamically-allocated buffers duplicated in new buffers.
22221  */
22222 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
22223
22224 /**
22225  * Creates a new CResult_NoneAPIErrorZ in the success state.
22226  */
22227 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
22228
22229 /**
22230  * Creates a new CResult_NoneAPIErrorZ in the error state.
22231  */
22232 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
22233
22234 /**
22235  * Checks if the given object is currently in the success state
22236  */
22237 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
22238
22239 /**
22240  * Frees any resources used by the CResult_NoneAPIErrorZ.
22241  */
22242 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
22243
22244 /**
22245  * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
22246  * but with all dynamically-allocated buffers duplicated in new buffers.
22247  */
22248 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
22249
22250 /**
22251  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22252  */
22253 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
22254
22255 /**
22256  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22257  */
22258 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
22259
22260 /**
22261  * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
22262  */
22263 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
22264
22265 /**
22266  * Constructs a new COption_ThirtyTwoBytesZ containing nothing
22267  */
22268 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
22269
22270 /**
22271  * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
22272  */
22273 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
22274
22275 /**
22276  * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
22277  * but with all dynamically-allocated buffers duplicated in new buffers.
22278  */
22279 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
22280
22281 /**
22282  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22283  */
22284 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
22285
22286 /**
22287  * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
22288  */
22289 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
22290
22291 /**
22292  * Constructs a new COption_CVec_u8ZZ containing nothing
22293  */
22294 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
22295
22296 /**
22297  * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
22298  */
22299 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
22300
22301 /**
22302  * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
22303  * but with all dynamically-allocated buffers duplicated in new buffers.
22304  */
22305 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
22306
22307 /**
22308  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
22309  */
22310 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
22311
22312 /**
22313  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
22314  */
22315 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
22316
22317 /**
22318  * Checks if the given object is currently in the success state
22319  */
22320 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
22321
22322 /**
22323  * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
22324  */
22325 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
22326
22327 /**
22328  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
22329  * but with all dynamically-allocated buffers duplicated in new buffers.
22330  */
22331 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
22332
22333 /**
22334  * Creates a new tuple which has the same data as `orig`
22335  * but with all dynamically-allocated buffers duplicated in new buffers.
22336  */
22337 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
22338
22339 /**
22340  * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
22341  */
22342 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
22343
22344 /**
22345  * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
22346  */
22347 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
22348
22349 /**
22350  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22351  */
22352 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
22353
22354 /**
22355  * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
22356  */
22357 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
22358
22359 /**
22360  * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
22361  */
22362 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
22363
22364 /**
22365  * Checks if the given object is currently in the success state
22366  */
22367 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
22368
22369 /**
22370  * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
22371  */
22372 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
22373
22374 /**
22375  * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
22376  * but with all dynamically-allocated buffers duplicated in new buffers.
22377  */
22378 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
22379
22380 /**
22381  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22382  */
22383 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
22384
22385 /**
22386  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
22387  */
22388 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
22389
22390 /**
22391  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
22392  */
22393 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
22394
22395 /**
22396  * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
22397  */
22398 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
22399
22400 /**
22401  * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
22402  * but with all dynamically-allocated buffers duplicated in new buffers.
22403  */
22404 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
22405
22406 /**
22407  * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
22408  */
22409 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
22410
22411 /**
22412  * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
22413  */
22414 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
22415
22416 /**
22417  * Checks if the given object is currently in the success state
22418  */
22419 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
22420
22421 /**
22422  * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
22423  */
22424 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
22425
22426 /**
22427  * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
22428  * but with all dynamically-allocated buffers duplicated in new buffers.
22429  */
22430 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
22431
22432 /**
22433  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
22434  */
22435 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
22436
22437 /**
22438  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
22439  */
22440 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
22441
22442 /**
22443  * Checks if the given object is currently in the success state
22444  */
22445 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
22446
22447 /**
22448  * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
22449  */
22450 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
22451
22452 /**
22453  * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
22454  * but with all dynamically-allocated buffers duplicated in new buffers.
22455  */
22456 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
22457
22458 /**
22459  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
22460  */
22461 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
22462
22463 /**
22464  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
22465  */
22466 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22467
22468 /**
22469  * Checks if the given object is currently in the success state
22470  */
22471 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
22472
22473 /**
22474  * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
22475  */
22476 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
22477
22478 /**
22479  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
22480  * but with all dynamically-allocated buffers duplicated in new buffers.
22481  */
22482 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
22483
22484 /**
22485  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
22486  */
22487 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
22488
22489 /**
22490  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
22491  */
22492 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22493
22494 /**
22495  * Checks if the given object is currently in the success state
22496  */
22497 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
22498
22499 /**
22500  * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
22501  */
22502 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
22503
22504 /**
22505  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
22506  * but with all dynamically-allocated buffers duplicated in new buffers.
22507  */
22508 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
22509
22510 /**
22511  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
22512  */
22513 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
22514
22515 /**
22516  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
22517  */
22518 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22519
22520 /**
22521  * Checks if the given object is currently in the success state
22522  */
22523 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
22524
22525 /**
22526  * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
22527  */
22528 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
22529
22530 /**
22531  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
22532  * but with all dynamically-allocated buffers duplicated in new buffers.
22533  */
22534 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
22535
22536 /**
22537  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22538  */
22539 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
22540
22541 /**
22542  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22543  */
22544 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
22545
22546 /**
22547  * Constructs a new COption_u32Z containing a u32
22548  */
22549 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
22550
22551 /**
22552  * Constructs a new COption_u32Z containing nothing
22553  */
22554 struct LDKCOption_u32Z COption_u32Z_none(void);
22555
22556 /**
22557  * Frees any resources associated with the u32, if we are in the Some state
22558  */
22559 void COption_u32Z_free(struct LDKCOption_u32Z _res);
22560
22561 /**
22562  * Creates a new COption_u32Z which has the same data as `orig`
22563  * but with all dynamically-allocated buffers duplicated in new buffers.
22564  */
22565 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
22566
22567 /**
22568  * Creates a new tuple which has the same data as `orig`
22569  * but with all dynamically-allocated buffers duplicated in new buffers.
22570  */
22571 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_clone(const struct LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR orig);
22572
22573 /**
22574  * Creates a new C2Tuple_CVec_u8Zu64Z from the contained elements.
22575  */
22576 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_new(struct LDKCVec_u8Z a, uint64_t b);
22577
22578 /**
22579  * Frees any resources used by the C2Tuple_CVec_u8Zu64Z.
22580  */
22581 void C2Tuple_CVec_u8Zu64Z_free(struct LDKC2Tuple_CVec_u8Zu64Z _res);
22582
22583 /**
22584  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state.
22585  */
22586 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(struct LDKC2Tuple_CVec_u8Zu64Z o);
22587
22588 /**
22589  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the error state.
22590  */
22591 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(void);
22592
22593 /**
22594  * Checks if the given object is currently in the success state
22595  */
22596 bool CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR o);
22597
22598 /**
22599  * Frees any resources used by the CResult_C2Tuple_CVec_u8Zu64ZNoneZ.
22600  */
22601 void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res);
22602
22603 /**
22604  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ which has the same data as `orig`
22605  * but with all dynamically-allocated buffers duplicated in new buffers.
22606  */
22607 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR orig);
22608
22609 /**
22610  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
22611  */
22612 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
22613
22614 /**
22615  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
22616  */
22617 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
22618
22619 /**
22620  * Checks if the given object is currently in the success state
22621  */
22622 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
22623
22624 /**
22625  * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
22626  */
22627 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
22628
22629 /**
22630  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
22631  * but with all dynamically-allocated buffers duplicated in new buffers.
22632  */
22633 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
22634
22635 /**
22636  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
22637  */
22638 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
22639
22640 /**
22641  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
22642  */
22643 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22644
22645 /**
22646  * Checks if the given object is currently in the success state
22647  */
22648 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
22649
22650 /**
22651  * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
22652  */
22653 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
22654
22655 /**
22656  * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
22657  * but with all dynamically-allocated buffers duplicated in new buffers.
22658  */
22659 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
22660
22661 /**
22662  * Creates a new CResult_NoneNoneZ in the success state.
22663  */
22664 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
22665
22666 /**
22667  * Creates a new CResult_NoneNoneZ in the error state.
22668  */
22669 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
22670
22671 /**
22672  * Checks if the given object is currently in the success state
22673  */
22674 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
22675
22676 /**
22677  * Frees any resources used by the CResult_NoneNoneZ.
22678  */
22679 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
22680
22681 /**
22682  * Creates a new CResult_NoneNoneZ which has the same data as `orig`
22683  * but with all dynamically-allocated buffers duplicated in new buffers.
22684  */
22685 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
22686
22687 /**
22688  * Creates a new CResult_PublicKeyNoneZ in the success state.
22689  */
22690 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
22691
22692 /**
22693  * Creates a new CResult_PublicKeyNoneZ in the error state.
22694  */
22695 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
22696
22697 /**
22698  * Checks if the given object is currently in the success state
22699  */
22700 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
22701
22702 /**
22703  * Frees any resources used by the CResult_PublicKeyNoneZ.
22704  */
22705 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
22706
22707 /**
22708  * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
22709  * but with all dynamically-allocated buffers duplicated in new buffers.
22710  */
22711 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
22712
22713 /**
22714  * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
22715  */
22716 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
22717
22718 /**
22719  * Constructs a new COption_BigEndianScalarZ containing nothing
22720  */
22721 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
22722
22723 /**
22724  * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
22725  */
22726 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
22727
22728 /**
22729  * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
22730  * but with all dynamically-allocated buffers duplicated in new buffers.
22731  */
22732 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
22733
22734 /**
22735  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22736  */
22737 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
22738
22739 /**
22740  * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
22741  */
22742 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
22743
22744 /**
22745  * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
22746  */
22747 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
22748
22749 /**
22750  * Checks if the given object is currently in the success state
22751  */
22752 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
22753
22754 /**
22755  * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
22756  */
22757 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
22758
22759 /**
22760  * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
22761  * but with all dynamically-allocated buffers duplicated in new buffers.
22762  */
22763 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
22764
22765 /**
22766  * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
22767  */
22768 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
22769
22770 /**
22771  * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
22772  */
22773 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
22774
22775 /**
22776  * Checks if the given object is currently in the success state
22777  */
22778 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
22779
22780 /**
22781  * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
22782  */
22783 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
22784
22785 /**
22786  * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
22787  * but with all dynamically-allocated buffers duplicated in new buffers.
22788  */
22789 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
22790
22791 /**
22792  * Creates a new CResult_ECDSASignatureNoneZ in the success state.
22793  */
22794 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
22795
22796 /**
22797  * Creates a new CResult_ECDSASignatureNoneZ in the error state.
22798  */
22799 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
22800
22801 /**
22802  * Checks if the given object is currently in the success state
22803  */
22804 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
22805
22806 /**
22807  * Frees any resources used by the CResult_ECDSASignatureNoneZ.
22808  */
22809 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
22810
22811 /**
22812  * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
22813  * but with all dynamically-allocated buffers duplicated in new buffers.
22814  */
22815 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
22816
22817 /**
22818  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
22819  */
22820 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
22821
22822 /**
22823  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
22824  */
22825 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
22826
22827 /**
22828  * Checks if the given object is currently in the success state
22829  */
22830 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
22831
22832 /**
22833  * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
22834  */
22835 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
22836
22837 /**
22838  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
22839  * but with all dynamically-allocated buffers duplicated in new buffers.
22840  */
22841 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
22842
22843 /**
22844  * Creates a new CResult_CVec_u8ZNoneZ in the success state.
22845  */
22846 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
22847
22848 /**
22849  * Creates a new CResult_CVec_u8ZNoneZ in the error state.
22850  */
22851 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
22852
22853 /**
22854  * Checks if the given object is currently in the success state
22855  */
22856 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
22857
22858 /**
22859  * Frees any resources used by the CResult_CVec_u8ZNoneZ.
22860  */
22861 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
22862
22863 /**
22864  * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
22865  * but with all dynamically-allocated buffers duplicated in new buffers.
22866  */
22867 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
22868
22869 /**
22870  * Creates a new CResult_ShutdownScriptNoneZ in the success state.
22871  */
22872 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
22873
22874 /**
22875  * Creates a new CResult_ShutdownScriptNoneZ in the error state.
22876  */
22877 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
22878
22879 /**
22880  * Checks if the given object is currently in the success state
22881  */
22882 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
22883
22884 /**
22885  * Frees any resources used by the CResult_ShutdownScriptNoneZ.
22886  */
22887 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
22888
22889 /**
22890  * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
22891  * but with all dynamically-allocated buffers duplicated in new buffers.
22892  */
22893 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
22894
22895 /**
22896  * Constructs a new COption_u16Z containing a u16
22897  */
22898 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
22899
22900 /**
22901  * Constructs a new COption_u16Z containing nothing
22902  */
22903 struct LDKCOption_u16Z COption_u16Z_none(void);
22904
22905 /**
22906  * Frees any resources associated with the u16, if we are in the Some state
22907  */
22908 void COption_u16Z_free(struct LDKCOption_u16Z _res);
22909
22910 /**
22911  * Creates a new COption_u16Z which has the same data as `orig`
22912  * but with all dynamically-allocated buffers duplicated in new buffers.
22913  */
22914 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
22915
22916 /**
22917  * Constructs a new COption_boolZ containing a bool
22918  */
22919 struct LDKCOption_boolZ COption_boolZ_some(bool o);
22920
22921 /**
22922  * Constructs a new COption_boolZ containing nothing
22923  */
22924 struct LDKCOption_boolZ COption_boolZ_none(void);
22925
22926 /**
22927  * Frees any resources associated with the bool, if we are in the Some state
22928  */
22929 void COption_boolZ_free(struct LDKCOption_boolZ _res);
22930
22931 /**
22932  * Creates a new COption_boolZ which has the same data as `orig`
22933  * but with all dynamically-allocated buffers duplicated in new buffers.
22934  */
22935 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
22936
22937 /**
22938  * Creates a new CResult_WitnessNoneZ in the success state.
22939  */
22940 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_ok(struct LDKWitness o);
22941
22942 /**
22943  * Creates a new CResult_WitnessNoneZ in the error state.
22944  */
22945 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_err(void);
22946
22947 /**
22948  * Checks if the given object is currently in the success state
22949  */
22950 bool CResult_WitnessNoneZ_is_ok(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR o);
22951
22952 /**
22953  * Frees any resources used by the CResult_WitnessNoneZ.
22954  */
22955 void CResult_WitnessNoneZ_free(struct LDKCResult_WitnessNoneZ _res);
22956
22957 /**
22958  * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
22959  * but with all dynamically-allocated buffers duplicated in new buffers.
22960  */
22961 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_clone(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR orig);
22962
22963 /**
22964  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22965  */
22966 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
22967
22968 /**
22969  * Creates a new tuple which has the same data as `orig`
22970  * but with all dynamically-allocated buffers duplicated in new buffers.
22971  */
22972 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
22973
22974 /**
22975  * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
22976  */
22977 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
22978
22979 /**
22980  * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
22981  */
22982 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
22983
22984 /**
22985  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
22986  */
22987 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
22988
22989 /**
22990  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
22991  */
22992 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
22993
22994 /**
22995  * Checks if the given object is currently in the success state
22996  */
22997 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
22998
22999 /**
23000  * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
23001  */
23002 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
23003
23004 /**
23005  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
23006  * but with all dynamically-allocated buffers duplicated in new buffers.
23007  */
23008 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
23009
23010 /**
23011  * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
23012  */
23013 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
23014
23015 /**
23016  * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
23017  */
23018 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
23019
23020 /**
23021  * Checks if the given object is currently in the success state
23022  */
23023 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
23024
23025 /**
23026  * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
23027  */
23028 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
23029
23030 /**
23031  * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
23032  * but with all dynamically-allocated buffers duplicated in new buffers.
23033  */
23034 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
23035
23036 /**
23037  * Creates a new CResult_TransactionNoneZ in the success state.
23038  */
23039 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
23040
23041 /**
23042  * Creates a new CResult_TransactionNoneZ in the error state.
23043  */
23044 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
23045
23046 /**
23047  * Checks if the given object is currently in the success state
23048  */
23049 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
23050
23051 /**
23052  * Frees any resources used by the CResult_TransactionNoneZ.
23053  */
23054 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
23055
23056 /**
23057  * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
23058  * but with all dynamically-allocated buffers duplicated in new buffers.
23059  */
23060 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
23061
23062 /**
23063  * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
23064  */
23065 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
23066
23067 /**
23068  * Constructs a new COption_WriteableScoreZ containing nothing
23069  */
23070 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
23071
23072 /**
23073  * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
23074  */
23075 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
23076
23077 /**
23078  * Creates a new CResult_NoneIOErrorZ in the success state.
23079  */
23080 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
23081
23082 /**
23083  * Creates a new CResult_NoneIOErrorZ in the error state.
23084  */
23085 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
23086
23087 /**
23088  * Checks if the given object is currently in the success state
23089  */
23090 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
23091
23092 /**
23093  * Frees any resources used by the CResult_NoneIOErrorZ.
23094  */
23095 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
23096
23097 /**
23098  * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
23099  * but with all dynamically-allocated buffers duplicated in new buffers.
23100  */
23101 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
23102
23103 /**
23104  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23105  */
23106 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
23107
23108 /**
23109  * Creates a new CResult_RouteLightningErrorZ in the success state.
23110  */
23111 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
23112
23113 /**
23114  * Creates a new CResult_RouteLightningErrorZ in the error state.
23115  */
23116 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
23117
23118 /**
23119  * Checks if the given object is currently in the success state
23120  */
23121 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
23122
23123 /**
23124  * Frees any resources used by the CResult_RouteLightningErrorZ.
23125  */
23126 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
23127
23128 /**
23129  * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
23130  * but with all dynamically-allocated buffers duplicated in new buffers.
23131  */
23132 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
23133
23134 /**
23135  * Creates a new tuple which has the same data as `orig`
23136  * but with all dynamically-allocated buffers duplicated in new buffers.
23137  */
23138 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
23139
23140 /**
23141  * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
23142  */
23143 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
23144
23145 /**
23146  * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
23147  */
23148 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
23149
23150 /**
23151  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23152  */
23153 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
23154
23155 /**
23156  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
23157  */
23158 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o);
23159
23160 /**
23161  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
23162  */
23163 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void);
23164
23165 /**
23166  * Checks if the given object is currently in the success state
23167  */
23168 bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o);
23169
23170 /**
23171  * Frees any resources used by the CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.
23172  */
23173 void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res);
23174
23175 /**
23176  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
23177  * but with all dynamically-allocated buffers duplicated in new buffers.
23178  */
23179 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig);
23180
23181 /**
23182  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23183  */
23184 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
23185
23186 /**
23187  * Creates a new CResult_OnionMessagePathNoneZ in the success state.
23188  */
23189 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
23190
23191 /**
23192  * Creates a new CResult_OnionMessagePathNoneZ in the error state.
23193  */
23194 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
23195
23196 /**
23197  * Checks if the given object is currently in the success state
23198  */
23199 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
23200
23201 /**
23202  * Frees any resources used by the CResult_OnionMessagePathNoneZ.
23203  */
23204 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
23205
23206 /**
23207  * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
23208  * but with all dynamically-allocated buffers duplicated in new buffers.
23209  */
23210 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
23211
23212 /**
23213  * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state.
23214  */
23215 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o);
23216
23217 /**
23218  * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state.
23219  */
23220 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void);
23221
23222 /**
23223  * Checks if the given object is currently in the success state
23224  */
23225 bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o);
23226
23227 /**
23228  * Frees any resources used by the CResult_CVec_BlindedPathZNoneZ.
23229  */
23230 void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res);
23231
23232 /**
23233  * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig`
23234  * but with all dynamically-allocated buffers duplicated in new buffers.
23235  */
23236 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig);
23237
23238 /**
23239  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
23240  */
23241 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
23242
23243 /**
23244  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
23245  */
23246 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
23247
23248 /**
23249  * Checks if the given object is currently in the success state
23250  */
23251 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
23252
23253 /**
23254  * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
23255  */
23256 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
23257
23258 /**
23259  * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
23260  * but with all dynamically-allocated buffers duplicated in new buffers.
23261  */
23262 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
23263
23264 /**
23265  * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
23266  */
23267 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
23268
23269 /**
23270  * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
23271  */
23272 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
23273
23274 /**
23275  * Checks if the given object is currently in the success state
23276  */
23277 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
23278
23279 /**
23280  * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
23281  */
23282 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
23283
23284 /**
23285  * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
23286  * but with all dynamically-allocated buffers duplicated in new buffers.
23287  */
23288 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
23289
23290 /**
23291  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23292  */
23293 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
23294
23295 /**
23296  * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
23297  */
23298 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
23299
23300 /**
23301  * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
23302  */
23303 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
23304
23305 /**
23306  * Checks if the given object is currently in the success state
23307  */
23308 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
23309
23310 /**
23311  * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
23312  */
23313 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
23314
23315 /**
23316  * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
23317  * but with all dynamically-allocated buffers duplicated in new buffers.
23318  */
23319 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
23320
23321 /**
23322  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23323  */
23324 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
23325
23326 /**
23327  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23328  */
23329 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
23330
23331 /**
23332  * Creates a new CResult_RouteDecodeErrorZ in the success state.
23333  */
23334 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
23335
23336 /**
23337  * Creates a new CResult_RouteDecodeErrorZ in the error state.
23338  */
23339 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
23340
23341 /**
23342  * Checks if the given object is currently in the success state
23343  */
23344 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
23345
23346 /**
23347  * Frees any resources used by the CResult_RouteDecodeErrorZ.
23348  */
23349 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
23350
23351 /**
23352  * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
23353  * but with all dynamically-allocated buffers duplicated in new buffers.
23354  */
23355 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
23356
23357 /**
23358  * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
23359  */
23360 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
23361
23362 /**
23363  * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
23364  */
23365 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
23366
23367 /**
23368  * Checks if the given object is currently in the success state
23369  */
23370 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
23371
23372 /**
23373  * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
23374  */
23375 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
23376
23377 /**
23378  * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
23379  * but with all dynamically-allocated buffers duplicated in new buffers.
23380  */
23381 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
23382
23383 /**
23384  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23385  */
23386 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
23387
23388 /**
23389  * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
23390  */
23391 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
23392
23393 /**
23394  * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
23395  */
23396 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
23397
23398 /**
23399  * Checks if the given object is currently in the success state
23400  */
23401 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
23402
23403 /**
23404  * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
23405  */
23406 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
23407
23408 /**
23409  * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
23410  * but with all dynamically-allocated buffers duplicated in new buffers.
23411  */
23412 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
23413
23414 /**
23415  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23416  */
23417 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
23418
23419 /**
23420  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23421  */
23422 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
23423
23424 /**
23425  * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
23426  */
23427 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
23428
23429 /**
23430  * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
23431  */
23432 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
23433
23434 /**
23435  * Checks if the given object is currently in the success state
23436  */
23437 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
23438
23439 /**
23440  * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
23441  */
23442 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
23443
23444 /**
23445  * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
23446  * but with all dynamically-allocated buffers duplicated in new buffers.
23447  */
23448 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
23449
23450 /**
23451  * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
23452  */
23453 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
23454
23455 /**
23456  * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
23457  */
23458 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
23459
23460 /**
23461  * Checks if the given object is currently in the success state
23462  */
23463 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
23464
23465 /**
23466  * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
23467  */
23468 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
23469
23470 /**
23471  * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
23472  * but with all dynamically-allocated buffers duplicated in new buffers.
23473  */
23474 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
23475
23476 /**
23477  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
23478  */
23479 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
23480
23481 /**
23482  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
23483  */
23484 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
23485
23486 /**
23487  * Checks if the given object is currently in the success state
23488  */
23489 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
23490
23491 /**
23492  * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
23493  */
23494 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
23495
23496 /**
23497  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
23498  * but with all dynamically-allocated buffers duplicated in new buffers.
23499  */
23500 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
23501
23502 /**
23503  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23504  */
23505 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
23506
23507 /**
23508  * Creates a new tuple which has the same data as `orig`
23509  * but with all dynamically-allocated buffers duplicated in new buffers.
23510  */
23511 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
23512
23513 /**
23514  * Creates a new C2Tuple_u64u64Z from the contained elements.
23515  */
23516 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
23517
23518 /**
23519  * Frees any resources used by the C2Tuple_u64u64Z.
23520  */
23521 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
23522
23523 /**
23524  * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
23525  */
23526 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
23527
23528 /**
23529  * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
23530  */
23531 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
23532
23533 /**
23534  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
23535  */
23536 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
23537
23538 /**
23539  * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
23540  * but with all dynamically-allocated buffers duplicated in new buffers.
23541  */
23542 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
23543
23544 /**
23545  * Creates a new C2Tuple_Z from the contained elements.
23546  */
23547 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
23548
23549 /**
23550  * Frees any resources used by the C2Tuple_Z.
23551  */
23552 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
23553
23554 /**
23555  * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
23556  */
23557 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
23558
23559 /**
23560  * Frees any resources used by the C2Tuple__u1632_u1632Z.
23561  */
23562 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
23563
23564 /**
23565  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
23566  */
23567 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
23568
23569 /**
23570  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
23571  */
23572 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
23573
23574 /**
23575  * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
23576  */
23577 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
23578
23579 /**
23580  * Constructs a new COption_f64Z containing a f64
23581  */
23582 struct LDKCOption_f64Z COption_f64Z_some(double o);
23583
23584 /**
23585  * Constructs a new COption_f64Z containing nothing
23586  */
23587 struct LDKCOption_f64Z COption_f64Z_none(void);
23588
23589 /**
23590  * Frees any resources associated with the f64, if we are in the Some state
23591  */
23592 void COption_f64Z_free(struct LDKCOption_f64Z _res);
23593
23594 /**
23595  * Creates a new COption_f64Z which has the same data as `orig`
23596  * but with all dynamically-allocated buffers duplicated in new buffers.
23597  */
23598 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
23599
23600 /**
23601  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
23602  */
23603 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
23604
23605 /**
23606  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
23607  */
23608 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
23609
23610 /**
23611  * Checks if the given object is currently in the success state
23612  */
23613 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
23614
23615 /**
23616  * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
23617  */
23618 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
23619
23620 /**
23621  * Creates a new tuple which has the same data as `orig`
23622  * but with all dynamically-allocated buffers duplicated in new buffers.
23623  */
23624 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
23625
23626 /**
23627  * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
23628  */
23629 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
23630
23631 /**
23632  * Frees any resources used by the C2Tuple_usizeTransactionZ.
23633  */
23634 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
23635
23636 /**
23637  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23638  */
23639 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
23640
23641 /**
23642  * Creates a new tuple which has the same data as `orig`
23643  * but with all dynamically-allocated buffers duplicated in new buffers.
23644  */
23645 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
23646
23647 /**
23648  * Creates a new C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ from the contained elements.
23649  */
23650 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, uint32_t b, struct LDKCOption_ThirtyTwoBytesZ c);
23651
23652 /**
23653  * Frees any resources used by the C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.
23654  */
23655 void C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res);
23656
23657 /**
23658  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23659  */
23660 void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res);
23661
23662 /**
23663  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
23664  */
23665 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
23666
23667 /**
23668  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
23669  */
23670 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
23671
23672 /**
23673  * Checks if the given object is currently in the success state
23674  */
23675 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
23676
23677 /**
23678  * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
23679  */
23680 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
23681
23682 /**
23683  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
23684  * but with all dynamically-allocated buffers duplicated in new buffers.
23685  */
23686 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
23687
23688 /**
23689  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23690  */
23691 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
23692
23693 /**
23694  * Creates a new tuple which has the same data as `orig`
23695  * but with all dynamically-allocated buffers duplicated in new buffers.
23696  */
23697 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
23698
23699 /**
23700  * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
23701  */
23702 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
23703
23704 /**
23705  * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
23706  */
23707 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
23708
23709 /**
23710  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23711  */
23712 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
23713
23714 /**
23715  * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
23716  */
23717 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
23718
23719 /**
23720  * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
23721  */
23722 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23723
23724 /**
23725  * Checks if the given object is currently in the success state
23726  */
23727 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
23728
23729 /**
23730  * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
23731  */
23732 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
23733
23734 /**
23735  * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
23736  * but with all dynamically-allocated buffers duplicated in new buffers.
23737  */
23738 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
23739
23740 /**
23741  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
23742  */
23743 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
23744
23745 /**
23746  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
23747  */
23748 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23749
23750 /**
23751  * Checks if the given object is currently in the success state
23752  */
23753 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
23754
23755 /**
23756  * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
23757  */
23758 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
23759
23760 /**
23761  * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
23762  * but with all dynamically-allocated buffers duplicated in new buffers.
23763  */
23764 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
23765
23766 /**
23767  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
23768  */
23769 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
23770
23771 /**
23772  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
23773  */
23774 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23775
23776 /**
23777  * Checks if the given object is currently in the success state
23778  */
23779 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
23780
23781 /**
23782  * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
23783  */
23784 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
23785
23786 /**
23787  * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
23788  * but with all dynamically-allocated buffers duplicated in new buffers.
23789  */
23790 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
23791
23792 /**
23793  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
23794  */
23795 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
23796
23797 /**
23798  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
23799  */
23800 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23801
23802 /**
23803  * Checks if the given object is currently in the success state
23804  */
23805 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
23806
23807 /**
23808  * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
23809  */
23810 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
23811
23812 /**
23813  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
23814  * but with all dynamically-allocated buffers duplicated in new buffers.
23815  */
23816 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
23817
23818 /**
23819  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
23820  */
23821 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
23822
23823 /**
23824  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
23825  */
23826 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23827
23828 /**
23829  * Checks if the given object is currently in the success state
23830  */
23831 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
23832
23833 /**
23834  * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
23835  */
23836 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
23837
23838 /**
23839  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
23840  * but with all dynamically-allocated buffers duplicated in new buffers.
23841  */
23842 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
23843
23844 /**
23845  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
23846  */
23847 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
23848
23849 /**
23850  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
23851  */
23852 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23853
23854 /**
23855  * Checks if the given object is currently in the success state
23856  */
23857 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
23858
23859 /**
23860  * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
23861  */
23862 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
23863
23864 /**
23865  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
23866  * but with all dynamically-allocated buffers duplicated in new buffers.
23867  */
23868 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
23869
23870 /**
23871  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
23872  */
23873 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
23874
23875 /**
23876  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
23877  */
23878 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23879
23880 /**
23881  * Checks if the given object is currently in the success state
23882  */
23883 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
23884
23885 /**
23886  * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
23887  */
23888 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
23889
23890 /**
23891  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
23892  * but with all dynamically-allocated buffers duplicated in new buffers.
23893  */
23894 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
23895
23896 /**
23897  * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
23898  */
23899 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
23900
23901 /**
23902  * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
23903  */
23904 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
23905
23906 /**
23907  * Checks if the given object is currently in the success state
23908  */
23909 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
23910
23911 /**
23912  * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
23913  */
23914 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
23915
23916 /**
23917  * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
23918  * but with all dynamically-allocated buffers duplicated in new buffers.
23919  */
23920 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
23921
23922 /**
23923  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
23924  */
23925 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
23926
23927 /**
23928  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
23929  */
23930 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
23931
23932 /**
23933  * Checks if the given object is currently in the success state
23934  */
23935 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
23936
23937 /**
23938  * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
23939  */
23940 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
23941
23942 /**
23943  * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
23944  * but with all dynamically-allocated buffers duplicated in new buffers.
23945  */
23946 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
23947
23948 /**
23949  * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
23950  */
23951 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
23952
23953 /**
23954  * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
23955  */
23956 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
23957
23958 /**
23959  * Checks if the given object is currently in the success state
23960  */
23961 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
23962
23963 /**
23964  * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
23965  */
23966 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
23967
23968 /**
23969  * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
23970  * but with all dynamically-allocated buffers duplicated in new buffers.
23971  */
23972 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
23973
23974 /**
23975  * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
23976  */
23977 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
23978
23979 /**
23980  * Constructs a new COption_NetworkUpdateZ containing nothing
23981  */
23982 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
23983
23984 /**
23985  * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
23986  */
23987 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
23988
23989 /**
23990  * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
23991  * but with all dynamically-allocated buffers duplicated in new buffers.
23992  */
23993 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
23994
23995 /**
23996  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
23997  */
23998 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
23999
24000 /**
24001  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
24002  */
24003 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
24004
24005 /**
24006  * Checks if the given object is currently in the success state
24007  */
24008 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
24009
24010 /**
24011  * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
24012  */
24013 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
24014
24015 /**
24016  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
24017  * but with all dynamically-allocated buffers duplicated in new buffers.
24018  */
24019 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
24020
24021 /**
24022  * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
24023  */
24024 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
24025
24026 /**
24027  * Constructs a new COption_UtxoLookupZ containing nothing
24028  */
24029 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
24030
24031 /**
24032  * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
24033  */
24034 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
24035
24036 /**
24037  * Creates a new CResult_NoneLightningErrorZ in the success state.
24038  */
24039 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
24040
24041 /**
24042  * Creates a new CResult_NoneLightningErrorZ in the error state.
24043  */
24044 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
24045
24046 /**
24047  * Checks if the given object is currently in the success state
24048  */
24049 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
24050
24051 /**
24052  * Frees any resources used by the CResult_NoneLightningErrorZ.
24053  */
24054 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
24055
24056 /**
24057  * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
24058  * but with all dynamically-allocated buffers duplicated in new buffers.
24059  */
24060 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
24061
24062 /**
24063  * Creates a new CResult_boolLightningErrorZ in the success state.
24064  */
24065 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
24066
24067 /**
24068  * Creates a new CResult_boolLightningErrorZ in the error state.
24069  */
24070 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
24071
24072 /**
24073  * Checks if the given object is currently in the success state
24074  */
24075 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
24076
24077 /**
24078  * Frees any resources used by the CResult_boolLightningErrorZ.
24079  */
24080 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
24081
24082 /**
24083  * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
24084  * but with all dynamically-allocated buffers duplicated in new buffers.
24085  */
24086 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
24087
24088 /**
24089  * Creates a new tuple which has the same data as `orig`
24090  * but with all dynamically-allocated buffers duplicated in new buffers.
24091  */
24092 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
24093
24094 /**
24095  * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
24096  */
24097 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
24098
24099 /**
24100  * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
24101  */
24102 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
24103
24104 /**
24105  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
24106  */
24107 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
24108
24109 /**
24110  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
24111  */
24112 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
24113
24114 /**
24115  * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
24116  */
24117 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
24118
24119 /**
24120  * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
24121  * but with all dynamically-allocated buffers duplicated in new buffers.
24122  */
24123 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
24124
24125 /**
24126  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24127  */
24128 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
24129
24130 /**
24131  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
24132  */
24133 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
24134
24135 /**
24136  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
24137  */
24138 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
24139
24140 /**
24141  * Checks if the given object is currently in the success state
24142  */
24143 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
24144
24145 /**
24146  * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
24147  */
24148 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
24149
24150 /**
24151  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
24152  * but with all dynamically-allocated buffers duplicated in new buffers.
24153  */
24154 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
24155
24156 /**
24157  * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
24158  */
24159 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
24160
24161 /**
24162  * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
24163  */
24164 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
24165
24166 /**
24167  * Checks if the given object is currently in the success state
24168  */
24169 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
24170
24171 /**
24172  * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
24173  */
24174 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
24175
24176 /**
24177  * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
24178  * but with all dynamically-allocated buffers duplicated in new buffers.
24179  */
24180 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
24181
24182 /**
24183  * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
24184  */
24185 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
24186
24187 /**
24188  * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
24189  */
24190 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
24191
24192 /**
24193  * Checks if the given object is currently in the success state
24194  */
24195 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
24196
24197 /**
24198  * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
24199  */
24200 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
24201
24202 /**
24203  * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
24204  * but with all dynamically-allocated buffers duplicated in new buffers.
24205  */
24206 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
24207
24208 /**
24209  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24210  */
24211 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
24212
24213 /**
24214  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
24215  */
24216 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
24217
24218 /**
24219  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
24220  */
24221 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
24222
24223 /**
24224  * Checks if the given object is currently in the success state
24225  */
24226 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
24227
24228 /**
24229  * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
24230  */
24231 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
24232
24233 /**
24234  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
24235  * but with all dynamically-allocated buffers duplicated in new buffers.
24236  */
24237 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
24238
24239 /**
24240  * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
24241  */
24242 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
24243
24244 /**
24245  * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
24246  */
24247 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
24248
24249 /**
24250  * Checks if the given object is currently in the success state
24251  */
24252 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
24253
24254 /**
24255  * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
24256  */
24257 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
24258
24259 /**
24260  * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
24261  * but with all dynamically-allocated buffers duplicated in new buffers.
24262  */
24263 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
24264
24265 /**
24266  * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
24267  */
24268 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
24269
24270 /**
24271  * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
24272  */
24273 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
24274
24275 /**
24276  * Checks if the given object is currently in the success state
24277  */
24278 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
24279
24280 /**
24281  * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
24282  */
24283 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
24284
24285 /**
24286  * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
24287  * but with all dynamically-allocated buffers duplicated in new buffers.
24288  */
24289 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
24290
24291 /**
24292  * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
24293  */
24294 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
24295
24296 /**
24297  * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
24298  */
24299 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
24300
24301 /**
24302  * Checks if the given object is currently in the success state
24303  */
24304 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
24305
24306 /**
24307  * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
24308  */
24309 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
24310
24311 /**
24312  * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
24313  */
24314 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
24315
24316 /**
24317  * Constructs a new COption_CVec_SocketAddressZZ containing nothing
24318  */
24319 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
24320
24321 /**
24322  * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
24323  */
24324 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
24325
24326 /**
24327  * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
24328  * but with all dynamically-allocated buffers duplicated in new buffers.
24329  */
24330 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
24331
24332 /**
24333  * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
24334  */
24335 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o);
24336
24337 /**
24338  * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
24339  */
24340 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e);
24341
24342 /**
24343  * Checks if the given object is currently in the success state
24344  */
24345 bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR o);
24346
24347 /**
24348  * Frees any resources used by the CResult_PendingHTLCInfoInboundHTLCErrZ.
24349  */
24350 void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res);
24351
24352 /**
24353  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24354  */
24355 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
24356
24357 /**
24358  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24359  */
24360 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
24361
24362 /**
24363  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24364  */
24365 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
24366
24367 /**
24368  * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
24369  */
24370 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
24371
24372 /**
24373  * Constructs a new COption_TxOutZ containing nothing
24374  */
24375 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
24376
24377 /**
24378  * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
24379  */
24380 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
24381
24382 /**
24383  * Creates a new COption_TxOutZ which has the same data as `orig`
24384  * but with all dynamically-allocated buffers duplicated in new buffers.
24385  */
24386 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
24387
24388 /**
24389  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24390  */
24391 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
24392
24393 /**
24394  * Creates a new CResult_CoinSelectionNoneZ in the success state.
24395  */
24396 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
24397
24398 /**
24399  * Creates a new CResult_CoinSelectionNoneZ in the error state.
24400  */
24401 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
24402
24403 /**
24404  * Checks if the given object is currently in the success state
24405  */
24406 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
24407
24408 /**
24409  * Frees any resources used by the CResult_CoinSelectionNoneZ.
24410  */
24411 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
24412
24413 /**
24414  * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
24415  * but with all dynamically-allocated buffers duplicated in new buffers.
24416  */
24417 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
24418
24419 /**
24420  * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
24421  */
24422 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
24423
24424 /**
24425  * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
24426  */
24427 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
24428
24429 /**
24430  * Checks if the given object is currently in the success state
24431  */
24432 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
24433
24434 /**
24435  * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
24436  */
24437 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
24438
24439 /**
24440  * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
24441  * but with all dynamically-allocated buffers duplicated in new buffers.
24442  */
24443 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
24444
24445 /**
24446  * Creates a new tuple which has the same data as `orig`
24447  * but with all dynamically-allocated buffers duplicated in new buffers.
24448  */
24449 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
24450
24451 /**
24452  * Creates a new C2Tuple_u64u16Z from the contained elements.
24453  */
24454 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
24455
24456 /**
24457  * Frees any resources used by the C2Tuple_u64u16Z.
24458  */
24459 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
24460
24461 /**
24462  * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
24463  */
24464 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
24465
24466 /**
24467  * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
24468  */
24469 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
24470
24471 /**
24472  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
24473  */
24474 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
24475
24476 /**
24477  * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
24478  * but with all dynamically-allocated buffers duplicated in new buffers.
24479  */
24480 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
24481
24482 /**
24483  * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
24484  */
24485 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
24486
24487 /**
24488  * Constructs a new COption_ChannelShutdownStateZ containing nothing
24489  */
24490 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
24491
24492 /**
24493  * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
24494  */
24495 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
24496
24497 /**
24498  * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
24499  * but with all dynamically-allocated buffers duplicated in new buffers.
24500  */
24501 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
24502
24503 /**
24504  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
24505  */
24506 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
24507
24508 /**
24509  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
24510  */
24511 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
24512
24513 /**
24514  * Checks if the given object is currently in the success state
24515  */
24516 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
24517
24518 /**
24519  * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
24520  */
24521 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
24522
24523 /**
24524  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
24525  * but with all dynamically-allocated buffers duplicated in new buffers.
24526  */
24527 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
24528
24529 /**
24530  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24531  */
24532 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
24533
24534 /**
24535  * Creates a new CResult_NonePaymentSendFailureZ in the success state.
24536  */
24537 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
24538
24539 /**
24540  * Creates a new CResult_NonePaymentSendFailureZ in the error state.
24541  */
24542 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
24543
24544 /**
24545  * Checks if the given object is currently in the success state
24546  */
24547 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
24548
24549 /**
24550  * Frees any resources used by the CResult_NonePaymentSendFailureZ.
24551  */
24552 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
24553
24554 /**
24555  * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
24556  * but with all dynamically-allocated buffers duplicated in new buffers.
24557  */
24558 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
24559
24560 /**
24561  * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
24562  */
24563 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
24564
24565 /**
24566  * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
24567  */
24568 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
24569
24570 /**
24571  * Checks if the given object is currently in the success state
24572  */
24573 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
24574
24575 /**
24576  * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
24577  */
24578 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
24579
24580 /**
24581  * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
24582  * but with all dynamically-allocated buffers duplicated in new buffers.
24583  */
24584 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
24585
24586 /**
24587  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
24588  */
24589 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
24590
24591 /**
24592  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
24593  */
24594 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
24595
24596 /**
24597  * Checks if the given object is currently in the success state
24598  */
24599 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
24600
24601 /**
24602  * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
24603  */
24604 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
24605
24606 /**
24607  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
24608  * but with all dynamically-allocated buffers duplicated in new buffers.
24609  */
24610 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
24611
24612 /**
24613  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
24614  */
24615 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
24616
24617 /**
24618  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
24619  */
24620 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
24621
24622 /**
24623  * Checks if the given object is currently in the success state
24624  */
24625 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
24626
24627 /**
24628  * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
24629  */
24630 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
24631
24632 /**
24633  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
24634  * but with all dynamically-allocated buffers duplicated in new buffers.
24635  */
24636 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
24637
24638 /**
24639  * Creates a new tuple which has the same data as `orig`
24640  * but with all dynamically-allocated buffers duplicated in new buffers.
24641  */
24642 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
24643
24644 /**
24645  * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
24646  */
24647 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
24648
24649 /**
24650  * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
24651  */
24652 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
24653
24654 /**
24655  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
24656  */
24657 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
24658
24659 /**
24660  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
24661  */
24662 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
24663
24664 /**
24665  * Checks if the given object is currently in the success state
24666  */
24667 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
24668
24669 /**
24670  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
24671  */
24672 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
24673
24674 /**
24675  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
24676  * but with all dynamically-allocated buffers duplicated in new buffers.
24677  */
24678 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
24679
24680 /**
24681  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24682  */
24683 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
24684
24685 /**
24686  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
24687  */
24688 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
24689
24690 /**
24691  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
24692  */
24693 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
24694
24695 /**
24696  * Checks if the given object is currently in the success state
24697  */
24698 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
24699
24700 /**
24701  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
24702  */
24703 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
24704
24705 /**
24706  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
24707  * but with all dynamically-allocated buffers duplicated in new buffers.
24708  */
24709 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
24710
24711 /**
24712  * Creates a new tuple which has the same data as `orig`
24713  * but with all dynamically-allocated buffers duplicated in new buffers.
24714  */
24715 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR orig);
24716
24717 /**
24718  * Creates a new C2Tuple_ThirtyTwoBytesPublicKeyZ from the contained elements.
24719  */
24720 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_new(struct LDKThirtyTwoBytes a, struct LDKPublicKey b);
24721
24722 /**
24723  * Frees any resources used by the C2Tuple_ThirtyTwoBytesPublicKeyZ.
24724  */
24725 void C2Tuple_ThirtyTwoBytesPublicKeyZ_free(struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res);
24726
24727 /**
24728  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24729  */
24730 void CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res);
24731
24732 /**
24733  * Constructs a new COption_StrZ containing a crate::c_types::Str
24734  */
24735 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
24736
24737 /**
24738  * Constructs a new COption_StrZ containing nothing
24739  */
24740 struct LDKCOption_StrZ COption_StrZ_none(void);
24741
24742 /**
24743  * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
24744  */
24745 void COption_StrZ_free(struct LDKCOption_StrZ _res);
24746
24747 /**
24748  * Creates a new COption_StrZ which has the same data as `orig`
24749  * but with all dynamically-allocated buffers duplicated in new buffers.
24750  */
24751 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
24752
24753 /**
24754  * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
24755  */
24756 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
24757
24758 /**
24759  * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
24760  */
24761 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
24762
24763 /**
24764  * Checks if the given object is currently in the success state
24765  */
24766 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
24767
24768 /**
24769  * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
24770  */
24771 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
24772
24773 /**
24774  * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
24775  * but with all dynamically-allocated buffers duplicated in new buffers.
24776  */
24777 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
24778
24779 /**
24780  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
24781  */
24782 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
24783
24784 /**
24785  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
24786  */
24787 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
24788
24789 /**
24790  * Checks if the given object is currently in the success state
24791  */
24792 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
24793
24794 /**
24795  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
24796  */
24797 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
24798
24799 /**
24800  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
24801  * but with all dynamically-allocated buffers duplicated in new buffers.
24802  */
24803 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
24804
24805 /**
24806  * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
24807  */
24808 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
24809
24810 /**
24811  * Constructs a new COption_OffersMessageZ containing nothing
24812  */
24813 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
24814
24815 /**
24816  * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
24817  */
24818 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
24819
24820 /**
24821  * Creates a new COption_OffersMessageZ which has the same data as `orig`
24822  * but with all dynamically-allocated buffers duplicated in new buffers.
24823  */
24824 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
24825
24826 /**
24827  * Creates a new tuple which has the same data as `orig`
24828  * but with all dynamically-allocated buffers duplicated in new buffers.
24829  */
24830 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
24831
24832 /**
24833  * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
24834  */
24835 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
24836
24837 /**
24838  * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
24839  */
24840 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
24841
24842 /**
24843  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24844  */
24845 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
24846
24847 /**
24848  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
24849  */
24850 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
24851
24852 /**
24853  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
24854  */
24855 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
24856
24857 /**
24858  * Checks if the given object is currently in the success state
24859  */
24860 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
24861
24862 /**
24863  * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
24864  */
24865 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
24866
24867 /**
24868  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
24869  * but with all dynamically-allocated buffers duplicated in new buffers.
24870  */
24871 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
24872
24873 /**
24874  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
24875  */
24876 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
24877
24878 /**
24879  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
24880  */
24881 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
24882
24883 /**
24884  * Checks if the given object is currently in the success state
24885  */
24886 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
24887
24888 /**
24889  * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
24890  */
24891 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
24892
24893 /**
24894  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
24895  * but with all dynamically-allocated buffers duplicated in new buffers.
24896  */
24897 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
24898
24899 /**
24900  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
24901  */
24902 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
24903
24904 /**
24905  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
24906  */
24907 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
24908
24909 /**
24910  * Checks if the given object is currently in the success state
24911  */
24912 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
24913
24914 /**
24915  * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
24916  */
24917 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
24918
24919 /**
24920  * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
24921  * but with all dynamically-allocated buffers duplicated in new buffers.
24922  */
24923 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
24924
24925 /**
24926  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
24927  */
24928 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
24929
24930 /**
24931  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
24932  */
24933 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
24934
24935 /**
24936  * Checks if the given object is currently in the success state
24937  */
24938 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
24939
24940 /**
24941  * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
24942  */
24943 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
24944
24945 /**
24946  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
24947  * but with all dynamically-allocated buffers duplicated in new buffers.
24948  */
24949 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
24950
24951 /**
24952  * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state.
24953  */
24954 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_ok(struct LDKBlindedForward o);
24955
24956 /**
24957  * Creates a new CResult_BlindedForwardDecodeErrorZ in the error state.
24958  */
24959 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_err(struct LDKDecodeError e);
24960
24961 /**
24962  * Checks if the given object is currently in the success state
24963  */
24964 bool CResult_BlindedForwardDecodeErrorZ_is_ok(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR o);
24965
24966 /**
24967  * Frees any resources used by the CResult_BlindedForwardDecodeErrorZ.
24968  */
24969 void CResult_BlindedForwardDecodeErrorZ_free(struct LDKCResult_BlindedForwardDecodeErrorZ _res);
24970
24971 /**
24972  * Creates a new CResult_BlindedForwardDecodeErrorZ which has the same data as `orig`
24973  * but with all dynamically-allocated buffers duplicated in new buffers.
24974  */
24975 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_clone(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR orig);
24976
24977 /**
24978  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the success state.
24979  */
24980 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_ok(struct LDKPendingHTLCRouting o);
24981
24982 /**
24983  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the error state.
24984  */
24985 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_err(struct LDKDecodeError e);
24986
24987 /**
24988  * Checks if the given object is currently in the success state
24989  */
24990 bool CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR o);
24991
24992 /**
24993  * Frees any resources used by the CResult_PendingHTLCRoutingDecodeErrorZ.
24994  */
24995 void CResult_PendingHTLCRoutingDecodeErrorZ_free(struct LDKCResult_PendingHTLCRoutingDecodeErrorZ _res);
24996
24997 /**
24998  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ which has the same data as `orig`
24999  * but with all dynamically-allocated buffers duplicated in new buffers.
25000  */
25001 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR orig);
25002
25003 /**
25004  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
25005  */
25006 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_ok(struct LDKPendingHTLCInfo o);
25007
25008 /**
25009  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
25010  */
25011 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_err(struct LDKDecodeError e);
25012
25013 /**
25014  * Checks if the given object is currently in the success state
25015  */
25016 bool CResult_PendingHTLCInfoDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR o);
25017
25018 /**
25019  * Frees any resources used by the CResult_PendingHTLCInfoDecodeErrorZ.
25020  */
25021 void CResult_PendingHTLCInfoDecodeErrorZ_free(struct LDKCResult_PendingHTLCInfoDecodeErrorZ _res);
25022
25023 /**
25024  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
25025  * but with all dynamically-allocated buffers duplicated in new buffers.
25026  */
25027 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR orig);
25028
25029 /**
25030  * Creates a new CResult_BlindedFailureDecodeErrorZ in the success state.
25031  */
25032 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_ok(enum LDKBlindedFailure o);
25033
25034 /**
25035  * Creates a new CResult_BlindedFailureDecodeErrorZ in the error state.
25036  */
25037 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_err(struct LDKDecodeError e);
25038
25039 /**
25040  * Checks if the given object is currently in the success state
25041  */
25042 bool CResult_BlindedFailureDecodeErrorZ_is_ok(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR o);
25043
25044 /**
25045  * Frees any resources used by the CResult_BlindedFailureDecodeErrorZ.
25046  */
25047 void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDecodeErrorZ _res);
25048
25049 /**
25050  * Creates a new CResult_BlindedFailureDecodeErrorZ which has the same data as `orig`
25051  * but with all dynamically-allocated buffers duplicated in new buffers.
25052  */
25053 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
25054
25055 /**
25056  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
25057  */
25058 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
25059
25060 /**
25061  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
25062  */
25063 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
25064
25065 /**
25066  * Checks if the given object is currently in the success state
25067  */
25068 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
25069
25070 /**
25071  * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
25072  */
25073 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
25074
25075 /**
25076  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
25077  * but with all dynamically-allocated buffers duplicated in new buffers.
25078  */
25079 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
25080
25081 /**
25082  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25083  */
25084 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
25085
25086 /**
25087  * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
25088  */
25089 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
25090
25091 /**
25092  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
25093  */
25094 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
25095
25096 /**
25097  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
25098  */
25099 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
25100
25101 /**
25102  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
25103  */
25104 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
25105
25106 /**
25107  * Checks if the given object is currently in the success state
25108  */
25109 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
25110
25111 /**
25112  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
25113  */
25114 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
25115
25116 /**
25117  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
25118  */
25119 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
25120
25121 /**
25122  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
25123  */
25124 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
25125
25126 /**
25127  * Checks if the given object is currently in the success state
25128  */
25129 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
25130
25131 /**
25132  * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
25133  */
25134 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
25135
25136 /**
25137  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
25138  * but with all dynamically-allocated buffers duplicated in new buffers.
25139  */
25140 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
25141
25142 /**
25143  * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
25144  */
25145 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
25146
25147 /**
25148  * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
25149  */
25150 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
25151
25152 /**
25153  * Checks if the given object is currently in the success state
25154  */
25155 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
25156
25157 /**
25158  * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
25159  */
25160 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
25161
25162 /**
25163  * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
25164  * but with all dynamically-allocated buffers duplicated in new buffers.
25165  */
25166 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
25167
25168 /**
25169  * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
25170  */
25171 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
25172
25173 /**
25174  * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
25175  */
25176 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
25177
25178 /**
25179  * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
25180  */
25181 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
25182
25183 /**
25184  * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
25185  * but with all dynamically-allocated buffers duplicated in new buffers.
25186  */
25187 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
25188
25189 /**
25190  * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
25191  */
25192 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
25193
25194 /**
25195  * Constructs a new COption_APIErrorZ containing nothing
25196  */
25197 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
25198
25199 /**
25200  * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
25201  */
25202 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
25203
25204 /**
25205  * Creates a new COption_APIErrorZ which has the same data as `orig`
25206  * but with all dynamically-allocated buffers duplicated in new buffers.
25207  */
25208 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
25209
25210 /**
25211  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
25212  */
25213 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
25214
25215 /**
25216  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
25217  */
25218 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
25219
25220 /**
25221  * Checks if the given object is currently in the success state
25222  */
25223 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
25224
25225 /**
25226  * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
25227  */
25228 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
25229
25230 /**
25231  * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
25232  * but with all dynamically-allocated buffers duplicated in new buffers.
25233  */
25234 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
25235
25236 /**
25237  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
25238  */
25239 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
25240
25241 /**
25242  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
25243  */
25244 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
25245
25246 /**
25247  * Checks if the given object is currently in the success state
25248  */
25249 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
25250
25251 /**
25252  * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
25253  */
25254 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
25255
25256 /**
25257  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
25258  * but with all dynamically-allocated buffers duplicated in new buffers.
25259  */
25260 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
25261
25262 /**
25263  * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
25264  */
25265 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
25266
25267 /**
25268  * Constructs a new COption_MonitorEventZ containing nothing
25269  */
25270 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
25271
25272 /**
25273  * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
25274  */
25275 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
25276
25277 /**
25278  * Creates a new COption_MonitorEventZ which has the same data as `orig`
25279  * but with all dynamically-allocated buffers duplicated in new buffers.
25280  */
25281 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
25282
25283 /**
25284  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
25285  */
25286 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
25287
25288 /**
25289  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
25290  */
25291 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
25292
25293 /**
25294  * Checks if the given object is currently in the success state
25295  */
25296 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
25297
25298 /**
25299  * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
25300  */
25301 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
25302
25303 /**
25304  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
25305  * but with all dynamically-allocated buffers duplicated in new buffers.
25306  */
25307 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
25308
25309 /**
25310  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
25311  */
25312 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
25313
25314 /**
25315  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
25316  */
25317 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
25318
25319 /**
25320  * Checks if the given object is currently in the success state
25321  */
25322 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
25323
25324 /**
25325  * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
25326  */
25327 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
25328
25329 /**
25330  * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
25331  * but with all dynamically-allocated buffers duplicated in new buffers.
25332  */
25333 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
25334
25335 /**
25336  * Creates a new tuple which has the same data as `orig`
25337  * but with all dynamically-allocated buffers duplicated in new buffers.
25338  */
25339 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
25340
25341 /**
25342  * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
25343  */
25344 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
25345
25346 /**
25347  * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
25348  */
25349 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
25350
25351 /**
25352  * Creates a new tuple which has the same data as `orig`
25353  * but with all dynamically-allocated buffers duplicated in new buffers.
25354  */
25355 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
25356
25357 /**
25358  * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
25359  */
25360 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
25361
25362 /**
25363  * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
25364  */
25365 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
25366
25367 /**
25368  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25369  */
25370 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
25371
25372 /**
25373  * Creates a new tuple which has the same data as `orig`
25374  * but with all dynamically-allocated buffers duplicated in new buffers.
25375  */
25376 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
25377
25378 /**
25379  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
25380  */
25381 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
25382
25383 /**
25384  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
25385  */
25386 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
25387
25388 /**
25389  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25390  */
25391 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
25392
25393 /**
25394  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25395  */
25396 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
25397
25398 /**
25399  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25400  */
25401 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
25402
25403 /**
25404  * Creates a new tuple which has the same data as `orig`
25405  * but with all dynamically-allocated buffers duplicated in new buffers.
25406  */
25407 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
25408
25409 /**
25410  * Creates a new C2Tuple_u32TxOutZ from the contained elements.
25411  */
25412 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
25413
25414 /**
25415  * Frees any resources used by the C2Tuple_u32TxOutZ.
25416  */
25417 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
25418
25419 /**
25420  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25421  */
25422 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
25423
25424 /**
25425  * Creates a new tuple which has the same data as `orig`
25426  * but with all dynamically-allocated buffers duplicated in new buffers.
25427  */
25428 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
25429
25430 /**
25431  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
25432  */
25433 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
25434
25435 /**
25436  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
25437  */
25438 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
25439
25440 /**
25441  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25442  */
25443 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
25444
25445 /**
25446  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25447  */
25448 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
25449
25450 /**
25451  * Creates a new tuple which has the same data as `orig`
25452  * but with all dynamically-allocated buffers duplicated in new buffers.
25453  */
25454 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
25455
25456 /**
25457  * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
25458  */
25459 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
25460
25461 /**
25462  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
25463  */
25464 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
25465
25466 /**
25467  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
25468  */
25469 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
25470
25471 /**
25472  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
25473  */
25474 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
25475
25476 /**
25477  * Checks if the given object is currently in the success state
25478  */
25479 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
25480
25481 /**
25482  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
25483  */
25484 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
25485
25486 /**
25487  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
25488  * but with all dynamically-allocated buffers duplicated in new buffers.
25489  */
25490 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
25491
25492 /**
25493  * Creates a new tuple which has the same data as `orig`
25494  * but with all dynamically-allocated buffers duplicated in new buffers.
25495  */
25496 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
25497
25498 /**
25499  * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
25500  */
25501 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
25502
25503 /**
25504  * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
25505  */
25506 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
25507
25508 /**
25509  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25510  */
25511 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
25512
25513 /**
25514  * Creates a new tuple which has the same data as `orig`
25515  * but with all dynamically-allocated buffers duplicated in new buffers.
25516  */
25517 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig);
25518
25519 /**
25520  * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements.
25521  */
25522 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b);
25523
25524 /**
25525  * Frees any resources used by the C2Tuple_PublicKeyCVec_SocketAddressZZ.
25526  */
25527 void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res);
25528
25529 /**
25530  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25531  */
25532 void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res);
25533
25534 /**
25535  * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
25536  */
25537 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
25538
25539 /**
25540  * Constructs a new COption_OnionMessageContentsZ containing nothing
25541  */
25542 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
25543
25544 /**
25545  * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
25546  */
25547 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
25548
25549 /**
25550  * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
25551  * but with all dynamically-allocated buffers duplicated in new buffers.
25552  */
25553 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
25554
25555 /**
25556  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
25557  */
25558 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
25559
25560 /**
25561  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
25562  */
25563 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
25564
25565 /**
25566  * Checks if the given object is currently in the success state
25567  */
25568 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
25569
25570 /**
25571  * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
25572  */
25573 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
25574
25575 /**
25576  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
25577  * but with all dynamically-allocated buffers duplicated in new buffers.
25578  */
25579 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
25580
25581 /**
25582  * Creates a new tuple which has the same data as `orig`
25583  * but with all dynamically-allocated buffers duplicated in new buffers.
25584  */
25585 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
25586
25587 /**
25588  * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
25589  */
25590 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
25591
25592 /**
25593  * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
25594  */
25595 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
25596
25597 /**
25598  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25599  */
25600 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
25601
25602 /**
25603  * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
25604  */
25605 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
25606
25607 /**
25608  * Constructs a new COption_TypeZ containing nothing
25609  */
25610 struct LDKCOption_TypeZ COption_TypeZ_none(void);
25611
25612 /**
25613  * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
25614  */
25615 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
25616
25617 /**
25618  * Creates a new COption_TypeZ which has the same data as `orig`
25619  * but with all dynamically-allocated buffers duplicated in new buffers.
25620  */
25621 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
25622
25623 /**
25624  * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
25625  */
25626 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
25627
25628 /**
25629  * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
25630  */
25631 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
25632
25633 /**
25634  * Checks if the given object is currently in the success state
25635  */
25636 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
25637
25638 /**
25639  * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
25640  */
25641 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
25642
25643 /**
25644  * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
25645  * but with all dynamically-allocated buffers duplicated in new buffers.
25646  */
25647 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
25648
25649 /**
25650  * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
25651  */
25652 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
25653
25654 /**
25655  * Constructs a new COption_SocketAddressZ containing nothing
25656  */
25657 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
25658
25659 /**
25660  * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
25661  */
25662 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
25663
25664 /**
25665  * Creates a new COption_SocketAddressZ which has the same data as `orig`
25666  * but with all dynamically-allocated buffers duplicated in new buffers.
25667  */
25668 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
25669
25670 /**
25671  * Creates a new tuple which has the same data as `orig`
25672  * but with all dynamically-allocated buffers duplicated in new buffers.
25673  */
25674 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR orig);
25675
25676 /**
25677  * Creates a new C2Tuple_PublicKeyCOption_SocketAddressZZ from the contained elements.
25678  */
25679 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_SocketAddressZ b);
25680
25681 /**
25682  * Frees any resources used by the C2Tuple_PublicKeyCOption_SocketAddressZZ.
25683  */
25684 void C2Tuple_PublicKeyCOption_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res);
25685
25686 /**
25687  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25688  */
25689 void CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res);
25690
25691 /**
25692  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
25693  */
25694 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
25695
25696 /**
25697  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
25698  */
25699 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
25700
25701 /**
25702  * Checks if the given object is currently in the success state
25703  */
25704 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
25705
25706 /**
25707  * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
25708  */
25709 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
25710
25711 /**
25712  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
25713  * but with all dynamically-allocated buffers duplicated in new buffers.
25714  */
25715 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
25716
25717 /**
25718  * Creates a new CResult_NonePeerHandleErrorZ in the success state.
25719  */
25720 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
25721
25722 /**
25723  * Creates a new CResult_NonePeerHandleErrorZ in the error state.
25724  */
25725 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
25726
25727 /**
25728  * Checks if the given object is currently in the success state
25729  */
25730 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
25731
25732 /**
25733  * Frees any resources used by the CResult_NonePeerHandleErrorZ.
25734  */
25735 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
25736
25737 /**
25738  * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
25739  * but with all dynamically-allocated buffers duplicated in new buffers.
25740  */
25741 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
25742
25743 /**
25744  * Creates a new CResult_boolPeerHandleErrorZ in the success state.
25745  */
25746 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
25747
25748 /**
25749  * Creates a new CResult_boolPeerHandleErrorZ in the error state.
25750  */
25751 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
25752
25753 /**
25754  * Checks if the given object is currently in the success state
25755  */
25756 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
25757
25758 /**
25759  * Frees any resources used by the CResult_boolPeerHandleErrorZ.
25760  */
25761 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
25762
25763 /**
25764  * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
25765  * but with all dynamically-allocated buffers duplicated in new buffers.
25766  */
25767 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
25768
25769 /**
25770  * Creates a new CResult_u32GraphSyncErrorZ in the success state.
25771  */
25772 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
25773
25774 /**
25775  * Creates a new CResult_u32GraphSyncErrorZ in the error state.
25776  */
25777 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
25778
25779 /**
25780  * Checks if the given object is currently in the success state
25781  */
25782 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
25783
25784 /**
25785  * Frees any resources used by the CResult_u32GraphSyncErrorZ.
25786  */
25787 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
25788
25789 /**
25790  * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
25791  */
25792 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
25793
25794 /**
25795  * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
25796  */
25797 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
25798
25799 /**
25800  * Checks if the given object is currently in the success state
25801  */
25802 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
25803
25804 /**
25805  * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
25806  */
25807 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
25808
25809 /**
25810  * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
25811  * but with all dynamically-allocated buffers duplicated in new buffers.
25812  */
25813 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
25814
25815 /**
25816  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25817  */
25818 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
25819
25820 /**
25821  * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
25822  */
25823 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
25824
25825 /**
25826  * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
25827  */
25828 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
25829
25830 /**
25831  * Checks if the given object is currently in the success state
25832  */
25833 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
25834
25835 /**
25836  * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
25837  */
25838 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
25839
25840 /**
25841  * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
25842  * but with all dynamically-allocated buffers duplicated in new buffers.
25843  */
25844 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
25845
25846 /**
25847  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25848  */
25849 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
25850
25851 /**
25852  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
25853  */
25854 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
25855
25856 /**
25857  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
25858  */
25859 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
25860
25861 /**
25862  * Checks if the given object is currently in the success state
25863  */
25864 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
25865
25866 /**
25867  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
25868  */
25869 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
25870
25871 /**
25872  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
25873  * but with all dynamically-allocated buffers duplicated in new buffers.
25874  */
25875 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
25876
25877 /**
25878  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
25879  */
25880 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
25881
25882 /**
25883  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
25884  */
25885 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
25886
25887 /**
25888  * Checks if the given object is currently in the success state
25889  */
25890 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
25891
25892 /**
25893  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
25894  */
25895 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
25896
25897 /**
25898  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
25899  * but with all dynamically-allocated buffers duplicated in new buffers.
25900  */
25901 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
25902
25903 /**
25904  * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
25905  */
25906 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
25907
25908 /**
25909  * Constructs a new COption_SecretKeyZ containing nothing
25910  */
25911 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
25912
25913 /**
25914  * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
25915  */
25916 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
25917
25918 /**
25919  * Creates a new COption_SecretKeyZ which has the same data as `orig`
25920  * but with all dynamically-allocated buffers duplicated in new buffers.
25921  */
25922 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
25923
25924 /**
25925  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
25926  */
25927 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
25928
25929 /**
25930  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
25931  */
25932 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
25933
25934 /**
25935  * Checks if the given object is currently in the success state
25936  */
25937 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
25938
25939 /**
25940  * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
25941  */
25942 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
25943
25944 /**
25945  * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
25946  * but with all dynamically-allocated buffers duplicated in new buffers.
25947  */
25948 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
25949
25950 /**
25951  * Constructs a new COption_NoneZ containing a
25952  */
25953 enum LDKCOption_NoneZ COption_NoneZ_some(void);
25954
25955 /**
25956  * Constructs a new COption_NoneZ containing nothing
25957  */
25958 enum LDKCOption_NoneZ COption_NoneZ_none(void);
25959
25960 /**
25961  * Frees any resources associated with the , if we are in the Some state
25962  */
25963 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
25964
25965 /**
25966  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25967  */
25968 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
25969
25970 /**
25971  * Constructs a new COption_i64Z containing a i64
25972  */
25973 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
25974
25975 /**
25976  * Constructs a new COption_i64Z containing nothing
25977  */
25978 struct LDKCOption_i64Z COption_i64Z_none(void);
25979
25980 /**
25981  * Frees any resources associated with the i64, if we are in the Some state
25982  */
25983 void COption_i64Z_free(struct LDKCOption_i64Z _res);
25984
25985 /**
25986  * Creates a new COption_i64Z which has the same data as `orig`
25987  * but with all dynamically-allocated buffers duplicated in new buffers.
25988  */
25989 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
25990
25991 /**
25992  * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
25993  */
25994 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
25995
25996 /**
25997  * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
25998  */
25999 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
26000
26001 /**
26002  * Checks if the given object is currently in the success state
26003  */
26004 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
26005
26006 /**
26007  * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
26008  */
26009 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
26010
26011 /**
26012  * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
26013  * but with all dynamically-allocated buffers duplicated in new buffers.
26014  */
26015 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
26016
26017 /**
26018  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
26019  */
26020 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
26021
26022 /**
26023  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
26024  */
26025 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
26026
26027 /**
26028  * Checks if the given object is currently in the success state
26029  */
26030 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
26031
26032 /**
26033  * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
26034  */
26035 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
26036
26037 /**
26038  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
26039  * but with all dynamically-allocated buffers duplicated in new buffers.
26040  */
26041 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
26042
26043 /**
26044  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26045  */
26046 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
26047
26048 /**
26049  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26050  */
26051 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
26052
26053 /**
26054  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26055  */
26056 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
26057
26058 /**
26059  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26060  */
26061 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
26062
26063 /**
26064  * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
26065  */
26066 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
26067
26068 /**
26069  * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
26070  */
26071 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
26072
26073 /**
26074  * Checks if the given object is currently in the success state
26075  */
26076 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
26077
26078 /**
26079  * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
26080  */
26081 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
26082
26083 /**
26084  * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
26085  * but with all dynamically-allocated buffers duplicated in new buffers.
26086  */
26087 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
26088
26089 /**
26090  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
26091  */
26092 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
26093
26094 /**
26095  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
26096  */
26097 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
26098
26099 /**
26100  * Checks if the given object is currently in the success state
26101  */
26102 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
26103
26104 /**
26105  * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
26106  */
26107 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
26108
26109 /**
26110  * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
26111  * but with all dynamically-allocated buffers duplicated in new buffers.
26112  */
26113 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
26114
26115 /**
26116  * Creates a new CResult_StfuDecodeErrorZ in the success state.
26117  */
26118 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_ok(struct LDKStfu o);
26119
26120 /**
26121  * Creates a new CResult_StfuDecodeErrorZ in the error state.
26122  */
26123 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_err(struct LDKDecodeError e);
26124
26125 /**
26126  * Checks if the given object is currently in the success state
26127  */
26128 bool CResult_StfuDecodeErrorZ_is_ok(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR o);
26129
26130 /**
26131  * Frees any resources used by the CResult_StfuDecodeErrorZ.
26132  */
26133 void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
26134
26135 /**
26136  * Creates a new CResult_StfuDecodeErrorZ which has the same data as `orig`
26137  * but with all dynamically-allocated buffers duplicated in new buffers.
26138  */
26139 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
26140
26141 /**
26142  * Creates a new CResult_SpliceDecodeErrorZ in the success state.
26143  */
26144 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o);
26145
26146 /**
26147  * Creates a new CResult_SpliceDecodeErrorZ in the error state.
26148  */
26149 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e);
26150
26151 /**
26152  * Checks if the given object is currently in the success state
26153  */
26154 bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o);
26155
26156 /**
26157  * Frees any resources used by the CResult_SpliceDecodeErrorZ.
26158  */
26159 void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res);
26160
26161 /**
26162  * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig`
26163  * but with all dynamically-allocated buffers duplicated in new buffers.
26164  */
26165 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig);
26166
26167 /**
26168  * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
26169  */
26170 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o);
26171
26172 /**
26173  * Creates a new CResult_SpliceAckDecodeErrorZ in the error state.
26174  */
26175 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e);
26176
26177 /**
26178  * Checks if the given object is currently in the success state
26179  */
26180 bool CResult_SpliceAckDecodeErrorZ_is_ok(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR o);
26181
26182 /**
26183  * Frees any resources used by the CResult_SpliceAckDecodeErrorZ.
26184  */
26185 void CResult_SpliceAckDecodeErrorZ_free(struct LDKCResult_SpliceAckDecodeErrorZ _res);
26186
26187 /**
26188  * Creates a new CResult_SpliceAckDecodeErrorZ which has the same data as `orig`
26189  * but with all dynamically-allocated buffers duplicated in new buffers.
26190  */
26191 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_clone(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR orig);
26192
26193 /**
26194  * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state.
26195  */
26196 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_ok(struct LDKSpliceLocked o);
26197
26198 /**
26199  * Creates a new CResult_SpliceLockedDecodeErrorZ in the error state.
26200  */
26201 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_err(struct LDKDecodeError e);
26202
26203 /**
26204  * Checks if the given object is currently in the success state
26205  */
26206 bool CResult_SpliceLockedDecodeErrorZ_is_ok(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR o);
26207
26208 /**
26209  * Frees any resources used by the CResult_SpliceLockedDecodeErrorZ.
26210  */
26211 void CResult_SpliceLockedDecodeErrorZ_free(struct LDKCResult_SpliceLockedDecodeErrorZ _res);
26212
26213 /**
26214  * Creates a new CResult_SpliceLockedDecodeErrorZ which has the same data as `orig`
26215  * but with all dynamically-allocated buffers duplicated in new buffers.
26216  */
26217 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_clone(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR orig);
26218
26219 /**
26220  * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
26221  */
26222 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
26223
26224 /**
26225  * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
26226  */
26227 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
26228
26229 /**
26230  * Checks if the given object is currently in the success state
26231  */
26232 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
26233
26234 /**
26235  * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
26236  */
26237 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
26238
26239 /**
26240  * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
26241  * but with all dynamically-allocated buffers duplicated in new buffers.
26242  */
26243 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
26244
26245 /**
26246  * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
26247  */
26248 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
26249
26250 /**
26251  * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
26252  */
26253 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
26254
26255 /**
26256  * Checks if the given object is currently in the success state
26257  */
26258 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
26259
26260 /**
26261  * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
26262  */
26263 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
26264
26265 /**
26266  * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
26267  * but with all dynamically-allocated buffers duplicated in new buffers.
26268  */
26269 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
26270
26271 /**
26272  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
26273  */
26274 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
26275
26276 /**
26277  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
26278  */
26279 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
26280
26281 /**
26282  * Checks if the given object is currently in the success state
26283  */
26284 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
26285
26286 /**
26287  * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
26288  */
26289 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
26290
26291 /**
26292  * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
26293  * but with all dynamically-allocated buffers duplicated in new buffers.
26294  */
26295 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
26296
26297 /**
26298  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
26299  */
26300 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
26301
26302 /**
26303  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
26304  */
26305 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
26306
26307 /**
26308  * Checks if the given object is currently in the success state
26309  */
26310 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
26311
26312 /**
26313  * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
26314  */
26315 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
26316
26317 /**
26318  * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
26319  * but with all dynamically-allocated buffers duplicated in new buffers.
26320  */
26321 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
26322
26323 /**
26324  * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
26325  */
26326 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
26327
26328 /**
26329  * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
26330  */
26331 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
26332
26333 /**
26334  * Checks if the given object is currently in the success state
26335  */
26336 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
26337
26338 /**
26339  * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
26340  */
26341 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
26342
26343 /**
26344  * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
26345  * but with all dynamically-allocated buffers duplicated in new buffers.
26346  */
26347 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
26348
26349 /**
26350  * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
26351  */
26352 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
26353
26354 /**
26355  * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
26356  */
26357 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
26358
26359 /**
26360  * Checks if the given object is currently in the success state
26361  */
26362 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
26363
26364 /**
26365  * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
26366  */
26367 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
26368
26369 /**
26370  * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
26371  * but with all dynamically-allocated buffers duplicated in new buffers.
26372  */
26373 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
26374
26375 /**
26376  * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
26377  */
26378 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
26379
26380 /**
26381  * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
26382  */
26383 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
26384
26385 /**
26386  * Checks if the given object is currently in the success state
26387  */
26388 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
26389
26390 /**
26391  * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
26392  */
26393 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
26394
26395 /**
26396  * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
26397  * but with all dynamically-allocated buffers duplicated in new buffers.
26398  */
26399 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
26400
26401 /**
26402  * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
26403  */
26404 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
26405
26406 /**
26407  * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
26408  */
26409 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
26410
26411 /**
26412  * Checks if the given object is currently in the success state
26413  */
26414 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
26415
26416 /**
26417  * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
26418  */
26419 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
26420
26421 /**
26422  * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
26423  * but with all dynamically-allocated buffers duplicated in new buffers.
26424  */
26425 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
26426
26427 /**
26428  * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
26429  */
26430 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
26431
26432 /**
26433  * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
26434  */
26435 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
26436
26437 /**
26438  * Checks if the given object is currently in the success state
26439  */
26440 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
26441
26442 /**
26443  * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
26444  */
26445 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
26446
26447 /**
26448  * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
26449  * but with all dynamically-allocated buffers duplicated in new buffers.
26450  */
26451 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
26452
26453 /**
26454  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
26455  */
26456 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
26457
26458 /**
26459  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
26460  */
26461 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
26462
26463 /**
26464  * Checks if the given object is currently in the success state
26465  */
26466 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
26467
26468 /**
26469  * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
26470  */
26471 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
26472
26473 /**
26474  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
26475  * but with all dynamically-allocated buffers duplicated in new buffers.
26476  */
26477 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
26478
26479 /**
26480  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
26481  */
26482 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
26483
26484 /**
26485  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
26486  */
26487 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
26488
26489 /**
26490  * Checks if the given object is currently in the success state
26491  */
26492 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
26493
26494 /**
26495  * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
26496  */
26497 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
26498
26499 /**
26500  * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
26501  * but with all dynamically-allocated buffers duplicated in new buffers.
26502  */
26503 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
26504
26505 /**
26506  * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
26507  */
26508 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
26509
26510 /**
26511  * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
26512  */
26513 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
26514
26515 /**
26516  * Checks if the given object is currently in the success state
26517  */
26518 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
26519
26520 /**
26521  * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
26522  */
26523 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
26524
26525 /**
26526  * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
26527  * but with all dynamically-allocated buffers duplicated in new buffers.
26528  */
26529 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
26530
26531 /**
26532  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
26533  */
26534 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
26535
26536 /**
26537  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
26538  */
26539 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
26540
26541 /**
26542  * Checks if the given object is currently in the success state
26543  */
26544 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
26545
26546 /**
26547  * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
26548  */
26549 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
26550
26551 /**
26552  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
26553  * but with all dynamically-allocated buffers duplicated in new buffers.
26554  */
26555 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
26556
26557 /**
26558  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
26559  */
26560 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
26561
26562 /**
26563  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
26564  */
26565 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
26566
26567 /**
26568  * Checks if the given object is currently in the success state
26569  */
26570 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
26571
26572 /**
26573  * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
26574  */
26575 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
26576
26577 /**
26578  * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
26579  * but with all dynamically-allocated buffers duplicated in new buffers.
26580  */
26581 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
26582
26583 /**
26584  * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
26585  */
26586 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
26587
26588 /**
26589  * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
26590  */
26591 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
26592
26593 /**
26594  * Checks if the given object is currently in the success state
26595  */
26596 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
26597
26598 /**
26599  * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
26600  */
26601 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
26602
26603 /**
26604  * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
26605  * but with all dynamically-allocated buffers duplicated in new buffers.
26606  */
26607 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
26608
26609 /**
26610  * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
26611  */
26612 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
26613
26614 /**
26615  * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
26616  */
26617 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
26618
26619 /**
26620  * Checks if the given object is currently in the success state
26621  */
26622 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
26623
26624 /**
26625  * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
26626  */
26627 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
26628
26629 /**
26630  * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
26631  * but with all dynamically-allocated buffers duplicated in new buffers.
26632  */
26633 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
26634
26635 /**
26636  * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
26637  */
26638 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
26639
26640 /**
26641  * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
26642  */
26643 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
26644
26645 /**
26646  * Checks if the given object is currently in the success state
26647  */
26648 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
26649
26650 /**
26651  * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
26652  */
26653 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
26654
26655 /**
26656  * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
26657  * but with all dynamically-allocated buffers duplicated in new buffers.
26658  */
26659 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
26660
26661 /**
26662  * Creates a new CResult_InitDecodeErrorZ in the success state.
26663  */
26664 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
26665
26666 /**
26667  * Creates a new CResult_InitDecodeErrorZ in the error state.
26668  */
26669 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
26670
26671 /**
26672  * Checks if the given object is currently in the success state
26673  */
26674 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
26675
26676 /**
26677  * Frees any resources used by the CResult_InitDecodeErrorZ.
26678  */
26679 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
26680
26681 /**
26682  * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
26683  * but with all dynamically-allocated buffers duplicated in new buffers.
26684  */
26685 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
26686
26687 /**
26688  * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
26689  */
26690 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
26691
26692 /**
26693  * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
26694  */
26695 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
26696
26697 /**
26698  * Checks if the given object is currently in the success state
26699  */
26700 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
26701
26702 /**
26703  * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
26704  */
26705 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
26706
26707 /**
26708  * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
26709  * but with all dynamically-allocated buffers duplicated in new buffers.
26710  */
26711 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
26712
26713 /**
26714  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
26715  */
26716 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
26717
26718 /**
26719  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
26720  */
26721 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
26722
26723 /**
26724  * Checks if the given object is currently in the success state
26725  */
26726 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
26727
26728 /**
26729  * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
26730  */
26731 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
26732
26733 /**
26734  * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
26735  * but with all dynamically-allocated buffers duplicated in new buffers.
26736  */
26737 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
26738
26739 /**
26740  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
26741  */
26742 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
26743
26744 /**
26745  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
26746  */
26747 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
26748
26749 /**
26750  * Checks if the given object is currently in the success state
26751  */
26752 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
26753
26754 /**
26755  * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
26756  */
26757 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
26758
26759 /**
26760  * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
26761  * but with all dynamically-allocated buffers duplicated in new buffers.
26762  */
26763 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
26764
26765 /**
26766  * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
26767  */
26768 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
26769
26770 /**
26771  * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
26772  */
26773 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
26774
26775 /**
26776  * Checks if the given object is currently in the success state
26777  */
26778 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
26779
26780 /**
26781  * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
26782  */
26783 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
26784
26785 /**
26786  * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
26787  * but with all dynamically-allocated buffers duplicated in new buffers.
26788  */
26789 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
26790
26791 /**
26792  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
26793  */
26794 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
26795
26796 /**
26797  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
26798  */
26799 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26800
26801 /**
26802  * Checks if the given object is currently in the success state
26803  */
26804 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
26805
26806 /**
26807  * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
26808  */
26809 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
26810
26811 /**
26812  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
26813  * but with all dynamically-allocated buffers duplicated in new buffers.
26814  */
26815 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
26816
26817 /**
26818  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
26819  */
26820 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
26821
26822 /**
26823  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
26824  */
26825 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26826
26827 /**
26828  * Checks if the given object is currently in the success state
26829  */
26830 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
26831
26832 /**
26833  * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
26834  */
26835 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
26836
26837 /**
26838  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
26839  * but with all dynamically-allocated buffers duplicated in new buffers.
26840  */
26841 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
26842
26843 /**
26844  * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
26845  */
26846 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
26847
26848 /**
26849  * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
26850  */
26851 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
26852
26853 /**
26854  * Checks if the given object is currently in the success state
26855  */
26856 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
26857
26858 /**
26859  * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
26860  */
26861 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
26862
26863 /**
26864  * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
26865  * but with all dynamically-allocated buffers duplicated in new buffers.
26866  */
26867 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
26868
26869 /**
26870  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
26871  */
26872 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
26873
26874 /**
26875  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
26876  */
26877 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26878
26879 /**
26880  * Checks if the given object is currently in the success state
26881  */
26882 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
26883
26884 /**
26885  * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
26886  */
26887 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
26888
26889 /**
26890  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
26891  * but with all dynamically-allocated buffers duplicated in new buffers.
26892  */
26893 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
26894
26895 /**
26896  * Creates a new CResult_OnionPacketDecodeErrorZ in the success state.
26897  */
26898 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_ok(struct LDKOnionPacket o);
26899
26900 /**
26901  * Creates a new CResult_OnionPacketDecodeErrorZ in the error state.
26902  */
26903 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_err(struct LDKDecodeError e);
26904
26905 /**
26906  * Checks if the given object is currently in the success state
26907  */
26908 bool CResult_OnionPacketDecodeErrorZ_is_ok(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR o);
26909
26910 /**
26911  * Frees any resources used by the CResult_OnionPacketDecodeErrorZ.
26912  */
26913 void CResult_OnionPacketDecodeErrorZ_free(struct LDKCResult_OnionPacketDecodeErrorZ _res);
26914
26915 /**
26916  * Creates a new CResult_OnionPacketDecodeErrorZ which has the same data as `orig`
26917  * but with all dynamically-allocated buffers duplicated in new buffers.
26918  */
26919 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_clone(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR orig);
26920
26921 /**
26922  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
26923  */
26924 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
26925
26926 /**
26927  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
26928  */
26929 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26930
26931 /**
26932  * Checks if the given object is currently in the success state
26933  */
26934 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
26935
26936 /**
26937  * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
26938  */
26939 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
26940
26941 /**
26942  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
26943  * but with all dynamically-allocated buffers duplicated in new buffers.
26944  */
26945 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
26946
26947 /**
26948  * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
26949  */
26950 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
26951
26952 /**
26953  * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
26954  */
26955 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
26956
26957 /**
26958  * Checks if the given object is currently in the success state
26959  */
26960 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
26961
26962 /**
26963  * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
26964  */
26965 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
26966
26967 /**
26968  * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
26969  * but with all dynamically-allocated buffers duplicated in new buffers.
26970  */
26971 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
26972
26973 /**
26974  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state.
26975  */
26976 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_ok(struct LDKFinalOnionHopData o);
26977
26978 /**
26979  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the error state.
26980  */
26981 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_err(struct LDKDecodeError e);
26982
26983 /**
26984  * Checks if the given object is currently in the success state
26985  */
26986 bool CResult_FinalOnionHopDataDecodeErrorZ_is_ok(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR o);
26987
26988 /**
26989  * Frees any resources used by the CResult_FinalOnionHopDataDecodeErrorZ.
26990  */
26991 void CResult_FinalOnionHopDataDecodeErrorZ_free(struct LDKCResult_FinalOnionHopDataDecodeErrorZ _res);
26992
26993 /**
26994  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ which has the same data as `orig`
26995  * but with all dynamically-allocated buffers duplicated in new buffers.
26996  */
26997 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_clone(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR orig);
26998
26999 /**
27000  * Creates a new CResult_PingDecodeErrorZ in the success state.
27001  */
27002 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
27003
27004 /**
27005  * Creates a new CResult_PingDecodeErrorZ in the error state.
27006  */
27007 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
27008
27009 /**
27010  * Checks if the given object is currently in the success state
27011  */
27012 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
27013
27014 /**
27015  * Frees any resources used by the CResult_PingDecodeErrorZ.
27016  */
27017 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
27018
27019 /**
27020  * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
27021  * but with all dynamically-allocated buffers duplicated in new buffers.
27022  */
27023 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
27024
27025 /**
27026  * Creates a new CResult_PongDecodeErrorZ in the success state.
27027  */
27028 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
27029
27030 /**
27031  * Creates a new CResult_PongDecodeErrorZ in the error state.
27032  */
27033 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
27034
27035 /**
27036  * Checks if the given object is currently in the success state
27037  */
27038 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
27039
27040 /**
27041  * Frees any resources used by the CResult_PongDecodeErrorZ.
27042  */
27043 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
27044
27045 /**
27046  * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
27047  * but with all dynamically-allocated buffers duplicated in new buffers.
27048  */
27049 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
27050
27051 /**
27052  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
27053  */
27054 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
27055
27056 /**
27057  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
27058  */
27059 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
27060
27061 /**
27062  * Checks if the given object is currently in the success state
27063  */
27064 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
27065
27066 /**
27067  * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
27068  */
27069 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
27070
27071 /**
27072  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
27073  * but with all dynamically-allocated buffers duplicated in new buffers.
27074  */
27075 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
27076
27077 /**
27078  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
27079  */
27080 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
27081
27082 /**
27083  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
27084  */
27085 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
27086
27087 /**
27088  * Checks if the given object is currently in the success state
27089  */
27090 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
27091
27092 /**
27093  * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
27094  */
27095 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
27096
27097 /**
27098  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
27099  * but with all dynamically-allocated buffers duplicated in new buffers.
27100  */
27101 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
27102
27103 /**
27104  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
27105  */
27106 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
27107
27108 /**
27109  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
27110  */
27111 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
27112
27113 /**
27114  * Checks if the given object is currently in the success state
27115  */
27116 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
27117
27118 /**
27119  * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
27120  */
27121 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
27122
27123 /**
27124  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
27125  * but with all dynamically-allocated buffers duplicated in new buffers.
27126  */
27127 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
27128
27129 /**
27130  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
27131  */
27132 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
27133
27134 /**
27135  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
27136  */
27137 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
27138
27139 /**
27140  * Checks if the given object is currently in the success state
27141  */
27142 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
27143
27144 /**
27145  * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
27146  */
27147 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
27148
27149 /**
27150  * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
27151  * but with all dynamically-allocated buffers duplicated in new buffers.
27152  */
27153 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
27154
27155 /**
27156  * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
27157  */
27158 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
27159
27160 /**
27161  * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
27162  */
27163 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
27164
27165 /**
27166  * Checks if the given object is currently in the success state
27167  */
27168 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
27169
27170 /**
27171  * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
27172  */
27173 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
27174
27175 /**
27176  * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
27177  * but with all dynamically-allocated buffers duplicated in new buffers.
27178  */
27179 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
27180
27181 /**
27182  * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
27183  */
27184 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
27185
27186 /**
27187  * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
27188  */
27189 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
27190
27191 /**
27192  * Checks if the given object is currently in the success state
27193  */
27194 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
27195
27196 /**
27197  * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
27198  */
27199 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
27200
27201 /**
27202  * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
27203  * but with all dynamically-allocated buffers duplicated in new buffers.
27204  */
27205 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
27206
27207 /**
27208  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
27209  */
27210 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
27211
27212 /**
27213  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
27214  */
27215 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
27216
27217 /**
27218  * Checks if the given object is currently in the success state
27219  */
27220 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
27221
27222 /**
27223  * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
27224  */
27225 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
27226
27227 /**
27228  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
27229  * but with all dynamically-allocated buffers duplicated in new buffers.
27230  */
27231 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
27232
27233 /**
27234  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
27235  */
27236 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
27237
27238 /**
27239  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
27240  */
27241 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
27242
27243 /**
27244  * Checks if the given object is currently in the success state
27245  */
27246 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
27247
27248 /**
27249  * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
27250  */
27251 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
27252
27253 /**
27254  * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
27255  * but with all dynamically-allocated buffers duplicated in new buffers.
27256  */
27257 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
27258
27259 /**
27260  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
27261  */
27262 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
27263
27264 /**
27265  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
27266  */
27267 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
27268
27269 /**
27270  * Checks if the given object is currently in the success state
27271  */
27272 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
27273
27274 /**
27275  * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
27276  */
27277 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
27278
27279 /**
27280  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
27281  * but with all dynamically-allocated buffers duplicated in new buffers.
27282  */
27283 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
27284
27285 /**
27286  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
27287  */
27288 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
27289
27290 /**
27291  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
27292  */
27293 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
27294
27295 /**
27296  * Checks if the given object is currently in the success state
27297  */
27298 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
27299
27300 /**
27301  * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
27302  */
27303 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
27304
27305 /**
27306  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
27307  * but with all dynamically-allocated buffers duplicated in new buffers.
27308  */
27309 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
27310
27311 /**
27312  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
27313  */
27314 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
27315
27316 /**
27317  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
27318  */
27319 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
27320
27321 /**
27322  * Checks if the given object is currently in the success state
27323  */
27324 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
27325
27326 /**
27327  * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
27328  */
27329 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
27330
27331 /**
27332  * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
27333  * but with all dynamically-allocated buffers duplicated in new buffers.
27334  */
27335 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
27336
27337 /**
27338  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
27339  */
27340 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
27341
27342 /**
27343  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
27344  */
27345 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
27346
27347 /**
27348  * Checks if the given object is currently in the success state
27349  */
27350 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
27351
27352 /**
27353  * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
27354  */
27355 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
27356
27357 /**
27358  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
27359  * but with all dynamically-allocated buffers duplicated in new buffers.
27360  */
27361 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
27362
27363 /**
27364  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
27365  */
27366 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
27367
27368 /**
27369  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
27370  */
27371 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
27372
27373 /**
27374  * Checks if the given object is currently in the success state
27375  */
27376 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
27377
27378 /**
27379  * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
27380  */
27381 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
27382
27383 /**
27384  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
27385  * but with all dynamically-allocated buffers duplicated in new buffers.
27386  */
27387 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
27388
27389 /**
27390  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27391  */
27392 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
27393
27394 /**
27395  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
27396  */
27397 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
27398
27399 /**
27400  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
27401  */
27402 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
27403
27404 /**
27405  * Checks if the given object is currently in the success state
27406  */
27407 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
27408
27409 /**
27410  * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
27411  */
27412 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
27413
27414 /**
27415  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
27416  * but with all dynamically-allocated buffers duplicated in new buffers.
27417  */
27418 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
27419
27420 /**
27421  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27422  */
27423 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
27424
27425 /**
27426  * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
27427  */
27428 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
27429
27430 /**
27431  * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
27432  */
27433 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
27434
27435 /**
27436  * Checks if the given object is currently in the success state
27437  */
27438 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
27439
27440 /**
27441  * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
27442  */
27443 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
27444
27445 /**
27446  * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
27447  * but with all dynamically-allocated buffers duplicated in new buffers.
27448  */
27449 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
27450
27451 /**
27452  * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
27453  */
27454 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
27455
27456 /**
27457  * Constructs a new COption_HTLCClaimZ containing nothing
27458  */
27459 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
27460
27461 /**
27462  * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
27463  */
27464 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
27465
27466 /**
27467  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
27468  */
27469 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
27470
27471 /**
27472  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
27473  */
27474 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
27475
27476 /**
27477  * Checks if the given object is currently in the success state
27478  */
27479 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
27480
27481 /**
27482  * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
27483  */
27484 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
27485
27486 /**
27487  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
27488  * but with all dynamically-allocated buffers duplicated in new buffers.
27489  */
27490 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
27491
27492 /**
27493  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
27494  */
27495 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
27496
27497 /**
27498  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
27499  */
27500 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
27501
27502 /**
27503  * Checks if the given object is currently in the success state
27504  */
27505 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
27506
27507 /**
27508  * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
27509  */
27510 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
27511
27512 /**
27513  * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
27514  * but with all dynamically-allocated buffers duplicated in new buffers.
27515  */
27516 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
27517
27518 /**
27519  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
27520  */
27521 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
27522
27523 /**
27524  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
27525  */
27526 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
27527
27528 /**
27529  * Checks if the given object is currently in the success state
27530  */
27531 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
27532
27533 /**
27534  * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
27535  */
27536 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
27537
27538 /**
27539  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
27540  * but with all dynamically-allocated buffers duplicated in new buffers.
27541  */
27542 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
27543
27544 /**
27545  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
27546  */
27547 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
27548
27549 /**
27550  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
27551  */
27552 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
27553
27554 /**
27555  * Checks if the given object is currently in the success state
27556  */
27557 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
27558
27559 /**
27560  * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
27561  */
27562 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
27563
27564 /**
27565  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
27566  * but with all dynamically-allocated buffers duplicated in new buffers.
27567  */
27568 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
27569
27570 /**
27571  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
27572  */
27573 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
27574
27575 /**
27576  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
27577  */
27578 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
27579
27580 /**
27581  * Checks if the given object is currently in the success state
27582  */
27583 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
27584
27585 /**
27586  * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
27587  */
27588 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
27589
27590 /**
27591  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
27592  * but with all dynamically-allocated buffers duplicated in new buffers.
27593  */
27594 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
27595
27596 /**
27597  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
27598  */
27599 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
27600
27601 /**
27602  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
27603  */
27604 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
27605
27606 /**
27607  * Checks if the given object is currently in the success state
27608  */
27609 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
27610
27611 /**
27612  * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
27613  */
27614 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
27615
27616 /**
27617  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
27618  * but with all dynamically-allocated buffers duplicated in new buffers.
27619  */
27620 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
27621
27622 /**
27623  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
27624  */
27625 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
27626
27627 /**
27628  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
27629  */
27630 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
27631
27632 /**
27633  * Checks if the given object is currently in the success state
27634  */
27635 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
27636
27637 /**
27638  * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
27639  */
27640 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
27641
27642 /**
27643  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
27644  * but with all dynamically-allocated buffers duplicated in new buffers.
27645  */
27646 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
27647
27648 /**
27649  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
27650  */
27651 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
27652
27653 /**
27654  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
27655  */
27656 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
27657
27658 /**
27659  * Checks if the given object is currently in the success state
27660  */
27661 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
27662
27663 /**
27664  * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
27665  */
27666 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
27667
27668 /**
27669  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
27670  * but with all dynamically-allocated buffers duplicated in new buffers.
27671  */
27672 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
27673
27674 /**
27675  * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
27676  */
27677 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
27678
27679 /**
27680  * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
27681  */
27682 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
27683
27684 /**
27685  * Checks if the given object is currently in the success state
27686  */
27687 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
27688
27689 /**
27690  * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
27691  */
27692 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
27693
27694 /**
27695  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
27696  */
27697 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
27698
27699 /**
27700  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
27701  */
27702 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
27703
27704 /**
27705  * Checks if the given object is currently in the success state
27706  */
27707 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
27708
27709 /**
27710  * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
27711  */
27712 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
27713
27714 /**
27715  * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
27716  * but with all dynamically-allocated buffers duplicated in new buffers.
27717  */
27718 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
27719
27720 /**
27721  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
27722  */
27723 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
27724
27725 /**
27726  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
27727  */
27728 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
27729
27730 /**
27731  * Checks if the given object is currently in the success state
27732  */
27733 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
27734
27735 /**
27736  * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
27737  */
27738 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
27739
27740 /**
27741  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
27742  */
27743 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
27744
27745 /**
27746  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
27747  */
27748 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
27749
27750 /**
27751  * Checks if the given object is currently in the success state
27752  */
27753 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
27754
27755 /**
27756  * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
27757  */
27758 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
27759
27760 /**
27761  * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
27762  * but with all dynamically-allocated buffers duplicated in new buffers.
27763  */
27764 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
27765
27766 /**
27767  * Constructs a new COption_usizeZ containing a usize
27768  */
27769 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
27770
27771 /**
27772  * Constructs a new COption_usizeZ containing nothing
27773  */
27774 struct LDKCOption_usizeZ COption_usizeZ_none(void);
27775
27776 /**
27777  * Frees any resources associated with the usize, if we are in the Some state
27778  */
27779 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
27780
27781 /**
27782  * Creates a new COption_usizeZ which has the same data as `orig`
27783  * but with all dynamically-allocated buffers duplicated in new buffers.
27784  */
27785 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
27786
27787 /**
27788  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
27789  */
27790 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
27791
27792 /**
27793  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
27794  */
27795 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
27796
27797 /**
27798  * Checks if the given object is currently in the success state
27799  */
27800 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
27801
27802 /**
27803  * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
27804  */
27805 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
27806
27807 /**
27808  * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
27809  * but with all dynamically-allocated buffers duplicated in new buffers.
27810  */
27811 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
27812
27813 /**
27814  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
27815  */
27816 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
27817
27818 /**
27819  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
27820  */
27821 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
27822
27823 /**
27824  * Checks if the given object is currently in the success state
27825  */
27826 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
27827
27828 /**
27829  * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
27830  */
27831 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
27832
27833 /**
27834  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
27835  * but with all dynamically-allocated buffers duplicated in new buffers.
27836  */
27837 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
27838
27839 /**
27840  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
27841  */
27842 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
27843
27844 /**
27845  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
27846  */
27847 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
27848
27849 /**
27850  * Checks if the given object is currently in the success state
27851  */
27852 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
27853
27854 /**
27855  * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
27856  */
27857 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
27858
27859 /**
27860  * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
27861  * but with all dynamically-allocated buffers duplicated in new buffers.
27862  */
27863 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
27864
27865 /**
27866  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
27867  */
27868 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
27869
27870 /**
27871  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
27872  */
27873 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
27874
27875 /**
27876  * Checks if the given object is currently in the success state
27877  */
27878 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
27879
27880 /**
27881  * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
27882  */
27883 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
27884
27885 /**
27886  * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
27887  * but with all dynamically-allocated buffers duplicated in new buffers.
27888  */
27889 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
27890
27891 /**
27892  * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
27893  */
27894 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
27895
27896 /**
27897  * Constructs a new COption_PathFailureZ containing nothing
27898  */
27899 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
27900
27901 /**
27902  * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
27903  */
27904 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
27905
27906 /**
27907  * Creates a new COption_PathFailureZ which has the same data as `orig`
27908  * but with all dynamically-allocated buffers duplicated in new buffers.
27909  */
27910 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
27911
27912 /**
27913  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
27914  */
27915 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
27916
27917 /**
27918  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
27919  */
27920 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
27921
27922 /**
27923  * Checks if the given object is currently in the success state
27924  */
27925 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
27926
27927 /**
27928  * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
27929  */
27930 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
27931
27932 /**
27933  * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
27934  * but with all dynamically-allocated buffers duplicated in new buffers.
27935  */
27936 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
27937
27938 /**
27939  * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
27940  */
27941 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
27942
27943 /**
27944  * Constructs a new COption_ClosureReasonZ containing nothing
27945  */
27946 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
27947
27948 /**
27949  * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
27950  */
27951 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
27952
27953 /**
27954  * Creates a new COption_ClosureReasonZ which has the same data as `orig`
27955  * but with all dynamically-allocated buffers duplicated in new buffers.
27956  */
27957 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
27958
27959 /**
27960  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
27961  */
27962 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
27963
27964 /**
27965  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
27966  */
27967 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
27968
27969 /**
27970  * Checks if the given object is currently in the success state
27971  */
27972 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
27973
27974 /**
27975  * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
27976  */
27977 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
27978
27979 /**
27980  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
27981  * but with all dynamically-allocated buffers duplicated in new buffers.
27982  */
27983 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
27984
27985 /**
27986  * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
27987  */
27988 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
27989
27990 /**
27991  * Constructs a new COption_HTLCDestinationZ containing nothing
27992  */
27993 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
27994
27995 /**
27996  * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
27997  */
27998 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
27999
28000 /**
28001  * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
28002  * but with all dynamically-allocated buffers duplicated in new buffers.
28003  */
28004 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
28005
28006 /**
28007  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
28008  */
28009 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
28010
28011 /**
28012  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
28013  */
28014 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
28015
28016 /**
28017  * Checks if the given object is currently in the success state
28018  */
28019 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
28020
28021 /**
28022  * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
28023  */
28024 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
28025
28026 /**
28027  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
28028  * but with all dynamically-allocated buffers duplicated in new buffers.
28029  */
28030 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
28031
28032 /**
28033  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
28034  */
28035 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
28036
28037 /**
28038  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
28039  */
28040 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
28041
28042 /**
28043  * Checks if the given object is currently in the success state
28044  */
28045 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
28046
28047 /**
28048  * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
28049  */
28050 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
28051
28052 /**
28053  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
28054  * but with all dynamically-allocated buffers duplicated in new buffers.
28055  */
28056 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
28057
28058 /**
28059  * Constructs a new COption_U128Z containing a crate::c_types::U128
28060  */
28061 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
28062
28063 /**
28064  * Constructs a new COption_U128Z containing nothing
28065  */
28066 struct LDKCOption_U128Z COption_U128Z_none(void);
28067
28068 /**
28069  * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
28070  */
28071 void COption_U128Z_free(struct LDKCOption_U128Z _res);
28072
28073 /**
28074  * Creates a new COption_U128Z which has the same data as `orig`
28075  * but with all dynamically-allocated buffers duplicated in new buffers.
28076  */
28077 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
28078
28079 /**
28080  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28081  */
28082 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
28083
28084 /**
28085  * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
28086  */
28087 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
28088
28089 /**
28090  * Constructs a new COption_PaymentFailureReasonZ containing nothing
28091  */
28092 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
28093
28094 /**
28095  * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
28096  */
28097 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
28098
28099 /**
28100  * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
28101  * but with all dynamically-allocated buffers duplicated in new buffers.
28102  */
28103 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
28104
28105 /**
28106  * Constructs a new COption_EventZ containing a crate::lightning::events::Event
28107  */
28108 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
28109
28110 /**
28111  * Constructs a new COption_EventZ containing nothing
28112  */
28113 struct LDKCOption_EventZ COption_EventZ_none(void);
28114
28115 /**
28116  * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
28117  */
28118 void COption_EventZ_free(struct LDKCOption_EventZ _res);
28119
28120 /**
28121  * Creates a new COption_EventZ which has the same data as `orig`
28122  * but with all dynamically-allocated buffers duplicated in new buffers.
28123  */
28124 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
28125
28126 /**
28127  * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
28128  */
28129 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
28130
28131 /**
28132  * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
28133  */
28134 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
28135
28136 /**
28137  * Checks if the given object is currently in the success state
28138  */
28139 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
28140
28141 /**
28142  * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
28143  */
28144 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
28145
28146 /**
28147  * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
28148  * but with all dynamically-allocated buffers duplicated in new buffers.
28149  */
28150 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
28151
28152 /**
28153  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
28154  */
28155 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
28156
28157 /**
28158  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
28159  */
28160 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
28161
28162 /**
28163  * Checks if the given object is currently in the success state
28164  */
28165 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
28166
28167 /**
28168  * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
28169  */
28170 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
28171
28172 /**
28173  * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
28174  * but with all dynamically-allocated buffers duplicated in new buffers.
28175  */
28176 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
28177
28178 /**
28179  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
28180  */
28181 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
28182
28183 /**
28184  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
28185  */
28186 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
28187
28188 /**
28189  * Checks if the given object is currently in the success state
28190  */
28191 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
28192
28193 /**
28194  * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
28195  */
28196 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
28197
28198 /**
28199  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
28200  * but with all dynamically-allocated buffers duplicated in new buffers.
28201  */
28202 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
28203
28204 /**
28205  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
28206  */
28207 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
28208
28209 /**
28210  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
28211  */
28212 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
28213
28214 /**
28215  * Checks if the given object is currently in the success state
28216  */
28217 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
28218
28219 /**
28220  * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
28221  */
28222 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
28223
28224 /**
28225  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
28226  * but with all dynamically-allocated buffers duplicated in new buffers.
28227  */
28228 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
28229
28230 /**
28231  * Creates a new tuple which has the same data as `orig`
28232  * but with all dynamically-allocated buffers duplicated in new buffers.
28233  */
28234 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
28235
28236 /**
28237  * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
28238  */
28239 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
28240
28241 /**
28242  * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
28243  */
28244 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
28245
28246 /**
28247  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
28248  */
28249 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
28250
28251 /**
28252  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
28253  */
28254 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
28255
28256 /**
28257  * Checks if the given object is currently in the success state
28258  */
28259 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
28260
28261 /**
28262  * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
28263  */
28264 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
28265
28266 /**
28267  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
28268  * but with all dynamically-allocated buffers duplicated in new buffers.
28269  */
28270 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
28271
28272 /**
28273  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28274  */
28275 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
28276
28277 /**
28278  * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
28279  */
28280 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
28281
28282 /**
28283  * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
28284  */
28285 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
28286
28287 /**
28288  * Checks if the given object is currently in the success state
28289  */
28290 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
28291
28292 /**
28293  * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
28294  */
28295 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
28296
28297 /**
28298  * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
28299  * but with all dynamically-allocated buffers duplicated in new buffers.
28300  */
28301 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
28302
28303 /**
28304  * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
28305  */
28306 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
28307
28308 /**
28309  * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
28310  */
28311 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
28312
28313 /**
28314  * Checks if the given object is currently in the success state
28315  */
28316 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
28317
28318 /**
28319  * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
28320  */
28321 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
28322
28323 /**
28324  * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
28325  * but with all dynamically-allocated buffers duplicated in new buffers.
28326  */
28327 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
28328
28329 /**
28330  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
28331  */
28332 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
28333
28334 /**
28335  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
28336  */
28337 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
28338
28339 /**
28340  * Checks if the given object is currently in the success state
28341  */
28342 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
28343
28344 /**
28345  * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
28346  */
28347 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
28348
28349 /**
28350  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
28351  * but with all dynamically-allocated buffers duplicated in new buffers.
28352  */
28353 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
28354
28355 /**
28356  * Creates a new CResult_DescriptionCreationErrorZ in the success state.
28357  */
28358 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
28359
28360 /**
28361  * Creates a new CResult_DescriptionCreationErrorZ in the error state.
28362  */
28363 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
28364
28365 /**
28366  * Checks if the given object is currently in the success state
28367  */
28368 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
28369
28370 /**
28371  * Frees any resources used by the CResult_DescriptionCreationErrorZ.
28372  */
28373 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
28374
28375 /**
28376  * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
28377  * but with all dynamically-allocated buffers duplicated in new buffers.
28378  */
28379 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
28380
28381 /**
28382  * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
28383  */
28384 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
28385
28386 /**
28387  * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
28388  */
28389 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
28390
28391 /**
28392  * Checks if the given object is currently in the success state
28393  */
28394 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
28395
28396 /**
28397  * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
28398  */
28399 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
28400
28401 /**
28402  * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
28403  * but with all dynamically-allocated buffers duplicated in new buffers.
28404  */
28405 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
28406
28407 /**
28408  * Creates a new CResult_OutPointDecodeErrorZ in the success state.
28409  */
28410 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
28411
28412 /**
28413  * Creates a new CResult_OutPointDecodeErrorZ in the error state.
28414  */
28415 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
28416
28417 /**
28418  * Checks if the given object is currently in the success state
28419  */
28420 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
28421
28422 /**
28423  * Frees any resources used by the CResult_OutPointDecodeErrorZ.
28424  */
28425 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
28426
28427 /**
28428  * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
28429  * but with all dynamically-allocated buffers duplicated in new buffers.
28430  */
28431 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
28432
28433 /**
28434  * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
28435  */
28436 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
28437
28438 /**
28439  * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
28440  */
28441 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
28442
28443 /**
28444  * Checks if the given object is currently in the success state
28445  */
28446 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
28447
28448 /**
28449  * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
28450  */
28451 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
28452
28453 /**
28454  * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
28455  * but with all dynamically-allocated buffers duplicated in new buffers.
28456  */
28457 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
28458
28459 /**
28460  * Creates a new CResult_HostnameDecodeErrorZ in the success state.
28461  */
28462 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
28463
28464 /**
28465  * Creates a new CResult_HostnameDecodeErrorZ in the error state.
28466  */
28467 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
28468
28469 /**
28470  * Checks if the given object is currently in the success state
28471  */
28472 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
28473
28474 /**
28475  * Frees any resources used by the CResult_HostnameDecodeErrorZ.
28476  */
28477 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
28478
28479 /**
28480  * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
28481  * but with all dynamically-allocated buffers duplicated in new buffers.
28482  */
28483 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
28484
28485 /**
28486  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
28487  */
28488 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
28489
28490 /**
28491  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
28492  */
28493 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
28494
28495 /**
28496  * Checks if the given object is currently in the success state
28497  */
28498 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
28499
28500 /**
28501  * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
28502  */
28503 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
28504
28505 /**
28506  * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
28507  * but with all dynamically-allocated buffers duplicated in new buffers.
28508  */
28509 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
28510
28511 /**
28512  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
28513  */
28514 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
28515
28516 /**
28517  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
28518  */
28519 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
28520
28521 /**
28522  * Checks if the given object is currently in the success state
28523  */
28524 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
28525
28526 /**
28527  * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
28528  */
28529 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
28530
28531 /**
28532  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
28533  * but with all dynamically-allocated buffers duplicated in new buffers.
28534  */
28535 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
28536
28537 /**
28538  * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
28539  */
28540 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
28541
28542 /**
28543  * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
28544  */
28545 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
28546
28547 /**
28548  * Checks if the given object is currently in the success state
28549  */
28550 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
28551
28552 /**
28553  * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
28554  */
28555 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
28556
28557 /**
28558  * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
28559  * but with all dynamically-allocated buffers duplicated in new buffers.
28560  */
28561 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
28562
28563 /**
28564  * Creates a new tuple which has the same data as `orig`
28565  * but with all dynamically-allocated buffers duplicated in new buffers.
28566  */
28567 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
28568
28569 /**
28570  * Creates a new C2Tuple__u832u16Z from the contained elements.
28571  */
28572 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
28573
28574 /**
28575  * Frees any resources used by the C2Tuple__u832u16Z.
28576  */
28577 void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
28578
28579 /**
28580  * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
28581  */
28582 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
28583
28584 /**
28585  * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
28586  */
28587 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
28588
28589 /**
28590  * Checks if the given object is currently in the success state
28591  */
28592 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
28593
28594 /**
28595  * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
28596  */
28597 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
28598
28599 /**
28600  * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
28601  * but with all dynamically-allocated buffers duplicated in new buffers.
28602  */
28603 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
28604
28605 /**
28606  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
28607  */
28608 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
28609
28610 /**
28611  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
28612  */
28613 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
28614
28615 /**
28616  * Checks if the given object is currently in the success state
28617  */
28618 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
28619
28620 /**
28621  * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
28622  */
28623 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
28624
28625 /**
28626  * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
28627  * but with all dynamically-allocated buffers duplicated in new buffers.
28628  */
28629 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
28630
28631 /**
28632  * Creates a new tuple which has the same data as `orig`
28633  * but with all dynamically-allocated buffers duplicated in new buffers.
28634  */
28635 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
28636
28637 /**
28638  * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
28639  */
28640 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
28641
28642 /**
28643  * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
28644  */
28645 void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
28646
28647 /**
28648  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
28649  */
28650 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
28651
28652 /**
28653  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
28654  */
28655 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
28656
28657 /**
28658  * Checks if the given object is currently in the success state
28659  */
28660 bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
28661
28662 /**
28663  * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
28664  */
28665 void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
28666
28667 /**
28668  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
28669  * but with all dynamically-allocated buffers duplicated in new buffers.
28670  */
28671 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
28672
28673 /**
28674  * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
28675  */
28676 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
28677
28678 /**
28679  * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
28680  */
28681 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
28682
28683 /**
28684  * Checks if the given object is currently in the success state
28685  */
28686 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
28687
28688 /**
28689  * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
28690  */
28691 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
28692
28693 /**
28694  * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
28695  * but with all dynamically-allocated buffers duplicated in new buffers.
28696  */
28697 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
28698
28699 /**
28700  * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
28701  */
28702 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
28703
28704 /**
28705  * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
28706  */
28707 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
28708
28709 /**
28710  * Checks if the given object is currently in the success state
28711  */
28712 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
28713
28714 /**
28715  * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
28716  */
28717 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
28718
28719 /**
28720  * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
28721  * but with all dynamically-allocated buffers duplicated in new buffers.
28722  */
28723 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
28724
28725 /**
28726  * Creates a new tuple which has the same data as `orig`
28727  * but with all dynamically-allocated buffers duplicated in new buffers.
28728  */
28729 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
28730
28731 /**
28732  * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
28733  */
28734 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(struct LDKPublicKey a, struct LDKOnionMessage b, struct LDKCOption_CVec_SocketAddressZZ c);
28735
28736 /**
28737  * Frees any resources used by the C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.
28738  */
28739 void C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res);
28740
28741 /**
28742  * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state.
28743  */
28744 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o);
28745
28746 /**
28747  * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the error state.
28748  */
28749 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(struct LDKSendError e);
28750
28751 /**
28752  * Checks if the given object is currently in the success state
28753  */
28754 bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR o);
28755
28756 /**
28757  * Frees any resources used by the CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.
28758  */
28759 void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res);
28760
28761 /**
28762  * Creates a new CResult_PeeledOnionNoneZ in the success state.
28763  */
28764 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
28765
28766 /**
28767  * Creates a new CResult_PeeledOnionNoneZ in the error state.
28768  */
28769 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
28770
28771 /**
28772  * Checks if the given object is currently in the success state
28773  */
28774 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
28775
28776 /**
28777  * Frees any resources used by the CResult_PeeledOnionNoneZ.
28778  */
28779 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
28780
28781 /**
28782  * Creates a new CResult_SendSuccessSendErrorZ in the success state.
28783  */
28784 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o);
28785
28786 /**
28787  * Creates a new CResult_SendSuccessSendErrorZ in the error state.
28788  */
28789 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e);
28790
28791 /**
28792  * Checks if the given object is currently in the success state
28793  */
28794 bool CResult_SendSuccessSendErrorZ_is_ok(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR o);
28795
28796 /**
28797  * Frees any resources used by the CResult_SendSuccessSendErrorZ.
28798  */
28799 void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res);
28800
28801 /**
28802  * Creates a new CResult_BlindedPathNoneZ in the success state.
28803  */
28804 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
28805
28806 /**
28807  * Creates a new CResult_BlindedPathNoneZ in the error state.
28808  */
28809 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
28810
28811 /**
28812  * Checks if the given object is currently in the success state
28813  */
28814 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
28815
28816 /**
28817  * Frees any resources used by the CResult_BlindedPathNoneZ.
28818  */
28819 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
28820
28821 /**
28822  * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
28823  * but with all dynamically-allocated buffers duplicated in new buffers.
28824  */
28825 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
28826
28827 /**
28828  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
28829  */
28830 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
28831
28832 /**
28833  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
28834  */
28835 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
28836
28837 /**
28838  * Checks if the given object is currently in the success state
28839  */
28840 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
28841
28842 /**
28843  * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
28844  */
28845 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
28846
28847 /**
28848  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
28849  * but with all dynamically-allocated buffers duplicated in new buffers.
28850  */
28851 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
28852
28853 /**
28854  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28855  */
28856 void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res);
28857
28858 /**
28859  * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
28860  */
28861 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
28862
28863 /**
28864  * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
28865  */
28866 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
28867
28868 /**
28869  * Checks if the given object is currently in the success state
28870  */
28871 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
28872
28873 /**
28874  * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
28875  */
28876 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
28877
28878 /**
28879  * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
28880  * but with all dynamically-allocated buffers duplicated in new buffers.
28881  */
28882 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
28883
28884 /**
28885  * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
28886  */
28887 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
28888
28889 /**
28890  * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
28891  */
28892 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
28893
28894 /**
28895  * Checks if the given object is currently in the success state
28896  */
28897 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
28898
28899 /**
28900  * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
28901  */
28902 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
28903
28904 /**
28905  * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
28906  * but with all dynamically-allocated buffers duplicated in new buffers.
28907  */
28908 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
28909
28910 /**
28911  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
28912  */
28913 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
28914
28915 /**
28916  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
28917  */
28918 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
28919
28920 /**
28921  * Checks if the given object is currently in the success state
28922  */
28923 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
28924
28925 /**
28926  * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
28927  */
28928 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
28929
28930 /**
28931  * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
28932  * but with all dynamically-allocated buffers duplicated in new buffers.
28933  */
28934 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
28935
28936 /**
28937  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state.
28938  */
28939 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o);
28940
28941 /**
28942  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the error state.
28943  */
28944 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e);
28945
28946 /**
28947  * Checks if the given object is currently in the success state
28948  */
28949 bool CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR o);
28950
28951 /**
28952  * Frees any resources used by the CResult_DelayedPaymentBasepointDecodeErrorZ.
28953  */
28954 void CResult_DelayedPaymentBasepointDecodeErrorZ_free(struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res);
28955
28956 /**
28957  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ which has the same data as `orig`
28958  * but with all dynamically-allocated buffers duplicated in new buffers.
28959  */
28960 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR orig);
28961
28962 /**
28963  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state.
28964  */
28965 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_ok(struct LDKDelayedPaymentKey o);
28966
28967 /**
28968  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the error state.
28969  */
28970 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_err(struct LDKDecodeError e);
28971
28972 /**
28973  * Checks if the given object is currently in the success state
28974  */
28975 bool CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR o);
28976
28977 /**
28978  * Frees any resources used by the CResult_DelayedPaymentKeyDecodeErrorZ.
28979  */
28980 void CResult_DelayedPaymentKeyDecodeErrorZ_free(struct LDKCResult_DelayedPaymentKeyDecodeErrorZ _res);
28981
28982 /**
28983  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ which has the same data as `orig`
28984  * but with all dynamically-allocated buffers duplicated in new buffers.
28985  */
28986 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR orig);
28987
28988 /**
28989  * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state.
28990  */
28991 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_ok(struct LDKHtlcBasepoint o);
28992
28993 /**
28994  * Creates a new CResult_HtlcBasepointDecodeErrorZ in the error state.
28995  */
28996 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_err(struct LDKDecodeError e);
28997
28998 /**
28999  * Checks if the given object is currently in the success state
29000  */
29001 bool CResult_HtlcBasepointDecodeErrorZ_is_ok(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR o);
29002
29003 /**
29004  * Frees any resources used by the CResult_HtlcBasepointDecodeErrorZ.
29005  */
29006 void CResult_HtlcBasepointDecodeErrorZ_free(struct LDKCResult_HtlcBasepointDecodeErrorZ _res);
29007
29008 /**
29009  * Creates a new CResult_HtlcBasepointDecodeErrorZ which has the same data as `orig`
29010  * but with all dynamically-allocated buffers duplicated in new buffers.
29011  */
29012 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_clone(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR orig);
29013
29014 /**
29015  * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state.
29016  */
29017 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_ok(struct LDKHtlcKey o);
29018
29019 /**
29020  * Creates a new CResult_HtlcKeyDecodeErrorZ in the error state.
29021  */
29022 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_err(struct LDKDecodeError e);
29023
29024 /**
29025  * Checks if the given object is currently in the success state
29026  */
29027 bool CResult_HtlcKeyDecodeErrorZ_is_ok(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR o);
29028
29029 /**
29030  * Frees any resources used by the CResult_HtlcKeyDecodeErrorZ.
29031  */
29032 void CResult_HtlcKeyDecodeErrorZ_free(struct LDKCResult_HtlcKeyDecodeErrorZ _res);
29033
29034 /**
29035  * Creates a new CResult_HtlcKeyDecodeErrorZ which has the same data as `orig`
29036  * but with all dynamically-allocated buffers duplicated in new buffers.
29037  */
29038 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_clone(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR orig);
29039
29040 /**
29041  * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state.
29042  */
29043 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_ok(struct LDKRevocationBasepoint o);
29044
29045 /**
29046  * Creates a new CResult_RevocationBasepointDecodeErrorZ in the error state.
29047  */
29048 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_err(struct LDKDecodeError e);
29049
29050 /**
29051  * Checks if the given object is currently in the success state
29052  */
29053 bool CResult_RevocationBasepointDecodeErrorZ_is_ok(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR o);
29054
29055 /**
29056  * Frees any resources used by the CResult_RevocationBasepointDecodeErrorZ.
29057  */
29058 void CResult_RevocationBasepointDecodeErrorZ_free(struct LDKCResult_RevocationBasepointDecodeErrorZ _res);
29059
29060 /**
29061  * Creates a new CResult_RevocationBasepointDecodeErrorZ which has the same data as `orig`
29062  * but with all dynamically-allocated buffers duplicated in new buffers.
29063  */
29064 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_clone(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR orig);
29065
29066 /**
29067  * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state.
29068  */
29069 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_ok(struct LDKRevocationKey o);
29070
29071 /**
29072  * Creates a new CResult_RevocationKeyDecodeErrorZ in the error state.
29073  */
29074 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_err(struct LDKDecodeError e);
29075
29076 /**
29077  * Checks if the given object is currently in the success state
29078  */
29079 bool CResult_RevocationKeyDecodeErrorZ_is_ok(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR o);
29080
29081 /**
29082  * Frees any resources used by the CResult_RevocationKeyDecodeErrorZ.
29083  */
29084 void CResult_RevocationKeyDecodeErrorZ_free(struct LDKCResult_RevocationKeyDecodeErrorZ _res);
29085
29086 /**
29087  * Creates a new CResult_RevocationKeyDecodeErrorZ which has the same data as `orig`
29088  * but with all dynamically-allocated buffers duplicated in new buffers.
29089  */
29090 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig);
29091
29092 /**
29093  * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
29094  */
29095 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
29096
29097 /**
29098  * Constructs a new COption_FilterZ containing nothing
29099  */
29100 struct LDKCOption_FilterZ COption_FilterZ_none(void);
29101
29102 /**
29103  * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
29104  */
29105 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
29106
29107 /**
29108  * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
29109  */
29110 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
29111
29112 /**
29113  * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
29114  */
29115 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
29116
29117 /**
29118  * Checks if the given object is currently in the success state
29119  */
29120 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
29121
29122 /**
29123  * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
29124  */
29125 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
29126
29127 /**
29128  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29129  */
29130 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
29131
29132 /**
29133  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29134  */
29135 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
29136
29137 /**
29138  * Creates a new tuple which has the same data as `orig`
29139  * but with all dynamically-allocated buffers duplicated in new buffers.
29140  */
29141 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
29142
29143 /**
29144  * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
29145  */
29146 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
29147
29148 /**
29149  * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
29150  */
29151 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
29152
29153 /**
29154  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29155  */
29156 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
29157
29158 /**
29159  * Frees any resources used by the APIError
29160  */
29161 void APIError_free(struct LDKAPIError this_ptr);
29162
29163 /**
29164  * Creates a copy of the APIError
29165  */
29166 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
29167
29168 /**
29169  * Utility method to constructs a new APIMisuseError-variant APIError
29170  */
29171 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
29172
29173 /**
29174  * Utility method to constructs a new FeeRateTooHigh-variant APIError
29175  */
29176 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
29177
29178 /**
29179  * Utility method to constructs a new InvalidRoute-variant APIError
29180  */
29181 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
29182
29183 /**
29184  * Utility method to constructs a new ChannelUnavailable-variant APIError
29185  */
29186 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
29187
29188 /**
29189  * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
29190  */
29191 struct LDKAPIError APIError_monitor_update_in_progress(void);
29192
29193 /**
29194  * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
29195  */
29196 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
29197
29198 /**
29199  * Checks if two APIErrors contain equal inner contents.
29200  * This ignores pointers and is_owned flags and looks at the values in fields.
29201  */
29202 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
29203
29204 /**
29205  * Serialize the APIError object into a byte array which can be read by APIError_read
29206  */
29207 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
29208
29209 /**
29210  * Read a APIError from a byte array, created by APIError_write
29211  */
29212 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
29213
29214 /**
29215  * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
29216  */
29217 void BigSize_free(struct LDKBigSize this_obj);
29218
29219 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
29220
29221 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
29222
29223 /**
29224  * Constructs a new BigSize given each field
29225  */
29226 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
29227
29228 /**
29229  * Creates a copy of the BigSize
29230  */
29231 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
29232
29233 /**
29234  * Generates a non-cryptographic 64-bit hash of the BigSize.
29235  */
29236 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
29237
29238 /**
29239  * Checks if two BigSizes contain equal inner contents.
29240  * This ignores pointers and is_owned flags and looks at the values in fields.
29241  * Two objects with NULL inner values will be considered "equal" here.
29242  */
29243 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
29244
29245 /**
29246  * Serialize the BigSize object into a byte array which can be read by BigSize_read
29247  */
29248 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
29249
29250 /**
29251  * Read a BigSize from a byte array, created by BigSize_write
29252  */
29253 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
29254
29255 /**
29256  * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
29257  */
29258 void Hostname_free(struct LDKHostname this_obj);
29259
29260 /**
29261  * Creates a copy of the Hostname
29262  */
29263 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
29264
29265 /**
29266  * Generates a non-cryptographic 64-bit hash of the Hostname.
29267  */
29268 uint64_t Hostname_hash(const struct LDKHostname *NONNULL_PTR o);
29269
29270 /**
29271  * Checks if two Hostnames contain equal inner contents.
29272  * This ignores pointers and is_owned flags and looks at the values in fields.
29273  * Two objects with NULL inner values will be considered "equal" here.
29274  */
29275 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
29276
29277 /**
29278  * Returns the length of the hostname.
29279  */
29280 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
29281
29282 /**
29283  * Serialize the Hostname object into a byte array which can be read by Hostname_read
29284  */
29285 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
29286
29287 /**
29288  * Read a Hostname from a byte array, created by Hostname_write
29289  */
29290 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
29291
29292 /**
29293  * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
29294  */
29295 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
29296
29297 /**
29298  * Creates a copy of the TransactionU16LenLimited
29299  */
29300 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
29301
29302 /**
29303  * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited.
29304  */
29305 uint64_t TransactionU16LenLimited_hash(const struct LDKTransactionU16LenLimited *NONNULL_PTR o);
29306
29307 /**
29308  * Checks if two TransactionU16LenLimiteds contain equal inner contents.
29309  * This ignores pointers and is_owned flags and looks at the values in fields.
29310  * Two objects with NULL inner values will be considered "equal" here.
29311  */
29312 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
29313
29314 /**
29315  * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
29316  * serialized length is <= u16::MAX.
29317  */
29318 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
29319
29320 /**
29321  * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
29322  */
29323 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
29324
29325 /**
29326  * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
29327  */
29328 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
29329
29330 /**
29331  * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
29332  */
29333 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
29334
29335 /**
29336  * Creates a digital signature of a message given a SecretKey, like the node's secret.
29337  * 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.
29338  * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
29339  */
29340 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
29341
29342 /**
29343  * Recovers the PublicKey of the signer of the message given the message and the signature.
29344  */
29345 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
29346
29347 /**
29348  * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
29349  * and the PublicKey.
29350  */
29351 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
29352
29353 /**
29354  * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
29355  */
29356 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
29357
29358 /**
29359  * Calls the free function if one is set
29360  */
29361 void KVStore_free(struct LDKKVStore this_ptr);
29362
29363 /**
29364  * Calls the free function if one is set
29365  */
29366 void Persister_free(struct LDKPersister this_ptr);
29367
29368 /**
29369  * Read previously persisted [`ChannelMonitor`]s from the store.
29370  */
29371 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
29372
29373 /**
29374  * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
29375  */
29376 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
29377
29378 /**
29379  * Constructs a new [`MonitorUpdatingPersister`].
29380  *
29381  * The `maximum_pending_updates` parameter controls how many updates may be stored before a
29382  * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
29383  * consolidation will frequently occur with fewer updates than what you set here; this number
29384  * is merely the maximum that may be stored. When setting this value, consider that for higher
29385  * values of `maximum_pending_updates`:
29386  *
29387  *   - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
29388  * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
29389  * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
29390  *   - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
29391  * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
29392  * less frequent \"waves.\"
29393  *   - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
29394  * [`MonitorUpdatingPersister::cleanup_stale_updates`].
29395  */
29396 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);
29397
29398 /**
29399  * Reads all stored channel monitors, along with any stored updates for them.
29400  *
29401  * It is extremely important that your [`KVStore::read`] implementation uses the
29402  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
29403  * documentation for [`MonitorUpdatingPersister`].
29404  */
29405 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);
29406
29407 /**
29408  * Read a single channel monitor, along with any stored updates for it.
29409  *
29410  * It is extremely important that your [`KVStore::read`] implementation uses the
29411  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
29412  * documentation for [`MonitorUpdatingPersister`].
29413  *
29414  * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
29415  * [`OutPoint`], with an underscore `_` between them. For example, given:
29416  *
29417  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
29418  *   - Index: `1`
29419  *
29420  * The correct `monitor_key` would be:
29421  * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
29422  *
29423  * Loading a large number of monitors will be faster if done in parallel. You can use this
29424  * function to accomplish this. Take care to limit the number of parallel readers.
29425  */
29426 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);
29427
29428 /**
29429  * Cleans up stale updates for all monitors.
29430  *
29431  * This function works by first listing all monitors, and then for each of them, listing all
29432  * updates. The updates that have an `update_id` less than or equal to than the stored monitor
29433  * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
29434  * be passed to [`KVStore::remove`].
29435  */
29436 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
29437
29438 /**
29439  * Constructs a new Persist which calls the relevant methods on this_arg.
29440  * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
29441  */
29442 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
29443
29444 /**
29445  * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
29446  */
29447 void UntrustedString_free(struct LDKUntrustedString this_obj);
29448
29449 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
29450
29451 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
29452
29453 /**
29454  * Constructs a new UntrustedString given each field
29455  */
29456 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
29457
29458 /**
29459  * Creates a copy of the UntrustedString
29460  */
29461 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
29462
29463 /**
29464  * Checks if two UntrustedStrings contain equal inner contents.
29465  * This ignores pointers and is_owned flags and looks at the values in fields.
29466  * Two objects with NULL inner values will be considered "equal" here.
29467  */
29468 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
29469
29470 /**
29471  * Generates a non-cryptographic 64-bit hash of the UntrustedString.
29472  */
29473 uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
29474
29475 /**
29476  * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
29477  */
29478 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
29479
29480 /**
29481  * Read a UntrustedString from a byte array, created by UntrustedString_write
29482  */
29483 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
29484
29485 /**
29486  * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
29487  */
29488 void PrintableString_free(struct LDKPrintableString this_obj);
29489
29490 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
29491
29492 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
29493
29494 /**
29495  * Constructs a new PrintableString given each field
29496  */
29497 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
29498
29499 /**
29500  * Calls the free function if one is set
29501  */
29502 void FutureCallback_free(struct LDKFutureCallback this_ptr);
29503
29504 /**
29505  * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
29506  */
29507 void Future_free(struct LDKFuture this_obj);
29508
29509 /**
29510  * Creates a copy of the Future
29511  */
29512 struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig);
29513
29514 /**
29515  * Registers a callback to be called upon completion of this future. If the future has already
29516  * completed, the callback will be called immediately.
29517  */
29518 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
29519
29520 /**
29521  * Waits until this [`Future`] completes.
29522  */
29523 void Future_wait(struct LDKFuture this_arg);
29524
29525 /**
29526  * Waits until this [`Future`] completes or the given amount of time has elapsed.
29527  *
29528  * Returns true if the [`Future`] completed, false if the time elapsed.
29529  */
29530 MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait);
29531
29532 /**
29533  * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
29534  */
29535 void Sleeper_free(struct LDKSleeper this_obj);
29536
29537 /**
29538  * Constructs a new sleeper from one future, allowing blocking on it.
29539  */
29540 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future);
29541
29542 /**
29543  * Constructs a new sleeper from two futures, allowing blocking on both at once.
29544  */
29545 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b);
29546
29547 /**
29548  * Constructs a new sleeper on many futures, allowing blocking on all at once.
29549  */
29550 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
29551
29552 /**
29553  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
29554  */
29555 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
29556
29557 /**
29558  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
29559  * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
29560  * elapsed.
29561  */
29562 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
29563
29564 /**
29565  * Creates a copy of the Level
29566  */
29567 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
29568
29569 /**
29570  * Utility method to constructs a new Gossip-variant Level
29571  */
29572 enum LDKLevel Level_gossip(void);
29573
29574 /**
29575  * Utility method to constructs a new Trace-variant Level
29576  */
29577 enum LDKLevel Level_trace(void);
29578
29579 /**
29580  * Utility method to constructs a new Debug-variant Level
29581  */
29582 enum LDKLevel Level_debug(void);
29583
29584 /**
29585  * Utility method to constructs a new Info-variant Level
29586  */
29587 enum LDKLevel Level_info(void);
29588
29589 /**
29590  * Utility method to constructs a new Warn-variant Level
29591  */
29592 enum LDKLevel Level_warn(void);
29593
29594 /**
29595  * Utility method to constructs a new Error-variant Level
29596  */
29597 enum LDKLevel Level_error(void);
29598
29599 /**
29600  * Checks if two Levels contain equal inner contents.
29601  * This ignores pointers and is_owned flags and looks at the values in fields.
29602  */
29603 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
29604
29605 /**
29606  * Generates a non-cryptographic 64-bit hash of the Level.
29607  */
29608 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
29609
29610 /**
29611  * Returns the most verbose logging level.
29612  */
29613 MUST_USE_RES enum LDKLevel Level_max(void);
29614
29615 /**
29616  * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
29617  */
29618 void Record_free(struct LDKRecord this_obj);
29619
29620 /**
29621  * The verbosity level of the message.
29622  */
29623 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
29624
29625 /**
29626  * The verbosity level of the message.
29627  */
29628 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
29629
29630 /**
29631  * The node id of the peer pertaining to the logged record.
29632  *
29633  * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
29634  * `None`, depending on if the peer information is readily available in LDK when the log is
29635  * generated.
29636  *
29637  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29638  */
29639 struct LDKPublicKey Record_get_peer_id(const struct LDKRecord *NONNULL_PTR this_ptr);
29640
29641 /**
29642  * The node id of the peer pertaining to the logged record.
29643  *
29644  * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
29645  * `None`, depending on if the peer information is readily available in LDK when the log is
29646  * generated.
29647  *
29648  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29649  */
29650 void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29651
29652 /**
29653  * The channel id of the channel pertaining to the logged record. May be a temporary id before
29654  * the channel has been funded.
29655  */
29656 struct LDKCOption_ThirtyTwoBytesZ Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr);
29657
29658 /**
29659  * The channel id of the channel pertaining to the logged record. May be a temporary id before
29660  * the channel has been funded.
29661  */
29662 void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
29663
29664 /**
29665  * The message body.
29666  */
29667 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
29668
29669 /**
29670  * The message body.
29671  */
29672 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
29673
29674 /**
29675  * The module path of the message.
29676  */
29677 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
29678
29679 /**
29680  * The module path of the message.
29681  */
29682 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
29683
29684 /**
29685  * The source file containing the message.
29686  */
29687 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
29688
29689 /**
29690  * The source file containing the message.
29691  */
29692 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
29693
29694 /**
29695  * The line containing the message.
29696  */
29697 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
29698
29699 /**
29700  * The line containing the message.
29701  */
29702 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
29703
29704 /**
29705  * Constructs a new Record given each field
29706  *
29707  * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
29708  */
29709 MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKCOption_ThirtyTwoBytesZ channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg);
29710
29711 /**
29712  * Creates a copy of the Record
29713  */
29714 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
29715
29716 /**
29717  * Calls the free function if one is set
29718  */
29719 void Logger_free(struct LDKLogger this_ptr);
29720
29721 /**
29722  * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
29723  */
29724 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
29725
29726 /**
29727  * Confirmations we will wait for before considering the channel locked in.
29728  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
29729  * equivalent limit applied to outbound channels).
29730  *
29731  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
29732  * transaction before operation. If you wish to accept channels with zero confirmations, see
29733  * [`UserConfig::manually_accept_inbound_channels`] and
29734  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
29735  *
29736  * Default value: 6.
29737  *
29738  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
29739  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
29740  */
29741 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29742
29743 /**
29744  * Confirmations we will wait for before considering the channel locked in.
29745  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
29746  * equivalent limit applied to outbound channels).
29747  *
29748  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
29749  * transaction before operation. If you wish to accept channels with zero confirmations, see
29750  * [`UserConfig::manually_accept_inbound_channels`] and
29751  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
29752  *
29753  * Default value: 6.
29754  *
29755  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
29756  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
29757  */
29758 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
29759
29760 /**
29761  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
29762  * the number of blocks we have to punish our counterparty if they broadcast a revoked
29763  * transaction).
29764  *
29765  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
29766  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
29767  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
29768  * possibly with time in between to RBF the spending transaction).
29769  *
29770  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
29771  * case of an honest unilateral channel close, which implicitly decrease the economic value of
29772  * our channel.
29773  *
29774  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
29775  * can tweak config to ask for more security, not less.
29776  */
29777 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29778
29779 /**
29780  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
29781  * the number of blocks we have to punish our counterparty if they broadcast a revoked
29782  * transaction).
29783  *
29784  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
29785  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
29786  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
29787  * possibly with time in between to RBF the spending transaction).
29788  *
29789  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
29790  * case of an honest unilateral channel close, which implicitly decrease the economic value of
29791  * our channel.
29792  *
29793  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
29794  * can tweak config to ask for more security, not less.
29795  */
29796 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
29797
29798 /**
29799  * Set to the smallest value HTLC we will accept to process.
29800  *
29801  * This value is sent to our counterparty on channel-open and we close the channel any time
29802  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
29803  *
29804  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
29805  * by the protocol.
29806  */
29807 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29808
29809 /**
29810  * Set to the smallest value HTLC we will accept to process.
29811  *
29812  * This value is sent to our counterparty on channel-open and we close the channel any time
29813  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
29814  *
29815  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
29816  * by the protocol.
29817  */
29818 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
29819
29820 /**
29821  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
29822  * HTLCs to.
29823  *
29824  * This can be set to a value between 1-100, where the value corresponds to the percent of the
29825  * channel value in whole percentages.
29826  *
29827  * Note that:
29828  * * If configured to another value than the default value 10, any new channels created with
29829  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
29830  * `ChannelManager`.
29831  *
29832  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
29833  * no way to configure the cap for the total value of outbound HTLCs in-flight.
29834  *
29835  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
29836  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
29837  * restrict exposure to loss due to being offline for too long.
29838  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
29839  * for more information.
29840  *
29841  * Default value: 10.
29842  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
29843  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
29844  */
29845 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29846
29847 /**
29848  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
29849  * HTLCs to.
29850  *
29851  * This can be set to a value between 1-100, where the value corresponds to the percent of the
29852  * channel value in whole percentages.
29853  *
29854  * Note that:
29855  * * If configured to another value than the default value 10, any new channels created with
29856  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
29857  * `ChannelManager`.
29858  *
29859  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
29860  * no way to configure the cap for the total value of outbound HTLCs in-flight.
29861  *
29862  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
29863  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
29864  * restrict exposure to loss due to being offline for too long.
29865  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
29866  * for more information.
29867  *
29868  * Default value: 10.
29869  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
29870  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
29871  */
29872 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
29873
29874 /**
29875  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
29876  * BOLTs) option for outbound private channels. This provides better privacy by not including
29877  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
29878  * relay HTLCs to us using the channel's SCID alias.
29879  *
29880  * If this option is set, channels may be created that will not be readable by LDK versions
29881  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
29882  * [`DecodeError::InvalidValue`].
29883  *
29884  * Note that setting this to true does *not* prevent us from opening channels with
29885  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
29886  * private channel without that option.
29887  *
29888  * Ignored if the channel is negotiated to be announced, see
29889  * [`ChannelHandshakeConfig::announced_channel`] and
29890  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
29891  *
29892  * Default value: false. This value is likely to change to true in the future.
29893  *
29894  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
29895  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
29896  */
29897 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29898
29899 /**
29900  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
29901  * BOLTs) option for outbound private channels. This provides better privacy by not including
29902  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
29903  * relay HTLCs to us using the channel's SCID alias.
29904  *
29905  * If this option is set, channels may be created that will not be readable by LDK versions
29906  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
29907  * [`DecodeError::InvalidValue`].
29908  *
29909  * Note that setting this to true does *not* prevent us from opening channels with
29910  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
29911  * private channel without that option.
29912  *
29913  * Ignored if the channel is negotiated to be announced, see
29914  * [`ChannelHandshakeConfig::announced_channel`] and
29915  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
29916  *
29917  * Default value: false. This value is likely to change to true in the future.
29918  *
29919  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
29920  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
29921  */
29922 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
29923
29924 /**
29925  * Set to announce the channel publicly and notify all nodes that they can route via this
29926  * channel.
29927  *
29928  * This should only be set to true for nodes which expect to be online reliably.
29929  *
29930  * As the node which funds a channel picks this value this will only apply for new outbound
29931  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
29932  *
29933  * Default value: false.
29934  */
29935 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29936
29937 /**
29938  * Set to announce the channel publicly and notify all nodes that they can route via this
29939  * channel.
29940  *
29941  * This should only be set to true for nodes which expect to be online reliably.
29942  *
29943  * As the node which funds a channel picks this value this will only apply for new outbound
29944  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
29945  *
29946  * Default value: false.
29947  */
29948 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
29949
29950 /**
29951  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
29952  * supports it, they will then enforce the mutual-close output to us matches what we provided
29953  * at intialization, preventing us from closing to an alternate pubkey.
29954  *
29955  * This is set to true by default to provide a slight increase in security, though ultimately
29956  * any attacker who is able to take control of a channel can just as easily send the funds via
29957  * lightning payments, so we never require that our counterparties support this option.
29958  *
29959  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
29960  *
29961  * Default value: true.
29962  *
29963  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
29964  */
29965 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29966
29967 /**
29968  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
29969  * supports it, they will then enforce the mutual-close output to us matches what we provided
29970  * at intialization, preventing us from closing to an alternate pubkey.
29971  *
29972  * This is set to true by default to provide a slight increase in security, though ultimately
29973  * any attacker who is able to take control of a channel can just as easily send the funds via
29974  * lightning payments, so we never require that our counterparties support this option.
29975  *
29976  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
29977  *
29978  * Default value: true.
29979  *
29980  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
29981  */
29982 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
29983
29984 /**
29985  * The Proportion of the channel value to configure as counterparty's channel reserve,
29986  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
29987  *
29988  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
29989  * on their side, at all times.
29990  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
29991  * claiming at least this value on chain.
29992  *
29993  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
29994  * amount can never be used for payments.
29995  * Also, if our selected channel reserve for counterparty and counterparty's selected
29996  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
29997  * will fail.
29998  *
29999  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
30000  * other than the default value.
30001  *
30002  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
30003  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
30004  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
30005  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
30006  *                instead, although channel negotiations will fail in that case.
30007  */
30008 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
30009
30010 /**
30011  * The Proportion of the channel value to configure as counterparty's channel reserve,
30012  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
30013  *
30014  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
30015  * on their side, at all times.
30016  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
30017  * claiming at least this value on chain.
30018  *
30019  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
30020  * amount can never be used for payments.
30021  * Also, if our selected channel reserve for counterparty and counterparty's selected
30022  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
30023  * will fail.
30024  *
30025  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
30026  * other than the default value.
30027  *
30028  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
30029  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
30030  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
30031  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
30032  *                instead, although channel negotiations will fail in that case.
30033  */
30034 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
30035
30036 /**
30037  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
30038  * channels. This feature requires having a reserve of onchain funds readily available to bump
30039  * transactions in the event of a channel force close to avoid the possibility of losing funds.
30040  *
30041  * Note that if you wish accept inbound channels with anchor outputs, you must enable
30042  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
30043  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
30044  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
30045  * channels featuring anchor outputs in the event of a force close.
30046  *
30047  * If this option is set, channels may be created that will not be readable by LDK versions
30048  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
30049  * [`DecodeError::InvalidValue`].
30050  *
30051  * Note that setting this to true does *not* prevent us from opening channels with
30052  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
30053  * fall back to a `static_remote_key` channel.
30054  *
30055  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
30056  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
30057  * Considered Harmful`] mailing list post.
30058  *
30059  * Default value: false. This value is likely to change to true in the future.
30060  *
30061  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
30062  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
30063  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
30064  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
30065  */
30066 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
30067
30068 /**
30069  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
30070  * channels. This feature requires having a reserve of onchain funds readily available to bump
30071  * transactions in the event of a channel force close to avoid the possibility of losing funds.
30072  *
30073  * Note that if you wish accept inbound channels with anchor outputs, you must enable
30074  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
30075  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
30076  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
30077  * channels featuring anchor outputs in the event of a force close.
30078  *
30079  * If this option is set, channels may be created that will not be readable by LDK versions
30080  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
30081  * [`DecodeError::InvalidValue`].
30082  *
30083  * Note that setting this to true does *not* prevent us from opening channels with
30084  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
30085  * fall back to a `static_remote_key` channel.
30086  *
30087  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
30088  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
30089  * Considered Harmful`] mailing list post.
30090  *
30091  * Default value: false. This value is likely to change to true in the future.
30092  *
30093  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
30094  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
30095  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
30096  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
30097  */
30098 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
30099
30100 /**
30101  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
30102  *
30103  * Increasing the value can help improve liquidity and stability in
30104  * routing at the cost of higher long term disk / DB usage.
30105  *
30106  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
30107  * other than the default value.
30108  *
30109  * Default value: 50
30110  * Maximum value: 483, any values larger will be treated as 483.
30111  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
30112  */
30113 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
30114
30115 /**
30116  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
30117  *
30118  * Increasing the value can help improve liquidity and stability in
30119  * routing at the cost of higher long term disk / DB usage.
30120  *
30121  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
30122  * other than the default value.
30123  *
30124  * Default value: 50
30125  * Maximum value: 483, any values larger will be treated as 483.
30126  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
30127  */
30128 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
30129
30130 /**
30131  * Constructs a new ChannelHandshakeConfig given each field
30132  */
30133 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);
30134
30135 /**
30136  * Creates a copy of the ChannelHandshakeConfig
30137  */
30138 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
30139
30140 /**
30141  * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
30142  */
30143 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
30144
30145 /**
30146  * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
30147  */
30148 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
30149
30150 /**
30151  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
30152  * only applies to inbound channels.
30153  *
30154  * Default value: 0.
30155  */
30156 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30157
30158 /**
30159  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
30160  * only applies to inbound channels.
30161  *
30162  * Default value: 0.
30163  */
30164 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30165
30166 /**
30167  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
30168  * only applies to inbound channels.
30169  *
30170  * Default value: 2^24 - 1.
30171  */
30172 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30173
30174 /**
30175  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
30176  * only applies to inbound channels.
30177  *
30178  * Default value: 2^24 - 1.
30179  */
30180 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30181
30182 /**
30183  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
30184  * you to limit the maximum minimum-size they can require.
30185  *
30186  * Default value: u64::max_value.
30187  */
30188 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30189
30190 /**
30191  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
30192  * you to limit the maximum minimum-size they can require.
30193  *
30194  * Default value: u64::max_value.
30195  */
30196 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30197
30198 /**
30199  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
30200  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
30201  *
30202  * Default value: 0.
30203  */
30204 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30205
30206 /**
30207  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
30208  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
30209  *
30210  * Default value: 0.
30211  */
30212 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30213
30214 /**
30215  * The remote node will require we keep a certain amount in direct payment to ourselves at all
30216  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
30217  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
30218  *
30219  * Default value: u64::max_value.
30220  */
30221 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30222
30223 /**
30224  * The remote node will require we keep a certain amount in direct payment to ourselves at all
30225  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
30226  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
30227  *
30228  * Default value: u64::max_value.
30229  */
30230 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30231
30232 /**
30233  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
30234  * time. This allows you to set a minimum such value.
30235  *
30236  * Default value: 0.
30237  */
30238 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30239
30240 /**
30241  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
30242  * time. This allows you to set a minimum such value.
30243  *
30244  * Default value: 0.
30245  */
30246 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
30247
30248 /**
30249  * Before a channel is usable the funding transaction will need to be confirmed by at least a
30250  * certain number of blocks, specified by the node which is not the funder (as the funder can
30251  * assume they aren't going to double-spend themselves).
30252  * This config allows you to set a limit on the maximum amount of time to wait.
30253  *
30254  * Default value: 144, or roughly one day and only applies to outbound channels.
30255  */
30256 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30257
30258 /**
30259  * Before a channel is usable the funding transaction will need to be confirmed by at least a
30260  * certain number of blocks, specified by the node which is not the funder (as the funder can
30261  * assume they aren't going to double-spend themselves).
30262  * This config allows you to set a limit on the maximum amount of time to wait.
30263  *
30264  * Default value: 144, or roughly one day and only applies to outbound channels.
30265  */
30266 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
30267
30268 /**
30269  * Whether we implicitly trust funding transactions generated by us for our own outbound
30270  * channels to not be double-spent.
30271  *
30272  * If this is set, we assume that our own funding transactions are *never* double-spent, and
30273  * thus we can trust them without any confirmations. This is generally a reasonable
30274  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
30275  * control of the signing keys).
30276  *
30277  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
30278  * double-spend the funding transaction to RBF with an alternative channel open.
30279  *
30280  * This only applies if our counterparty set their confirmations-required value to 0, and we
30281  * always trust our own funding transaction at 1 confirmation irrespective of this value.
30282  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
30283  * `true` (0) and `false` (1).
30284  *
30285  * Default value: true
30286  */
30287 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30288
30289 /**
30290  * Whether we implicitly trust funding transactions generated by us for our own outbound
30291  * channels to not be double-spent.
30292  *
30293  * If this is set, we assume that our own funding transactions are *never* double-spent, and
30294  * thus we can trust them without any confirmations. This is generally a reasonable
30295  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
30296  * control of the signing keys).
30297  *
30298  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
30299  * double-spend the funding transaction to RBF with an alternative channel open.
30300  *
30301  * This only applies if our counterparty set their confirmations-required value to 0, and we
30302  * always trust our own funding transaction at 1 confirmation irrespective of this value.
30303  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
30304  * `true` (0) and `false` (1).
30305  *
30306  * Default value: true
30307  */
30308 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
30309
30310 /**
30311  * Set to force an incoming channel to match our announced channel preference in
30312  * [`ChannelHandshakeConfig::announced_channel`].
30313  *
30314  * For a node which is not online reliably, this should be set to true and
30315  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
30316  * channels will ever be opened.
30317  *
30318  * Default value: true.
30319  */
30320 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30321
30322 /**
30323  * Set to force an incoming channel to match our announced channel preference in
30324  * [`ChannelHandshakeConfig::announced_channel`].
30325  *
30326  * For a node which is not online reliably, this should be set to true and
30327  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
30328  * channels will ever be opened.
30329  *
30330  * Default value: true.
30331  */
30332 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
30333
30334 /**
30335  * Set to the amount of time we're willing to wait to claim money back to us.
30336  *
30337  * Not checking this value would be a security issue, as our peer would be able to set it to
30338  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
30339  *
30340  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
30341  * reduce the loss of having useless locked funds (if your peer accepts)
30342  */
30343 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30344
30345 /**
30346  * Set to the amount of time we're willing to wait to claim money back to us.
30347  *
30348  * Not checking this value would be a security issue, as our peer would be able to set it to
30349  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
30350  *
30351  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
30352  * reduce the loss of having useless locked funds (if your peer accepts)
30353  */
30354 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
30355
30356 /**
30357  * Constructs a new ChannelHandshakeLimits given each field
30358  */
30359 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);
30360
30361 /**
30362  * Creates a copy of the ChannelHandshakeLimits
30363  */
30364 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
30365
30366 /**
30367  * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
30368  */
30369 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
30370
30371 /**
30372  * Frees any resources used by the MaxDustHTLCExposure
30373  */
30374 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
30375
30376 /**
30377  * Creates a copy of the MaxDustHTLCExposure
30378  */
30379 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
30380
30381 /**
30382  * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
30383  */
30384 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
30385
30386 /**
30387  * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
30388  */
30389 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
30390
30391 /**
30392  * Checks if two MaxDustHTLCExposures contain equal inner contents.
30393  * This ignores pointers and is_owned flags and looks at the values in fields.
30394  */
30395 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
30396
30397 /**
30398  * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
30399  */
30400 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
30401
30402 /**
30403  * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
30404  */
30405 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
30406
30407 /**
30408  * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
30409  */
30410 void ChannelConfig_free(struct LDKChannelConfig this_obj);
30411
30412 /**
30413  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
30414  * over the channel.
30415  * This may be allowed to change at runtime in a later update, however doing so must result in
30416  * update messages sent to notify all nodes of our updated relay fee.
30417  *
30418  * Default value: 0.
30419  */
30420 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30421
30422 /**
30423  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
30424  * over the channel.
30425  * This may be allowed to change at runtime in a later update, however doing so must result in
30426  * update messages sent to notify all nodes of our updated relay fee.
30427  *
30428  * Default value: 0.
30429  */
30430 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
30431
30432 /**
30433  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
30434  * excess of [`forwarding_fee_proportional_millionths`].
30435  * This may be allowed to change at runtime in a later update, however doing so must result in
30436  * update messages sent to notify all nodes of our updated relay fee.
30437  *
30438  * The default value of a single satoshi roughly matches the market rate on many routing nodes
30439  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
30440  * this node.
30441  *
30442  * Default value: 1000.
30443  *
30444  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
30445  */
30446 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30447
30448 /**
30449  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
30450  * excess of [`forwarding_fee_proportional_millionths`].
30451  * This may be allowed to change at runtime in a later update, however doing so must result in
30452  * update messages sent to notify all nodes of our updated relay fee.
30453  *
30454  * The default value of a single satoshi roughly matches the market rate on many routing nodes
30455  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
30456  * this node.
30457  *
30458  * Default value: 1000.
30459  *
30460  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
30461  */
30462 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
30463
30464 /**
30465  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
30466  * the channel this config applies to.
30467  *
30468  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
30469  * HTLC balance when a channel appears on-chain whereas
30470  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
30471  * (non-HTLC-encumbered) balance.
30472  *
30473  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
30474  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
30475  * commitment transaction at least once per this many blocks (minus some margin to allow us
30476  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
30477  * the spending transaction).
30478  *
30479  * Default value: 72 (12 hours at an average of 6 blocks/hour).
30480  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
30481  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
30482  *
30483  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
30484  */
30485 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30486
30487 /**
30488  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
30489  * the channel this config applies to.
30490  *
30491  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
30492  * HTLC balance when a channel appears on-chain whereas
30493  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
30494  * (non-HTLC-encumbered) balance.
30495  *
30496  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
30497  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
30498  * commitment transaction at least once per this many blocks (minus some margin to allow us
30499  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
30500  * the spending transaction).
30501  *
30502  * Default value: 72 (12 hours at an average of 6 blocks/hour).
30503  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
30504  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
30505  *
30506  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
30507  */
30508 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
30509
30510 /**
30511  * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
30512  * small to claim on-chain.
30513  *
30514  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
30515  * not be claimable on-chain, instead being turned into additional miner fees if either
30516  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
30517  * to such payments may be sustantial if there are many dust HTLCs present when the
30518  * channel is force-closed.
30519  *
30520  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
30521  * channel negotiated throughout the channel open process, along with the fees required to have
30522  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
30523  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
30524  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
30525  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
30526  * variant is primarily intended for use with pre-anchor channels.
30527  *
30528  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
30529  * exposure across all three types per-channel.
30530  *
30531  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
30532  */
30533 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30534
30535 /**
30536  * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
30537  * small to claim on-chain.
30538  *
30539  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
30540  * not be claimable on-chain, instead being turned into additional miner fees if either
30541  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
30542  * to such payments may be sustantial if there are many dust HTLCs present when the
30543  * channel is force-closed.
30544  *
30545  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
30546  * channel negotiated throughout the channel open process, along with the fees required to have
30547  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
30548  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
30549  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
30550  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
30551  * variant is primarily intended for use with pre-anchor channels.
30552  *
30553  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
30554  * exposure across all three types per-channel.
30555  *
30556  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
30557  */
30558 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
30559
30560 /**
30561  * The additional fee we're willing to pay to avoid waiting for the counterparty's
30562  * `to_self_delay` to reclaim funds.
30563  *
30564  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
30565  * closing transaction which both sides find acceptable, ultimately paid by the channel
30566  * funder/initiator.
30567  *
30568  * When we are the funder, because we have to pay the channel closing fee, we bound the
30569  * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
30570  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
30571  * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
30572  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
30573  * funds.
30574  *
30575  * When we are not the funder, we require the closing transaction fee pay at least our
30576  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
30577  * Thus, this value is ignored when we are not the funder.
30578  *
30579  * Default value: 1000 satoshis.
30580  *
30581  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
30582  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
30583  */
30584 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30585
30586 /**
30587  * The additional fee we're willing to pay to avoid waiting for the counterparty's
30588  * `to_self_delay` to reclaim funds.
30589  *
30590  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
30591  * closing transaction which both sides find acceptable, ultimately paid by the channel
30592  * funder/initiator.
30593  *
30594  * When we are the funder, because we have to pay the channel closing fee, we bound the
30595  * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
30596  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
30597  * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
30598  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
30599  * funds.
30600  *
30601  * When we are not the funder, we require the closing transaction fee pay at least our
30602  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
30603  * Thus, this value is ignored when we are not the funder.
30604  *
30605  * Default value: 1000 satoshis.
30606  *
30607  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
30608  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
30609  */
30610 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
30611
30612 /**
30613  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
30614  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
30615  *
30616  * Usage:
30617  * - The payee will set this option and set its invoice route hints to use [intercept scids]
30618  *   generated by this channel's counterparty.
30619  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
30620  *   [`forward_intercepted_htlc`] with less than the amount provided in
30621  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
30622  *   actual forward amounts is their fee. See
30623  *   <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
30624  *   for how this feature may be used in the LSP use case.
30625  *
30626  * # Note
30627  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
30628  * as-expected if this feature is activated, otherwise they may lose money!
30629  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
30630  * counterparty.
30631  *
30632  * # Note
30633  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
30634  * Unsetting this flag between restarts may lead to payment receive failures.
30635  *
30636  * Default value: false.
30637  *
30638  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
30639  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
30640  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
30641  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
30642  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
30643  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
30644  */
30645 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30646
30647 /**
30648  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
30649  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
30650  *
30651  * Usage:
30652  * - The payee will set this option and set its invoice route hints to use [intercept scids]
30653  *   generated by this channel's counterparty.
30654  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
30655  *   [`forward_intercepted_htlc`] with less than the amount provided in
30656  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
30657  *   actual forward amounts is their fee. See
30658  *   <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
30659  *   for how this feature may be used in the LSP use case.
30660  *
30661  * # Note
30662  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
30663  * as-expected if this feature is activated, otherwise they may lose money!
30664  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
30665  * counterparty.
30666  *
30667  * # Note
30668  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
30669  * Unsetting this flag between restarts may lead to payment receive failures.
30670  *
30671  * Default value: false.
30672  *
30673  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
30674  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
30675  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
30676  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
30677  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
30678  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
30679  */
30680 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
30681
30682 /**
30683  * Constructs a new ChannelConfig given each field
30684  */
30685 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);
30686
30687 /**
30688  * Creates a copy of the ChannelConfig
30689  */
30690 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
30691
30692 /**
30693  * Checks if two ChannelConfigs contain equal inner contents.
30694  * This ignores pointers and is_owned flags and looks at the values in fields.
30695  * Two objects with NULL inner values will be considered "equal" here.
30696  */
30697 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
30698
30699 /**
30700  * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
30701  */
30702 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
30703
30704 /**
30705  * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
30706  */
30707 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
30708
30709 /**
30710  * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
30711  */
30712 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
30713
30714 /**
30715  * Read a ChannelConfig from a byte array, created by ChannelConfig_write
30716  */
30717 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
30718
30719 /**
30720  * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
30721  */
30722 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
30723
30724 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30725
30726 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30727
30728 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30729
30730 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30731
30732 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30733
30734 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
30735
30736 /**
30737  *
30738  * Returns a copy of the field.
30739  */
30740 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30741
30742 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
30743
30744 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30745
30746 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30747
30748 /**
30749  * Constructs a new ChannelConfigUpdate given each field
30750  */
30751 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);
30752
30753 /**
30754  * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
30755  */
30756 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
30757
30758 /**
30759  * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
30760  */
30761 void UserConfig_free(struct LDKUserConfig this_obj);
30762
30763 /**
30764  * Channel handshake config that we propose to our counterparty.
30765  */
30766 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30767
30768 /**
30769  * Channel handshake config that we propose to our counterparty.
30770  */
30771 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
30772
30773 /**
30774  * Limits applied to our counterparty's proposed channel handshake config settings.
30775  */
30776 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30777
30778 /**
30779  * Limits applied to our counterparty's proposed channel handshake config settings.
30780  */
30781 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
30782
30783 /**
30784  * Channel config which affects behavior during channel lifetime.
30785  */
30786 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30787
30788 /**
30789  * Channel config which affects behavior during channel lifetime.
30790  */
30791 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
30792
30793 /**
30794  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
30795  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
30796  * node which is not online reliably.
30797  *
30798  * For nodes which are not online reliably, you should set all channels to *not* be announced
30799  * (using [`ChannelHandshakeConfig::announced_channel`] and
30800  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
30801  * ensure you are not exposed to any forwarding risk.
30802  *
30803  * Note that because you cannot change a channel's announced state after creation, there is no
30804  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
30805  * from a publicly-announced forwarding node to a private non-forwarding node you must close
30806  * all your channels and open new ones. For privacy, you should also change your node_id
30807  * (swapping all private and public key material for new ones) at that time.
30808  *
30809  * Default value: false.
30810  */
30811 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30812
30813 /**
30814  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
30815  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
30816  * node which is not online reliably.
30817  *
30818  * For nodes which are not online reliably, you should set all channels to *not* be announced
30819  * (using [`ChannelHandshakeConfig::announced_channel`] and
30820  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
30821  * ensure you are not exposed to any forwarding risk.
30822  *
30823  * Note that because you cannot change a channel's announced state after creation, there is no
30824  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
30825  * from a publicly-announced forwarding node to a private non-forwarding node you must close
30826  * all your channels and open new ones. For privacy, you should also change your node_id
30827  * (swapping all private and public key material for new ones) at that time.
30828  *
30829  * Default value: false.
30830  */
30831 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30832
30833 /**
30834  * If this is set to false, we do not accept inbound requests to open a new channel.
30835  * Default value: true.
30836  */
30837 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30838
30839 /**
30840  * If this is set to false, we do not accept inbound requests to open a new channel.
30841  * Default value: true.
30842  */
30843 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30844
30845 /**
30846  * If this is set to true, the user needs to manually accept inbound requests to open a new
30847  * channel.
30848  *
30849  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
30850  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
30851  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
30852  * user explicitly chooses to accept the request.
30853  *
30854  * Default value: false.
30855  *
30856  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
30857  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
30858  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
30859  */
30860 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30861
30862 /**
30863  * If this is set to true, the user needs to manually accept inbound requests to open a new
30864  * channel.
30865  *
30866  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
30867  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
30868  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
30869  * user explicitly chooses to accept the request.
30870  *
30871  * Default value: false.
30872  *
30873  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
30874  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
30875  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
30876  */
30877 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30878
30879 /**
30880  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
30881  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
30882  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
30883  *
30884  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
30885  *
30886  *  Default value: false.
30887  *
30888  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
30889  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
30890  */
30891 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30892
30893 /**
30894  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
30895  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
30896  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
30897  *
30898  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
30899  *
30900  *  Default value: false.
30901  *
30902  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
30903  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
30904  */
30905 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30906
30907 /**
30908  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
30909  * parts. If this is set to true, we'll accept the payment.
30910  *
30911  * Setting this to true will break backwards compatibility upon downgrading to an LDK
30912  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
30913  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
30914  *
30915  * Default value: false.
30916  *
30917  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
30918  */
30919 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30920
30921 /**
30922  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
30923  * parts. If this is set to true, we'll accept the payment.
30924  *
30925  * Setting this to true will break backwards compatibility upon downgrading to an LDK
30926  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
30927  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
30928  *
30929  * Default value: false.
30930  *
30931  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
30932  */
30933 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30934
30935 /**
30936  * Constructs a new UserConfig given each field
30937  */
30938 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);
30939
30940 /**
30941  * Creates a copy of the UserConfig
30942  */
30943 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
30944
30945 /**
30946  * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
30947  */
30948 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
30949
30950 /**
30951  * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
30952  */
30953 void BestBlock_free(struct LDKBestBlock this_obj);
30954
30955 /**
30956  * Creates a copy of the BestBlock
30957  */
30958 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
30959
30960 /**
30961  * Checks if two BestBlocks contain equal inner contents.
30962  * This ignores pointers and is_owned flags and looks at the values in fields.
30963  * Two objects with NULL inner values will be considered "equal" here.
30964  */
30965 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
30966
30967 /**
30968  * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
30969  * network.
30970  */
30971 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
30972
30973 /**
30974  * Returns a `BestBlock` as identified by the given block hash and height.
30975  */
30976 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
30977
30978 /**
30979  * Returns the best block hash.
30980  */
30981 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
30982
30983 /**
30984  * Returns the best block height.
30985  */
30986 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
30987
30988 /**
30989  * Calls the free function if one is set
30990  */
30991 void Listen_free(struct LDKListen this_ptr);
30992
30993 /**
30994  * Calls the free function if one is set
30995  */
30996 void Confirm_free(struct LDKConfirm this_ptr);
30997
30998 /**
30999  * Creates a copy of the ChannelMonitorUpdateStatus
31000  */
31001 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
31002
31003 /**
31004  * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
31005  */
31006 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
31007
31008 /**
31009  * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
31010  */
31011 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
31012
31013 /**
31014  * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
31015  */
31016 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
31017
31018 /**
31019  * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
31020  * This ignores pointers and is_owned flags and looks at the values in fields.
31021  */
31022 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
31023
31024 /**
31025  * Calls the free function if one is set
31026  */
31027 void Watch_free(struct LDKWatch this_ptr);
31028
31029 /**
31030  * Calls the free function if one is set
31031  */
31032 void Filter_free(struct LDKFilter this_ptr);
31033
31034 /**
31035  * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
31036  */
31037 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
31038
31039 /**
31040  * First block where the transaction output may have been spent.
31041  */
31042 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
31043
31044 /**
31045  * First block where the transaction output may have been spent.
31046  */
31047 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
31048
31049 /**
31050  * Outpoint identifying the transaction output.
31051  */
31052 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
31053
31054 /**
31055  * Outpoint identifying the transaction output.
31056  */
31057 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
31058
31059 /**
31060  * Spending condition of the transaction output.
31061  */
31062 struct LDKCVec_u8Z WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
31063
31064 /**
31065  * Spending condition of the transaction output.
31066  */
31067 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
31068
31069 /**
31070  * Constructs a new WatchedOutput given each field
31071  */
31072 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
31073
31074 /**
31075  * Creates a copy of the WatchedOutput
31076  */
31077 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
31078
31079 /**
31080  * Checks if two WatchedOutputs contain equal inner contents.
31081  * This ignores pointers and is_owned flags and looks at the values in fields.
31082  * Two objects with NULL inner values will be considered "equal" here.
31083  */
31084 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
31085
31086 /**
31087  * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
31088  */
31089 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
31090
31091 /**
31092  * Calls the free function if one is set
31093  */
31094 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
31095
31096 /**
31097  * Creates a copy of the ConfirmationTarget
31098  */
31099 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
31100
31101 /**
31102  * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
31103  */
31104 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
31105
31106 /**
31107  * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
31108  */
31109 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
31110
31111 /**
31112  * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
31113  */
31114 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
31115
31116 /**
31117  * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
31118  */
31119 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
31120
31121 /**
31122  * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
31123  */
31124 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
31125
31126 /**
31127  * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
31128  */
31129 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
31130
31131 /**
31132  * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
31133  */
31134 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
31135
31136 /**
31137  * Checks if two ConfirmationTargets contain equal inner contents.
31138  * This ignores pointers and is_owned flags and looks at the values in fields.
31139  */
31140 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
31141
31142 /**
31143  * Calls the free function if one is set
31144  */
31145 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
31146
31147 /**
31148  * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
31149  */
31150 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
31151
31152 /**
31153  * Creates a copy of the MonitorUpdateId
31154  */
31155 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
31156
31157 /**
31158  * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
31159  */
31160 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
31161
31162 /**
31163  * Checks if two MonitorUpdateIds contain equal inner contents.
31164  * This ignores pointers and is_owned flags and looks at the values in fields.
31165  * Two objects with NULL inner values will be considered "equal" here.
31166  */
31167 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
31168
31169 /**
31170  * Calls the free function if one is set
31171  */
31172 void Persist_free(struct LDKPersist this_ptr);
31173
31174 /**
31175  * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
31176  */
31177 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
31178
31179 /**
31180  * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
31181  */
31182 void ChainMonitor_free(struct LDKChainMonitor this_obj);
31183
31184 /**
31185  * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
31186  *
31187  * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
31188  * will call back to it indicating transactions and outputs of interest. This allows clients to
31189  * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
31190  * always need to fetch full blocks absent another means for determining which blocks contain
31191  * transactions relevant to the watched channels.
31192  */
31193 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
31194
31195 /**
31196  * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
31197  * claims which are awaiting confirmation.
31198  *
31199  * Includes the balances from each [`ChannelMonitor`] *except* those included in
31200  * `ignored_channels`, allowing you to filter out balances from channels which are still open
31201  * (and whose balance should likely be pulled from the [`ChannelDetails`]).
31202  *
31203  * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
31204  * inclusion in the return value.
31205  */
31206 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
31207
31208 /**
31209  * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
31210  * such [`ChannelMonitor`] is currently being monitored for.
31211  *
31212  * Note that the result holds a mutex over our monitor set, and should not be held
31213  * indefinitely.
31214  */
31215 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
31216
31217 /**
31218  * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
31219  *
31220  * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
31221  * monitoring for on-chain state resolutions.
31222  */
31223 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31224
31225 /**
31226  * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
31227  */
31228 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31229
31230 /**
31231  * Indicates the persistence of a [`ChannelMonitor`] has completed after
31232  * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
31233  *
31234  * Thus, the anticipated use is, at a high level:
31235  *  1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
31236  *     update to disk and begins updating any remote (e.g. watchtower/backup) copies,
31237  *     returning [`ChannelMonitorUpdateStatus::InProgress`],
31238  *  2) once all remote copies are updated, you call this function with the
31239  *     `completed_update_id` that completed, and once all pending updates have completed the
31240  *     channel will be re-enabled.
31241  *
31242  * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
31243  * registered [`ChannelMonitor`]s.
31244  */
31245 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);
31246
31247 /**
31248  * Gets a [`Future`] that completes when an event is available either via
31249  * [`chain::Watch::release_pending_monitor_events`] or
31250  * [`EventsProvider::process_pending_events`].
31251  *
31252  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
31253  * [`ChainMonitor`] and should instead register actions to be taken later.
31254  *
31255  * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
31256  */
31257 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31258
31259 /**
31260  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
31261  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
31262  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
31263  * invoking this every 30 seconds, or lower if running in an environment with spotty
31264  * connections, like on mobile.
31265  */
31266 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31267
31268 /**
31269  * Constructs a new Listen which calls the relevant methods on this_arg.
31270  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
31271  */
31272 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31273
31274 /**
31275  * Constructs a new Confirm which calls the relevant methods on this_arg.
31276  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
31277  */
31278 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31279
31280 /**
31281  * Constructs a new Watch which calls the relevant methods on this_arg.
31282  * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
31283  */
31284 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31285
31286 /**
31287  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
31288  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
31289  */
31290 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31291
31292 /**
31293  * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
31294  */
31295 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
31296
31297 /**
31298  * The sequence number of this update. Updates *must* be replayed in-order according to this
31299  * sequence number (and updates may panic if they are not). The update_id values are strictly
31300  * increasing and increase by one for each new update, with two exceptions specified below.
31301  *
31302  * This sequence number is also used to track up to which points updates which returned
31303  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
31304  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
31305  *
31306  * The only instances we allow where update_id values are not strictly increasing have a
31307  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
31308  * will force close the channel by broadcasting the latest commitment transaction or
31309  * special post-force-close updates, like providing preimages necessary to claim outputs on the
31310  * broadcast commitment transaction. See its docs for more details.
31311  *
31312  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
31313  */
31314 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
31315
31316 /**
31317  * The sequence number of this update. Updates *must* be replayed in-order according to this
31318  * sequence number (and updates may panic if they are not). The update_id values are strictly
31319  * increasing and increase by one for each new update, with two exceptions specified below.
31320  *
31321  * This sequence number is also used to track up to which points updates which returned
31322  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
31323  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
31324  *
31325  * The only instances we allow where update_id values are not strictly increasing have a
31326  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
31327  * will force close the channel by broadcasting the latest commitment transaction or
31328  * special post-force-close updates, like providing preimages necessary to claim outputs on the
31329  * broadcast commitment transaction. See its docs for more details.
31330  *
31331  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
31332  */
31333 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
31334
31335 /**
31336  * Creates a copy of the ChannelMonitorUpdate
31337  */
31338 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
31339
31340 /**
31341  * Checks if two ChannelMonitorUpdates contain equal inner contents.
31342  * This ignores pointers and is_owned flags and looks at the values in fields.
31343  * Two objects with NULL inner values will be considered "equal" here.
31344  */
31345 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
31346
31347 /**
31348  * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
31349  */
31350 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
31351
31352 /**
31353  * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
31354  */
31355 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
31356
31357 /**
31358  * Frees any resources used by the MonitorEvent
31359  */
31360 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
31361
31362 /**
31363  * Creates a copy of the MonitorEvent
31364  */
31365 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
31366
31367 /**
31368  * Utility method to constructs a new HTLCEvent-variant MonitorEvent
31369  */
31370 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
31371
31372 /**
31373  * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
31374  */
31375 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
31376
31377 /**
31378  * Utility method to constructs a new Completed-variant MonitorEvent
31379  */
31380 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
31381
31382 /**
31383  * Checks if two MonitorEvents contain equal inner contents.
31384  * This ignores pointers and is_owned flags and looks at the values in fields.
31385  */
31386 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
31387
31388 /**
31389  * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
31390  */
31391 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
31392
31393 /**
31394  * Read a MonitorEvent from a byte array, created by MonitorEvent_write
31395  */
31396 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
31397
31398 /**
31399  * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
31400  */
31401 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
31402
31403 /**
31404  * Creates a copy of the HTLCUpdate
31405  */
31406 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
31407
31408 /**
31409  * Checks if two HTLCUpdates contain equal inner contents.
31410  * This ignores pointers and is_owned flags and looks at the values in fields.
31411  * Two objects with NULL inner values will be considered "equal" here.
31412  */
31413 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
31414
31415 /**
31416  * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
31417  */
31418 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
31419
31420 /**
31421  * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
31422  */
31423 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
31424
31425 /**
31426  * Frees any resources used by the Balance
31427  */
31428 void Balance_free(struct LDKBalance this_ptr);
31429
31430 /**
31431  * Creates a copy of the Balance
31432  */
31433 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
31434
31435 /**
31436  * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
31437  */
31438 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
31439
31440 /**
31441  * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
31442  */
31443 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
31444
31445 /**
31446  * Utility method to constructs a new ContentiousClaimable-variant Balance
31447  */
31448 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
31449
31450 /**
31451  * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
31452  */
31453 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
31454
31455 /**
31456  * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
31457  */
31458 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
31459
31460 /**
31461  * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
31462  */
31463 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
31464
31465 /**
31466  * Checks if two Balances contain equal inner contents.
31467  * This ignores pointers and is_owned flags and looks at the values in fields.
31468  */
31469 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
31470
31471 /**
31472  * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
31473  * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
31474  * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
31475  * [`Balance::MaybePreimageClaimableHTLC`].
31476  *
31477  * On-chain fees required to claim the balance are not included in this amount.
31478  */
31479 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
31480
31481 /**
31482  * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
31483  */
31484 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
31485
31486 /**
31487  * Creates a copy of the ChannelMonitor
31488  */
31489 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
31490
31491 /**
31492  * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
31493  */
31494 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
31495
31496 /**
31497  * Updates a ChannelMonitor on the basis of some new information provided by the Channel
31498  * itself.
31499  *
31500  * panics if the given update is not the next update by update_id.
31501  */
31502 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);
31503
31504 /**
31505  * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
31506  * ChannelMonitor.
31507  */
31508 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31509
31510 /**
31511  * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
31512  */
31513 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31514
31515 /**
31516  * Gets a list of txids, with their output scripts (in the order they appear in the
31517  * transaction), which we must learn about spends of via block_connected().
31518  */
31519 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31520
31521 /**
31522  * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
31523  * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
31524  * have been registered.
31525  */
31526 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter, const struct LDKLogger *NONNULL_PTR logger);
31527
31528 /**
31529  * Get the list of HTLCs who's status has been updated on chain. This should be called by
31530  * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
31531  */
31532 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31533
31534 /**
31535  * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
31536  *
31537  * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
31538  * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
31539  * within each channel. As the confirmation of a commitment transaction may be critical to the
31540  * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
31541  * environment with spotty connections, like on mobile.
31542  *
31543  * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
31544  * order to handle these events.
31545  *
31546  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
31547  * [`BumpTransaction`]: crate::events::Event::BumpTransaction
31548  */
31549 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
31550
31551 /**
31552  * Gets the counterparty's initial commitment transaction. The returned commitment
31553  * transaction is unsigned. This is intended to be called during the initial persistence of
31554  * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
31555  * watchtowers in the persistence pipeline to have enough data to form justice transactions.
31556  *
31557  * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
31558  * that for the initial commitment transaction, we don't have a corresponding update.
31559  *
31560  * This will only return `Some` for channel monitors that have been created after upgrading
31561  * to LDK 0.0.117+.
31562  *
31563  * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
31564  *
31565  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31566  */
31567 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31568
31569 /**
31570  * Gets all of the counterparty commitment transactions provided by the given update. This
31571  * may be empty if the update doesn't include any new counterparty commitments. Returned
31572  * commitment transactions are unsigned.
31573  *
31574  * This is provided so that watchtower clients in the persistence pipeline are able to build
31575  * justice transactions for each counterparty commitment upon each update. It's intended to be
31576  * used within an implementation of [`Persist::update_persisted_channel`], which is provided
31577  * with a monitor and an update. Once revoked, signing a justice transaction can be done using
31578  * [`Self::sign_to_local_justice_tx`].
31579  *
31580  * It is expected that a watchtower client may use this method to retrieve the latest counterparty
31581  * commitment transaction(s), and then hold the necessary data until a later update in which
31582  * the monitor has been updated with the corresponding revocation data, at which point the
31583  * monitor can sign the justice transaction.
31584  *
31585  * This will only return a non-empty list for monitor updates that have been created after
31586  * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
31587  * may have been created prior to upgrading.
31588  *
31589  * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
31590  */
31591 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);
31592
31593 /**
31594  * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
31595  * signing the justice transaction easier for implementors of
31596  * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
31597  * signing the input at `input_idx`. This method will only produce a valid signature for
31598  * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
31599  * be used for revoked HTLC outputs.
31600  *
31601  * `Value` is the value of the output being spent by the input at `input_idx`, committed
31602  * in the BIP 143 signature.
31603  *
31604  * This method will only succeed if this monitor has received the revocation secret for the
31605  * provided `commitment_number`. If a commitment number is provided that does not correspond
31606  * to the commitment transaction being revoked, this will return a signed transaction, but
31607  * the signature will not be valid.
31608  *
31609  * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_justice_revoked_output
31610  * [`Persist`]: crate::chain::chainmonitor::Persist
31611  */
31612 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);
31613
31614 /**
31615  * Gets the `node_id` of the counterparty for this channel.
31616  *
31617  * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
31618  * otherwise.
31619  *
31620  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31621  */
31622 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31623
31624 /**
31625  * Used by [`ChannelManager`] deserialization to broadcast the latest holder state if its copy
31626  * of the channel state was out-of-date.
31627  *
31628  * You may also use this to broadcast the latest local commitment transaction, either because
31629  * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
31630  * counterparty side knows a revocation secret we gave them that they shouldn't know).
31631  *
31632  * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
31633  * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
31634  * close channel with their commitment transaction after a substantial amount of time. Best
31635  * may be to contact the other node operator out-of-band to coordinate other options available
31636  * to you.
31637  *
31638  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
31639  */
31640 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);
31641
31642 /**
31643  * Processes transactions in a newly connected block, which may result in any of the following:
31644  * - update the monitor's state against resolved HTLCs
31645  * - punish the counterparty in the case of seeing a revoked commitment transaction
31646  * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
31647  * - detect settled outputs for later spending
31648  * - schedule and bump any in-flight claims
31649  *
31650  * Returns any new outputs to watch from `txdata`; after called, these are also included in
31651  * [`get_outputs_to_watch`].
31652  *
31653  * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
31654  */
31655 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, const struct LDKLogger *NONNULL_PTR logger);
31656
31657 /**
31658  * Determines if the disconnected block contained any transactions of interest and updates
31659  * appropriately.
31660  */
31661 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, const struct LDKLogger *NONNULL_PTR logger);
31662
31663 /**
31664  * Processes transactions confirmed in a block with the given header and height, returning new
31665  * outputs to watch. See [`block_connected`] for details.
31666  *
31667  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
31668  * blocks. See [`chain::Confirm`] for calling expectations.
31669  *
31670  * [`block_connected`]: Self::block_connected
31671  */
31672 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, const struct LDKLogger *NONNULL_PTR logger);
31673
31674 /**
31675  * Processes a transaction that was reorganized out of the chain.
31676  *
31677  * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
31678  * than blocks. See [`chain::Confirm`] for calling expectations.
31679  *
31680  * [`block_disconnected`]: Self::block_disconnected
31681  */
31682 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
31683
31684 /**
31685  * Updates the monitor with the current best chain tip, returning new outputs to watch. See
31686  * [`block_connected`] for details.
31687  *
31688  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
31689  * blocks. See [`chain::Confirm`] for calling expectations.
31690  *
31691  * [`block_connected`]: Self::block_connected
31692  */
31693 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, const struct LDKLogger *NONNULL_PTR logger);
31694
31695 /**
31696  * Returns the set of txids that should be monitored for re-organization out of the chain.
31697  */
31698 MUST_USE_RES struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31699
31700 /**
31701  * Gets the latest best block which was connected either via the [`chain::Listen`] or
31702  * [`chain::Confirm`] interfaces.
31703  */
31704 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31705
31706 /**
31707  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
31708  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
31709  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
31710  * invoking this every 30 seconds, or lower if running in an environment with spotty
31711  * connections, like on mobile.
31712  */
31713 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
31714
31715 /**
31716  * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
31717  * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
31718  * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
31719  * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
31720  * confirmations.
31721  *
31722  * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
31723  * once they are no longer under reorg risk. This method serves as a way to retrieve these
31724  * descriptors at a later time, either for historical purposes, or to replay any
31725  * missed/unhandled descriptors. For the purpose of gathering historical records, if the
31726  * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
31727  * an empty set), you can retrieve all spendable outputs by providing all descendant spending
31728  * transactions starting from the channel's funding transaction and going down three levels.
31729  *
31730  * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
31731  * outputs which can be spent by us are found, at least one descriptor is returned.
31732  *
31733  * `confirmation_height` must be the height of the block in which `tx` was included in.
31734  */
31735 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
31736
31737 /**
31738  * Gets the balances in this channel which are either claimable by us if we were to
31739  * force-close the channel now or which are claimable on-chain (possibly awaiting
31740  * confirmation).
31741  *
31742  * Any balances in the channel which are available on-chain (excluding on-chain fees) are
31743  * included here until an [`Event::SpendableOutputs`] event has been generated for the
31744  * balance, or until our counterparty has claimed the balance and accrued several
31745  * confirmations on the claim transaction.
31746  *
31747  * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
31748  * LDK prior to 0.0.111, not all or excess balances may be included.
31749  *
31750  * See [`Balance`] for additional details on the types of claimable balances which
31751  * may be returned here and their meanings.
31752  */
31753 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31754
31755 /**
31756  * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
31757  */
31758 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
31759
31760 /**
31761  * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
31762  */
31763 void OutPoint_free(struct LDKOutPoint this_obj);
31764
31765 /**
31766  * The referenced transaction's txid.
31767  */
31768 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
31769
31770 /**
31771  * The referenced transaction's txid.
31772  */
31773 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31774
31775 /**
31776  * The index of the referenced output in its transaction's vout.
31777  */
31778 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
31779
31780 /**
31781  * The index of the referenced output in its transaction's vout.
31782  */
31783 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
31784
31785 /**
31786  * Constructs a new OutPoint given each field
31787  */
31788 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
31789
31790 /**
31791  * Creates a copy of the OutPoint
31792  */
31793 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
31794
31795 /**
31796  * Checks if two OutPoints contain equal inner contents.
31797  * This ignores pointers and is_owned flags and looks at the values in fields.
31798  * Two objects with NULL inner values will be considered "equal" here.
31799  */
31800 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
31801
31802 /**
31803  * Generates a non-cryptographic 64-bit hash of the OutPoint.
31804  */
31805 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
31806
31807 /**
31808  * Convert an `OutPoint` to a lightning channel id.
31809  */
31810 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
31811
31812 /**
31813  * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
31814  */
31815 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
31816
31817 /**
31818  * Read a OutPoint from a byte array, created by OutPoint_write
31819  */
31820 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
31821
31822 /**
31823  * Frees any resources used by the InboundHTLCErr, if is_owned is set and inner is non-NULL.
31824  */
31825 void InboundHTLCErr_free(struct LDKInboundHTLCErr this_obj);
31826
31827 /**
31828  * BOLT 4 error code.
31829  */
31830 uint16_t InboundHTLCErr_get_err_code(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
31831
31832 /**
31833  * BOLT 4 error code.
31834  */
31835 void InboundHTLCErr_set_err_code(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, uint16_t val);
31836
31837 /**
31838  * Data attached to this error.
31839  *
31840  * Returns a copy of the field.
31841  */
31842 struct LDKCVec_u8Z InboundHTLCErr_get_err_data(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
31843
31844 /**
31845  * Data attached to this error.
31846  */
31847 void InboundHTLCErr_set_err_data(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
31848
31849 /**
31850  * Error message text.
31851  */
31852 struct LDKStr InboundHTLCErr_get_msg(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
31853
31854 /**
31855  * Error message text.
31856  */
31857 void InboundHTLCErr_set_msg(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKStr val);
31858
31859 /**
31860  * Constructs a new InboundHTLCErr given each field
31861  */
31862 MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg);
31863
31864 /**
31865  * Peel one layer off an incoming onion, returning a [`PendingHTLCInfo`] that contains information
31866  * about the intended next-hop for the HTLC.
31867  *
31868  * This does all the relevant context-free checks that LDK requires for payment relay or
31869  * acceptance. If the payment is to be received, and the amount matches the expected amount for
31870  * a given invoice, this indicates the [`msgs::UpdateAddHTLC`], once fully committed in the
31871  * channel, will generate an [`Event::PaymentClaimable`].
31872  *
31873  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
31874  */
31875 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKLogger *NONNULL_PTR logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees);
31876
31877 /**
31878  * Frees any resources used by the PendingHTLCRouting
31879  */
31880 void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr);
31881
31882 /**
31883  * Creates a copy of the PendingHTLCRouting
31884  */
31885 struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
31886
31887 /**
31888  * Utility method to constructs a new Forward-variant PendingHTLCRouting
31889  */
31890 struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
31891
31892 /**
31893  * Utility method to constructs a new Receive-variant PendingHTLCRouting
31894  */
31895 struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
31896
31897 /**
31898  * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting
31899  */
31900 struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
31901
31902 /**
31903  * Frees any resources used by the BlindedForward, if is_owned is set and inner is non-NULL.
31904  */
31905 void BlindedForward_free(struct LDKBlindedForward this_obj);
31906
31907 /**
31908  * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
31909  * onion payload if we're the introduction node. Useful for calculating the next hop's
31910  * [`msgs::UpdateAddHTLC::blinding_point`].
31911  */
31912 struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
31913
31914 /**
31915  * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
31916  * onion payload if we're the introduction node. Useful for calculating the next hop's
31917  * [`msgs::UpdateAddHTLC::blinding_point`].
31918  */
31919 void BlindedForward_set_inbound_blinding_point(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31920
31921 /**
31922  * If needed, this determines how this HTLC should be failed backwards, based on whether we are
31923  * the introduction node.
31924  */
31925 enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
31926
31927 /**
31928  * If needed, this determines how this HTLC should be failed backwards, based on whether we are
31929  * the introduction node.
31930  */
31931 void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
31932
31933 /**
31934  * Constructs a new BlindedForward given each field
31935  */
31936 MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg);
31937
31938 /**
31939  * Creates a copy of the BlindedForward
31940  */
31941 struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig);
31942
31943 /**
31944  * Generates a non-cryptographic 64-bit hash of the BlindedForward.
31945  */
31946 uint64_t BlindedForward_hash(const struct LDKBlindedForward *NONNULL_PTR o);
31947
31948 /**
31949  * Checks if two BlindedForwards contain equal inner contents.
31950  * This ignores pointers and is_owned flags and looks at the values in fields.
31951  * Two objects with NULL inner values will be considered "equal" here.
31952  */
31953 bool BlindedForward_eq(const struct LDKBlindedForward *NONNULL_PTR a, const struct LDKBlindedForward *NONNULL_PTR b);
31954
31955 /**
31956  * Frees any resources used by the PendingHTLCInfo, if is_owned is set and inner is non-NULL.
31957  */
31958 void PendingHTLCInfo_free(struct LDKPendingHTLCInfo this_obj);
31959
31960 /**
31961  * Further routing details based on whether the HTLC is being forwarded or received.
31962  */
31963 struct LDKPendingHTLCRouting PendingHTLCInfo_get_routing(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
31964
31965 /**
31966  * Further routing details based on whether the HTLC is being forwarded or received.
31967  */
31968 void PendingHTLCInfo_set_routing(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKPendingHTLCRouting val);
31969
31970 /**
31971  * The onion shared secret we build with the sender used to decrypt the onion.
31972  *
31973  * This is later used to encrypt failure packets in the event that the HTLC is failed.
31974  */
31975 const uint8_t (*PendingHTLCInfo_get_incoming_shared_secret(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
31976
31977 /**
31978  * The onion shared secret we build with the sender used to decrypt the onion.
31979  *
31980  * This is later used to encrypt failure packets in the event that the HTLC is failed.
31981  */
31982 void PendingHTLCInfo_set_incoming_shared_secret(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31983
31984 /**
31985  * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
31986  */
31987 const uint8_t (*PendingHTLCInfo_get_payment_hash(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
31988
31989 /**
31990  * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
31991  */
31992 void PendingHTLCInfo_set_payment_hash(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31993
31994 /**
31995  * Amount received in the incoming HTLC.
31996  *
31997  * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
31998  * versions.
31999  */
32000 struct LDKCOption_u64Z PendingHTLCInfo_get_incoming_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
32001
32002 /**
32003  * Amount received in the incoming HTLC.
32004  *
32005  * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
32006  * versions.
32007  */
32008 void PendingHTLCInfo_set_incoming_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32009
32010 /**
32011  * The amount the sender indicated should be forwarded on to the next hop or amount the sender
32012  * intended for us to receive for received payments.
32013  *
32014  * If the received amount is less than this for received payments, an intermediary hop has
32015  * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
32016  * it along another path).
32017  *
32018  * Because nodes can take less than their required fees, and because senders may wish to
32019  * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
32020  * received payments. In such cases, recipients must handle this HTLC as if it had received
32021  * [`Self::outgoing_amt_msat`].
32022  */
32023 uint64_t PendingHTLCInfo_get_outgoing_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
32024
32025 /**
32026  * The amount the sender indicated should be forwarded on to the next hop or amount the sender
32027  * intended for us to receive for received payments.
32028  *
32029  * If the received amount is less than this for received payments, an intermediary hop has
32030  * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
32031  * it along another path).
32032  *
32033  * Because nodes can take less than their required fees, and because senders may wish to
32034  * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
32035  * received payments. In such cases, recipients must handle this HTLC as if it had received
32036  * [`Self::outgoing_amt_msat`].
32037  */
32038 void PendingHTLCInfo_set_outgoing_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint64_t val);
32039
32040 /**
32041  * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
32042  * should have been set on the received HTLC for received payments).
32043  */
32044 uint32_t PendingHTLCInfo_get_outgoing_cltv_value(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
32045
32046 /**
32047  * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
32048  * should have been set on the received HTLC for received payments).
32049  */
32050 void PendingHTLCInfo_set_outgoing_cltv_value(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint32_t val);
32051
32052 /**
32053  * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
32054  *
32055  * If this is a payment for forwarding, this is the fee we are taking before forwarding the
32056  * HTLC.
32057  *
32058  * If this is a received payment, this is the fee that our counterparty took.
32059  *
32060  * This is used to allow LSPs to take fees as a part of payments, without the sender having to
32061  * shoulder them.
32062  */
32063 struct LDKCOption_u64Z PendingHTLCInfo_get_skimmed_fee_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
32064
32065 /**
32066  * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
32067  *
32068  * If this is a payment for forwarding, this is the fee we are taking before forwarding the
32069  * HTLC.
32070  *
32071  * If this is a received payment, this is the fee that our counterparty took.
32072  *
32073  * This is used to allow LSPs to take fees as a part of payments, without the sender having to
32074  * shoulder them.
32075  */
32076 void PendingHTLCInfo_set_skimmed_fee_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32077
32078 /**
32079  * Constructs a new PendingHTLCInfo given each field
32080  */
32081 MUST_USE_RES struct LDKPendingHTLCInfo PendingHTLCInfo_new(struct LDKPendingHTLCRouting routing_arg, struct LDKThirtyTwoBytes incoming_shared_secret_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u64Z incoming_amt_msat_arg, uint64_t outgoing_amt_msat_arg, uint32_t outgoing_cltv_value_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg);
32082
32083 /**
32084  * Creates a copy of the PendingHTLCInfo
32085  */
32086 struct LDKPendingHTLCInfo PendingHTLCInfo_clone(const struct LDKPendingHTLCInfo *NONNULL_PTR orig);
32087
32088 /**
32089  * Creates a copy of the BlindedFailure
32090  */
32091 enum LDKBlindedFailure BlindedFailure_clone(const enum LDKBlindedFailure *NONNULL_PTR orig);
32092
32093 /**
32094  * Utility method to constructs a new FromIntroductionNode-variant BlindedFailure
32095  */
32096 enum LDKBlindedFailure BlindedFailure_from_introduction_node(void);
32097
32098 /**
32099  * Utility method to constructs a new FromBlindedNode-variant BlindedFailure
32100  */
32101 enum LDKBlindedFailure BlindedFailure_from_blinded_node(void);
32102
32103 /**
32104  * Generates a non-cryptographic 64-bit hash of the BlindedFailure.
32105  */
32106 uint64_t BlindedFailure_hash(const enum LDKBlindedFailure *NONNULL_PTR o);
32107
32108 /**
32109  * Checks if two BlindedFailures contain equal inner contents.
32110  * This ignores pointers and is_owned flags and looks at the values in fields.
32111  */
32112 bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b);
32113
32114 /**
32115  * Frees any resources used by the FailureCode
32116  */
32117 void FailureCode_free(struct LDKFailureCode this_ptr);
32118
32119 /**
32120  * Creates a copy of the FailureCode
32121  */
32122 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
32123
32124 /**
32125  * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
32126  */
32127 struct LDKFailureCode FailureCode_temporary_node_failure(void);
32128
32129 /**
32130  * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
32131  */
32132 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
32133
32134 /**
32135  * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
32136  */
32137 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
32138
32139 /**
32140  * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
32141  */
32142 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
32143
32144 /**
32145  * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
32146  */
32147 void ChannelManager_free(struct LDKChannelManager this_obj);
32148
32149 /**
32150  * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
32151  */
32152 void ChainParameters_free(struct LDKChainParameters this_obj);
32153
32154 /**
32155  * The network for determining the `chain_hash` in Lightning messages.
32156  */
32157 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
32158
32159 /**
32160  * The network for determining the `chain_hash` in Lightning messages.
32161  */
32162 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
32163
32164 /**
32165  * The hash and height of the latest block successfully connected.
32166  *
32167  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
32168  */
32169 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
32170
32171 /**
32172  * The hash and height of the latest block successfully connected.
32173  *
32174  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
32175  */
32176 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
32177
32178 /**
32179  * Constructs a new ChainParameters given each field
32180  */
32181 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
32182
32183 /**
32184  * Creates a copy of the ChainParameters
32185  */
32186 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
32187
32188 /**
32189  * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
32190  */
32191 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
32192
32193 /**
32194  * Base routing fee in millisatoshis.
32195  */
32196 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
32197
32198 /**
32199  * Base routing fee in millisatoshis.
32200  */
32201 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
32202
32203 /**
32204  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
32205  */
32206 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
32207
32208 /**
32209  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
32210  */
32211 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
32212
32213 /**
32214  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
32215  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
32216  * `cltv_expiry_delta` for more details.
32217  */
32218 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
32219
32220 /**
32221  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
32222  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
32223  * `cltv_expiry_delta` for more details.
32224  */
32225 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
32226
32227 /**
32228  * Constructs a new CounterpartyForwardingInfo given each field
32229  */
32230 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);
32231
32232 /**
32233  * Creates a copy of the CounterpartyForwardingInfo
32234  */
32235 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
32236
32237 /**
32238  * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
32239  */
32240 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
32241
32242 /**
32243  * The node_id of our counterparty
32244  */
32245 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32246
32247 /**
32248  * The node_id of our counterparty
32249  */
32250 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32251
32252 /**
32253  * The Features the channel counterparty provided upon last connection.
32254  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
32255  * many routing-relevant features are present in the init context.
32256  */
32257 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32258
32259 /**
32260  * The Features the channel counterparty provided upon last connection.
32261  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
32262  * many routing-relevant features are present in the init context.
32263  */
32264 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
32265
32266 /**
32267  * The value, in satoshis, that must always be held in the channel for our counterparty. This
32268  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
32269  * claiming at least this value on chain.
32270  *
32271  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
32272  *
32273  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
32274  */
32275 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32276
32277 /**
32278  * The value, in satoshis, that must always be held in the channel for our counterparty. This
32279  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
32280  * claiming at least this value on chain.
32281  *
32282  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
32283  *
32284  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
32285  */
32286 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
32287
32288 /**
32289  * Information on the fees and requirements that the counterparty requires when forwarding
32290  * payments to us through this channel.
32291  *
32292  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32293  */
32294 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32295
32296 /**
32297  * Information on the fees and requirements that the counterparty requires when forwarding
32298  * payments to us through this channel.
32299  *
32300  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32301  */
32302 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
32303
32304 /**
32305  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
32306  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
32307  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
32308  */
32309 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32310
32311 /**
32312  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
32313  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
32314  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
32315  */
32316 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32317
32318 /**
32319  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
32320  */
32321 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32322
32323 /**
32324  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
32325  */
32326 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32327
32328 /**
32329  * Constructs a new ChannelCounterparty given each field
32330  *
32331  * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32332  */
32333 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);
32334
32335 /**
32336  * Creates a copy of the ChannelCounterparty
32337  */
32338 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
32339
32340 /**
32341  * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
32342  */
32343 void ChannelDetails_free(struct LDKChannelDetails this_obj);
32344
32345 /**
32346  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
32347  * thereafter this is the txid of the funding transaction xor the funding transaction output).
32348  * Note that this means this value is *not* persistent - it can change once during the
32349  * lifetime of the channel.
32350  */
32351 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
32352
32353 /**
32354  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
32355  * thereafter this is the txid of the funding transaction xor the funding transaction output).
32356  * Note that this means this value is *not* persistent - it can change once during the
32357  * lifetime of the channel.
32358  */
32359 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32360
32361 /**
32362  * Parameters which apply to our counterparty. See individual fields for more information.
32363  */
32364 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32365
32366 /**
32367  * Parameters which apply to our counterparty. See individual fields for more information.
32368  */
32369 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
32370
32371 /**
32372  * The Channel's funding transaction output, if we've negotiated the funding transaction with
32373  * our counterparty already.
32374  *
32375  * Note that, if this has been set, `channel_id` will be equivalent to
32376  * `funding_txo.unwrap().to_channel_id()`.
32377  *
32378  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32379  */
32380 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32381
32382 /**
32383  * The Channel's funding transaction output, if we've negotiated the funding transaction with
32384  * our counterparty already.
32385  *
32386  * Note that, if this has been set, `channel_id` will be equivalent to
32387  * `funding_txo.unwrap().to_channel_id()`.
32388  *
32389  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32390  */
32391 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
32392
32393 /**
32394  * The features which this channel operates with. See individual features for more info.
32395  *
32396  * `None` until negotiation completes and the channel type is finalized.
32397  *
32398  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32399  */
32400 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32401
32402 /**
32403  * The features which this channel operates with. See individual features for more info.
32404  *
32405  * `None` until negotiation completes and the channel type is finalized.
32406  *
32407  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32408  */
32409 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32410
32411 /**
32412  * The position of the funding transaction in the chain. None if the funding transaction has
32413  * not yet been confirmed and the channel fully opened.
32414  *
32415  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
32416  * payments instead of this. See [`get_inbound_payment_scid`].
32417  *
32418  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
32419  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
32420  *
32421  * [`inbound_scid_alias`]: Self::inbound_scid_alias
32422  * [`outbound_scid_alias`]: Self::outbound_scid_alias
32423  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
32424  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
32425  * [`confirmations_required`]: Self::confirmations_required
32426  */
32427 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32428
32429 /**
32430  * The position of the funding transaction in the chain. None if the funding transaction has
32431  * not yet been confirmed and the channel fully opened.
32432  *
32433  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
32434  * payments instead of this. See [`get_inbound_payment_scid`].
32435  *
32436  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
32437  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
32438  *
32439  * [`inbound_scid_alias`]: Self::inbound_scid_alias
32440  * [`outbound_scid_alias`]: Self::outbound_scid_alias
32441  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
32442  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
32443  * [`confirmations_required`]: Self::confirmations_required
32444  */
32445 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32446
32447 /**
32448  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
32449  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
32450  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
32451  * `Some(0)`).
32452  *
32453  * This will be `None` as long as the channel is not available for routing outbound payments.
32454  *
32455  * [`short_channel_id`]: Self::short_channel_id
32456  * [`confirmations_required`]: Self::confirmations_required
32457  */
32458 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32459
32460 /**
32461  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
32462  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
32463  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
32464  * `Some(0)`).
32465  *
32466  * This will be `None` as long as the channel is not available for routing outbound payments.
32467  *
32468  * [`short_channel_id`]: Self::short_channel_id
32469  * [`confirmations_required`]: Self::confirmations_required
32470  */
32471 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32472
32473 /**
32474  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
32475  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
32476  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
32477  * when they see a payment to be routed to us.
32478  *
32479  * Our counterparty may choose to rotate this value at any time, though will always recognize
32480  * previous values for inbound payment forwarding.
32481  *
32482  * [`short_channel_id`]: Self::short_channel_id
32483  */
32484 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32485
32486 /**
32487  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
32488  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
32489  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
32490  * when they see a payment to be routed to us.
32491  *
32492  * Our counterparty may choose to rotate this value at any time, though will always recognize
32493  * previous values for inbound payment forwarding.
32494  *
32495  * [`short_channel_id`]: Self::short_channel_id
32496  */
32497 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32498
32499 /**
32500  * The value, in satoshis, of this channel as appears in the funding output
32501  */
32502 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32503
32504 /**
32505  * The value, in satoshis, of this channel as appears in the funding output
32506  */
32507 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32508
32509 /**
32510  * The value, in satoshis, that must always be held in the channel for us. This value ensures
32511  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
32512  * this value on chain.
32513  *
32514  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
32515  *
32516  * This value will be `None` for outbound channels until the counterparty accepts the channel.
32517  *
32518  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
32519  */
32520 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32521
32522 /**
32523  * The value, in satoshis, that must always be held in the channel for us. This value ensures
32524  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
32525  * this value on chain.
32526  *
32527  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
32528  *
32529  * This value will be `None` for outbound channels until the counterparty accepts the channel.
32530  *
32531  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
32532  */
32533 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32534
32535 /**
32536  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
32537  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
32538  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
32539  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
32540  * serialized with LDK versions prior to 0.0.113.
32541  *
32542  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
32543  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
32544  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
32545  */
32546 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32547
32548 /**
32549  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
32550  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
32551  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
32552  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
32553  * serialized with LDK versions prior to 0.0.113.
32554  *
32555  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
32556  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
32557  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
32558  */
32559 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
32560
32561 /**
32562  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
32563  * which is applied to commitment and HTLC transactions.
32564  *
32565  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
32566  */
32567 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32568
32569 /**
32570  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
32571  * which is applied to commitment and HTLC transactions.
32572  *
32573  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
32574  */
32575 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
32576
32577 /**
32578  * Our total balance.  This is the amount we would get if we close the channel.
32579  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
32580  * amount is not likely to be recoverable on close.
32581  *
32582  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
32583  * balance is not available for inclusion in new outbound HTLCs). This further does not include
32584  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
32585  * This does not consider any on-chain fees.
32586  *
32587  * See also [`ChannelDetails::outbound_capacity_msat`]
32588  */
32589 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32590
32591 /**
32592  * Our total balance.  This is the amount we would get if we close the channel.
32593  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
32594  * amount is not likely to be recoverable on close.
32595  *
32596  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
32597  * balance is not available for inclusion in new outbound HTLCs). This further does not include
32598  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
32599  * This does not consider any on-chain fees.
32600  *
32601  * See also [`ChannelDetails::outbound_capacity_msat`]
32602  */
32603 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32604
32605 /**
32606  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
32607  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
32608  * available for inclusion in new outbound HTLCs). This further does not include any pending
32609  * outgoing HTLCs which are awaiting some other resolution to be sent.
32610  *
32611  * See also [`ChannelDetails::balance_msat`]
32612  *
32613  * This value is not exact. Due to various in-flight changes, feerate changes, and our
32614  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
32615  * should be able to spend nearly this amount.
32616  */
32617 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32618
32619 /**
32620  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
32621  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
32622  * available for inclusion in new outbound HTLCs). This further does not include any pending
32623  * outgoing HTLCs which are awaiting some other resolution to be sent.
32624  *
32625  * See also [`ChannelDetails::balance_msat`]
32626  *
32627  * This value is not exact. Due to various in-flight changes, feerate changes, and our
32628  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
32629  * should be able to spend nearly this amount.
32630  */
32631 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32632
32633 /**
32634  * The available outbound capacity for sending a single HTLC to the remote peer. This is
32635  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
32636  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
32637  * to use a limit as close as possible to the HTLC limit we can currently send.
32638  *
32639  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
32640  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
32641  */
32642 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32643
32644 /**
32645  * The available outbound capacity for sending a single HTLC to the remote peer. This is
32646  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
32647  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
32648  * to use a limit as close as possible to the HTLC limit we can currently send.
32649  *
32650  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
32651  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
32652  */
32653 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32654
32655 /**
32656  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
32657  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
32658  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
32659  * route which is valid.
32660  */
32661 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32662
32663 /**
32664  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
32665  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
32666  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
32667  * route which is valid.
32668  */
32669 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32670
32671 /**
32672  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
32673  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
32674  * available for inclusion in new inbound HTLCs).
32675  * Note that there are some corner cases not fully handled here, so the actual available
32676  * inbound capacity may be slightly higher than this.
32677  *
32678  * This value is not exact. Due to various in-flight changes, feerate changes, and our
32679  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
32680  * However, our counterparty should be able to spend nearly this amount.
32681  */
32682 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32683
32684 /**
32685  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
32686  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
32687  * available for inclusion in new inbound HTLCs).
32688  * Note that there are some corner cases not fully handled here, so the actual available
32689  * inbound capacity may be slightly higher than this.
32690  *
32691  * This value is not exact. Due to various in-flight changes, feerate changes, and our
32692  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
32693  * However, our counterparty should be able to spend nearly this amount.
32694  */
32695 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32696
32697 /**
32698  * The number of required confirmations on the funding transaction before the funding will be
32699  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
32700  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
32701  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
32702  * [`ChannelHandshakeLimits::max_minimum_depth`].
32703  *
32704  * This value will be `None` for outbound channels until the counterparty accepts the channel.
32705  *
32706  * [`is_outbound`]: ChannelDetails::is_outbound
32707  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
32708  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
32709  */
32710 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32711
32712 /**
32713  * The number of required confirmations on the funding transaction before the funding will be
32714  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
32715  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
32716  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
32717  * [`ChannelHandshakeLimits::max_minimum_depth`].
32718  *
32719  * This value will be `None` for outbound channels until the counterparty accepts the channel.
32720  *
32721  * [`is_outbound`]: ChannelDetails::is_outbound
32722  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
32723  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
32724  */
32725 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
32726
32727 /**
32728  * The current number of confirmations on the funding transaction.
32729  *
32730  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
32731  */
32732 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32733
32734 /**
32735  * The current number of confirmations on the funding transaction.
32736  *
32737  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
32738  */
32739 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
32740
32741 /**
32742  * The number of blocks (after our commitment transaction confirms) that we will need to wait
32743  * until we can claim our funds after we force-close the channel. During this time our
32744  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
32745  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
32746  * time to claim our non-HTLC-encumbered funds.
32747  *
32748  * This value will be `None` for outbound channels until the counterparty accepts the channel.
32749  */
32750 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32751
32752 /**
32753  * The number of blocks (after our commitment transaction confirms) that we will need to wait
32754  * until we can claim our funds after we force-close the channel. During this time our
32755  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
32756  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
32757  * time to claim our non-HTLC-encumbered funds.
32758  *
32759  * This value will be `None` for outbound channels until the counterparty accepts the channel.
32760  */
32761 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
32762
32763 /**
32764  * True if the channel was initiated (and thus funded) by us.
32765  */
32766 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32767
32768 /**
32769  * True if the channel was initiated (and thus funded) by us.
32770  */
32771 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
32772
32773 /**
32774  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
32775  * channel is not currently being shut down. `channel_ready` message exchange implies the
32776  * required confirmation count has been reached (and we were connected to the peer at some
32777  * point after the funding transaction received enough confirmations). The required
32778  * confirmation count is provided in [`confirmations_required`].
32779  *
32780  * [`confirmations_required`]: ChannelDetails::confirmations_required
32781  */
32782 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32783
32784 /**
32785  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
32786  * channel is not currently being shut down. `channel_ready` message exchange implies the
32787  * required confirmation count has been reached (and we were connected to the peer at some
32788  * point after the funding transaction received enough confirmations). The required
32789  * confirmation count is provided in [`confirmations_required`].
32790  *
32791  * [`confirmations_required`]: ChannelDetails::confirmations_required
32792  */
32793 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
32794
32795 /**
32796  * The stage of the channel's shutdown.
32797  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
32798  *
32799  * Returns a copy of the field.
32800  */
32801 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32802
32803 /**
32804  * The stage of the channel's shutdown.
32805  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
32806  */
32807 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
32808
32809 /**
32810  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
32811  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
32812  *
32813  * This is a strict superset of `is_channel_ready`.
32814  */
32815 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32816
32817 /**
32818  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
32819  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
32820  *
32821  * This is a strict superset of `is_channel_ready`.
32822  */
32823 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
32824
32825 /**
32826  * True if this channel is (or will be) publicly-announced.
32827  */
32828 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32829
32830 /**
32831  * True if this channel is (or will be) publicly-announced.
32832  */
32833 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
32834
32835 /**
32836  * The smallest value HTLC (in msat) we will accept, for this channel. This field
32837  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
32838  */
32839 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32840
32841 /**
32842  * The smallest value HTLC (in msat) we will accept, for this channel. This field
32843  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
32844  */
32845 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32846
32847 /**
32848  * The largest value HTLC (in msat) we currently will accept, for this channel.
32849  */
32850 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32851
32852 /**
32853  * The largest value HTLC (in msat) we currently will accept, for this channel.
32854  */
32855 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32856
32857 /**
32858  * Set of configurable parameters that affect channel operation.
32859  *
32860  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
32861  *
32862  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32863  */
32864 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32865
32866 /**
32867  * Set of configurable parameters that affect channel operation.
32868  *
32869  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
32870  *
32871  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32872  */
32873 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
32874
32875 /**
32876  * Constructs a new ChannelDetails given each field
32877  *
32878  * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32879  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32880  * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32881  */
32882 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);
32883
32884 /**
32885  * Creates a copy of the ChannelDetails
32886  */
32887 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
32888
32889 /**
32890  * Gets the current SCID which should be used to identify this channel for inbound payments.
32891  * This should be used for providing invoice hints or in any other context where our
32892  * counterparty will forward a payment to us.
32893  *
32894  * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
32895  * [`ChannelDetails::short_channel_id`]. See those for more information.
32896  */
32897 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
32898
32899 /**
32900  * Gets the current SCID which should be used to identify this channel for outbound payments.
32901  * This should be used in [`Route`]s to describe the first hop or in other contexts where
32902  * we're sending or forwarding a payment outbound over this channel.
32903  *
32904  * This is either the [`ChannelDetails::short_channel_id`], if set, or the
32905  * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
32906  */
32907 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
32908
32909 /**
32910  * Creates a copy of the ChannelShutdownState
32911  */
32912 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
32913
32914 /**
32915  * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
32916  */
32917 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
32918
32919 /**
32920  * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
32921  */
32922 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
32923
32924 /**
32925  * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
32926  */
32927 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
32928
32929 /**
32930  * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
32931  */
32932 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
32933
32934 /**
32935  * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
32936  */
32937 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
32938
32939 /**
32940  * Checks if two ChannelShutdownStates contain equal inner contents.
32941  * This ignores pointers and is_owned flags and looks at the values in fields.
32942  */
32943 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
32944
32945 /**
32946  * Frees any resources used by the RecentPaymentDetails
32947  */
32948 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
32949
32950 /**
32951  * Creates a copy of the RecentPaymentDetails
32952  */
32953 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
32954
32955 /**
32956  * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
32957  */
32958 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
32959
32960 /**
32961  * Utility method to constructs a new Pending-variant RecentPaymentDetails
32962  */
32963 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
32964
32965 /**
32966  * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
32967  */
32968 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
32969
32970 /**
32971  * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
32972  */
32973 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
32974
32975 /**
32976  * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
32977  */
32978 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
32979
32980 /**
32981  * The list of channels to be included in the invoice route hints.
32982  */
32983 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
32984
32985 /**
32986  * The list of channels to be included in the invoice route hints.
32987  */
32988 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
32989
32990 /**
32991  * A fake scid used for representing the phantom node's fake channel in generating the invoice
32992  * route hints.
32993  */
32994 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
32995
32996 /**
32997  * A fake scid used for representing the phantom node's fake channel in generating the invoice
32998  * route hints.
32999  */
33000 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
33001
33002 /**
33003  * The pubkey of the real backing node that would ultimately receive the payment.
33004  */
33005 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
33006
33007 /**
33008  * The pubkey of the real backing node that would ultimately receive the payment.
33009  */
33010 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33011
33012 /**
33013  * Constructs a new PhantomRouteHints given each field
33014  */
33015 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
33016
33017 /**
33018  * Creates a copy of the PhantomRouteHints
33019  */
33020 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
33021
33022 /**
33023  * Constructs a new `ChannelManager` to hold several channels and route between them.
33024  *
33025  * The current time or latest block header time can be provided as the `current_timestamp`.
33026  *
33027  * This is the main \"logic hub\" for all channel-related actions, and implements
33028  * [`ChannelMessageHandler`].
33029  *
33030  * Non-proportional fees are fixed according to our risk using the provided fee estimator.
33031  *
33032  * Users need to notify the new `ChannelManager` when a new block is connected or
33033  * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
33034  * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
33035  * more details.
33036  *
33037  * [`block_connected`]: chain::Listen::block_connected
33038  * [`block_disconnected`]: chain::Listen::block_disconnected
33039  * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
33040  */
33041 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);
33042
33043 /**
33044  * Gets the current configuration applied to all new channels.
33045  */
33046 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
33047
33048 /**
33049  * Creates a new outbound channel to the given remote node and with the given value.
33050  *
33051  * `user_channel_id` will be provided back as in
33052  * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
33053  * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
33054  * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
33055  * is simply copied to events and otherwise ignored.
33056  *
33057  * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
33058  * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
33059  *
33060  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
33061  * generate a shutdown scriptpubkey or destination script set by
33062  * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
33063  *
33064  * Note that we do not check if you are currently connected to the given peer. If no
33065  * connection is available, the outbound `open_channel` message may fail to send, resulting in
33066  * the channel eventually being silently forgotten (dropped on reload).
33067  *
33068  * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
33069  * channel. Otherwise, a random one will be generated for you.
33070  *
33071  * Returns the new Channel's temporary `channel_id`. This ID will appear as
33072  * [`Event::FundingGenerationReady::temporary_channel_id`] and in
33073  * [`ChannelDetails::channel_id`] until after
33074  * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
33075  * one derived from the funding transaction's TXID. If the counterparty rejects the channel
33076  * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
33077  *
33078  * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
33079  * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
33080  * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
33081  *
33082  * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
33083  */
33084 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 LDKCOption_ThirtyTwoBytesZ temporary_channel_id, struct LDKUserConfig override_config);
33085
33086 /**
33087  * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
33088  * more information.
33089  */
33090 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
33091
33092 /**
33093  * Gets the list of usable channels, in random order. Useful as an argument to
33094  * [`Router::find_route`] to ensure non-announced channels are used.
33095  *
33096  * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
33097  * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
33098  * are.
33099  */
33100 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
33101
33102 /**
33103  * Gets the list of channels we have with a given counterparty, in random order.
33104  */
33105 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
33106
33107 /**
33108  * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
33109  * successful path, or have unresolved HTLCs.
33110  *
33111  * This can be useful for payments that may have been prepared, but ultimately not sent, as a
33112  * result of a crash. If such a payment exists, is not listed here, and an
33113  * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
33114  *
33115  * [`Event::PaymentSent`]: events::Event::PaymentSent
33116  */
33117 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
33118
33119 /**
33120  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
33121  * will be accepted on the given channel, and after additional timeout/the closing of all
33122  * pending HTLCs, the channel will be closed on chain.
33123  *
33124  *  * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
33125  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
33126  *    fee estimate.
33127  *  * If our counterparty is the channel initiator, we will require a channel closing
33128  *    transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
33129  *    would appear on a force-closure transaction, whichever is lower. We will allow our
33130  *    counterparty to pay as much fee as they'd like, however.
33131  *
33132  * May generate a [`SendShutdown`] message event on success, which should be relayed.
33133  *
33134  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
33135  * generate a shutdown scriptpubkey or destination script set by
33136  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
33137  * channel.
33138  *
33139  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
33140  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
33141  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
33142  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
33143  */
33144 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);
33145
33146 /**
33147  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
33148  * will be accepted on the given channel, and after additional timeout/the closing of all
33149  * pending HTLCs, the channel will be closed on chain.
33150  *
33151  * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
33152  * the channel being closed or not:
33153  *  * If we are the channel initiator, we will pay at least this feerate on the closing
33154  *    transaction. The upper-bound is set by
33155  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
33156  *    fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
33157  *  * If our counterparty is the channel initiator, we will refuse to accept a channel closure
33158  *    transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
33159  *    will appear on a force-closure transaction, whichever is lower).
33160  *
33161  * The `shutdown_script` provided  will be used as the `scriptPubKey` for the closing transaction.
33162  * Will fail if a shutdown script has already been set for this channel by
33163  * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
33164  * also be compatible with our and the counterparty's features.
33165  *
33166  * May generate a [`SendShutdown`] message event on success, which should be relayed.
33167  *
33168  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
33169  * generate a shutdown scriptpubkey or destination script set by
33170  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
33171  * channel.
33172  *
33173  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
33174  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
33175  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
33176  *
33177  * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
33178  */
33179 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);
33180
33181 /**
33182  * Force closes a channel, immediately broadcasting the latest local transaction(s) and
33183  * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
33184  * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
33185  * channel.
33186  */
33187 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);
33188
33189 /**
33190  * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
33191  * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
33192  * `counterparty_node_id` isn't the counterparty of the corresponding channel.
33193  *
33194  * You can always get the latest local transaction(s) to broadcast from
33195  * [`ChannelMonitor::get_latest_holder_commitment_txn`].
33196  */
33197 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);
33198
33199 /**
33200  * Force close all channels, immediately broadcasting the latest local commitment transaction
33201  * for each to the chain and rejecting new HTLCs on each.
33202  */
33203 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
33204
33205 /**
33206  * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
33207  * local transaction(s).
33208  */
33209 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
33210
33211 /**
33212  * Sends a payment along a given route.
33213  *
33214  * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
33215  * fields for more info.
33216  *
33217  * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
33218  * [`PeerManager::process_events`]).
33219  *
33220  * # Avoiding Duplicate Payments
33221  *
33222  * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
33223  * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
33224  * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
33225  * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
33226  * second payment with the same [`PaymentId`].
33227  *
33228  * Thus, in order to ensure duplicate payments are not sent, you should implement your own
33229  * tracking of payments, including state to indicate once a payment has completed. Because you
33230  * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
33231  * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
33232  * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
33233  *
33234  * Additionally, in the scenario where we begin the process of sending a payment, but crash
33235  * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
33236  * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
33237  * [`ChannelManager::list_recent_payments`] for more information.
33238  *
33239  * # Possible Error States on [`PaymentSendFailure`]
33240  *
33241  * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
33242  * each entry matching the corresponding-index entry in the route paths, see
33243  * [`PaymentSendFailure`] for more info.
33244  *
33245  * In general, a path may raise:
33246  *  * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
33247  *    node public key) is specified.
33248  *  * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
33249  *    closed, doesn't exist, or the peer is currently disconnected.
33250  *  * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
33251  *    relevant updates.
33252  *
33253  * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
33254  * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
33255  * different route unless you intend to pay twice!
33256  *
33257  * [`RouteHop`]: crate::routing::router::RouteHop
33258  * [`Event::PaymentSent`]: events::Event::PaymentSent
33259  * [`Event::PaymentFailed`]: events::Event::PaymentFailed
33260  * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
33261  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
33262  * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
33263  */
33264 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);
33265
33266 /**
33267  * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
33268  * `route_params` and retry failed payment paths based on `retry_strategy`.
33269  */
33270 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);
33271
33272 /**
33273  * Signals that no further attempts for the given payment should occur. Useful if you have a
33274  * pending outbound payment with retries remaining, but wish to stop retrying the payment before
33275  * retries are exhausted.
33276  *
33277  * # Event Generation
33278  *
33279  * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
33280  * as there are no remaining pending HTLCs for this payment.
33281  *
33282  * Note that calling this method does *not* prevent a payment from succeeding. You must still
33283  * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
33284  * determine the ultimate status of a payment.
33285  *
33286  * # Requested Invoices
33287  *
33288  * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
33289  * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
33290  * and prevent any attempts at paying it once received. The other events may only be generated
33291  * once the invoice has been received.
33292  *
33293  * # Restart Behavior
33294  *
33295  * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
33296  * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
33297  * [`Event::InvoiceRequestFailed`].
33298  *
33299  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
33300  */
33301 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
33302
33303 /**
33304  * Send a spontaneous payment, which is a payment that does not require the recipient to have
33305  * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
33306  * the preimage, it must be a cryptographically secure random value that no intermediate node
33307  * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
33308  * never reach the recipient.
33309  *
33310  * See [`send_payment`] documentation for more details on the return value of this function
33311  * and idempotency guarantees provided by the [`PaymentId`] key.
33312  *
33313  * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
33314  * [`send_payment`] for more information about the risks of duplicate preimage usage.
33315  *
33316  * [`send_payment`]: Self::send_payment
33317  */
33318 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);
33319
33320 /**
33321  * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
33322  * based on `route_params` and retry failed payment paths based on `retry_strategy`.
33323  *
33324  * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
33325  * payments.
33326  *
33327  * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
33328  */
33329 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);
33330
33331 /**
33332  * Send a payment that is probing the given route for liquidity. We calculate the
33333  * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
33334  * us to easily discern them from real payments.
33335  */
33336 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
33337
33338 /**
33339  * Sends payment probes over all paths of a route that would be used to pay the given
33340  * amount to the given `node_id`.
33341  *
33342  * See [`ChannelManager::send_preflight_probes`] for more information.
33343  */
33344 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);
33345
33346 /**
33347  * Sends payment probes over all paths of a route that would be used to pay a route found
33348  * according to the given [`RouteParameters`].
33349  *
33350  * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
33351  * the actual payment. Note this is only useful if there likely is sufficient time for the
33352  * probe to settle before sending out the actual payment, e.g., when waiting for user
33353  * confirmation in a wallet UI.
33354  *
33355  * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
33356  * actual payment. Users should therefore be cautious and might avoid sending probes if
33357  * liquidity is scarce and/or they don't expect the probe to return before they send the
33358  * payment. To mitigate this issue, channels with available liquidity less than the required
33359  * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
33360  * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
33361  */
33362 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);
33363
33364 /**
33365  * Call this upon creation of a funding transaction for the given channel.
33366  *
33367  * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
33368  * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
33369  *
33370  * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
33371  * across the p2p network.
33372  *
33373  * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
33374  * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
33375  *
33376  * May panic if the output found in the funding transaction is duplicative with some other
33377  * channel (note that this should be trivially prevented by using unique funding transaction
33378  * keys per-channel).
33379  *
33380  * Do NOT broadcast the funding transaction yourself. When we have safely received our
33381  * counterparty's signature the funding transaction will automatically be broadcast via the
33382  * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
33383  *
33384  * Note that this includes RBF or similar transaction replacement strategies - lightning does
33385  * not currently support replacing a funding transaction on an existing channel. Instead,
33386  * create a new channel with a conflicting funding transaction.
33387  *
33388  * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
33389  * the wallet software generating the funding transaction to apply anti-fee sniping as
33390  * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
33391  * for more details.
33392  *
33393  * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
33394  * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
33395  */
33396 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);
33397
33398 /**
33399  * Call this upon creation of a batch funding transaction for the given channels.
33400  *
33401  * Return values are identical to [`Self::funding_transaction_generated`], respective to
33402  * each individual channel and transaction output.
33403  *
33404  * Do NOT broadcast the funding transaction yourself. This batch funding transaction
33405  * will only be broadcast when we have safely received and persisted the counterparty's
33406  * signature for each channel.
33407  *
33408  * If there is an error, all channels in the batch are to be considered closed.
33409  */
33410 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);
33411
33412 /**
33413  * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
33414  *
33415  * Once the updates are applied, each eligible channel (advertised with a known short channel
33416  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
33417  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
33418  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
33419  *
33420  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
33421  * `counterparty_node_id` is provided.
33422  *
33423  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
33424  * below [`MIN_CLTV_EXPIRY_DELTA`].
33425  *
33426  * If an error is returned, none of the updates should be considered applied.
33427  *
33428  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
33429  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
33430  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
33431  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
33432  * [`ChannelUpdate`]: msgs::ChannelUpdate
33433  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
33434  * [`APIMisuseError`]: APIError::APIMisuseError
33435  */
33436 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);
33437
33438 /**
33439  * Atomically updates the [`ChannelConfig`] for the given channels.
33440  *
33441  * Once the updates are applied, each eligible channel (advertised with a known short channel
33442  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
33443  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
33444  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
33445  *
33446  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
33447  * `counterparty_node_id` is provided.
33448  *
33449  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
33450  * below [`MIN_CLTV_EXPIRY_DELTA`].
33451  *
33452  * If an error is returned, none of the updates should be considered applied.
33453  *
33454  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
33455  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
33456  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
33457  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
33458  * [`ChannelUpdate`]: msgs::ChannelUpdate
33459  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
33460  * [`APIMisuseError`]: APIError::APIMisuseError
33461  */
33462 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);
33463
33464 /**
33465  * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
33466  * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
33467  *
33468  * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
33469  * channel to a receiving node if the node lacks sufficient inbound liquidity.
33470  *
33471  * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
33472  * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
33473  * receiver's invoice route hints. These route hints will signal to LDK to generate an
33474  * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
33475  * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
33476  *
33477  * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
33478  * you from forwarding more than you received. See
33479  * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
33480  * than expected.
33481  *
33482  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
33483  * backwards.
33484  *
33485  * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
33486  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
33487  * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
33488  */
33489 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);
33490
33491 /**
33492  * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
33493  * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
33494  *
33495  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
33496  * backwards.
33497  *
33498  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
33499  */
33500 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
33501
33502 /**
33503  * Processes HTLCs which are pending waiting on random forward delay.
33504  *
33505  * Should only really ever be called in response to a PendingHTLCsForwardable event.
33506  * Will likely generate further events.
33507  */
33508 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
33509
33510 /**
33511  * Performs actions which should happen on startup and roughly once per minute thereafter.
33512  *
33513  * This currently includes:
33514  *  * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
33515  *  * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
33516  *    than a minute, informing the network that they should no longer attempt to route over
33517  *    the channel.
33518  *  * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
33519  *    with the current [`ChannelConfig`].
33520  *  * Removing peers which have disconnected but and no longer have any channels.
33521  *  * Force-closing and removing channels which have not completed establishment in a timely manner.
33522  *  * Forgetting about stale outbound payments, either those that have already been fulfilled
33523  *    or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
33524  *    The latter is determined using the system clock in `std` and the highest seen block time
33525  *    minus two hours in `no-std`.
33526  *
33527  * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
33528  * estimate fetches.
33529  *
33530  * [`ChannelUpdate`]: msgs::ChannelUpdate
33531  * [`ChannelConfig`]: crate::util::config::ChannelConfig
33532  */
33533 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
33534
33535 /**
33536  * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
33537  * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
33538  * along the path (including in our own channel on which we received it).
33539  *
33540  * Note that in some cases around unclean shutdown, it is possible the payment may have
33541  * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
33542  * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
33543  * may have already been failed automatically by LDK if it was nearing its expiration time.
33544  *
33545  * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
33546  * [`ChannelManager::claim_funds`]), you should still monitor for
33547  * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
33548  * startup during which time claims that were in-progress at shutdown may be replayed.
33549  */
33550 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
33551
33552 /**
33553  * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
33554  * reason for the failure.
33555  *
33556  * See [`FailureCode`] for valid failure codes.
33557  */
33558 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
33559
33560 /**
33561  * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
33562  * [`MessageSendEvent`]s needed to claim the payment.
33563  *
33564  * This method is guaranteed to ensure the payment has been claimed but only if the current
33565  * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
33566  * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
33567  * successful. It will generally be available in the next [`process_pending_events`] call.
33568  *
33569  * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
33570  * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
33571  * event matches your expectation. If you fail to do so and call this method, you may provide
33572  * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
33573  *
33574  * This function will fail the payment if it has custom TLVs with even type numbers, as we
33575  * will assume they are unknown. If you intend to accept even custom TLVs, you should use
33576  * [`claim_funds_with_known_custom_tlvs`].
33577  *
33578  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
33579  * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
33580  * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
33581  * [`process_pending_events`]: EventsProvider::process_pending_events
33582  * [`create_inbound_payment`]: Self::create_inbound_payment
33583  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
33584  * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
33585  */
33586 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
33587
33588 /**
33589  * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
33590  * even type numbers.
33591  *
33592  * # Note
33593  *
33594  * You MUST check you've understood all even TLVs before using this to
33595  * claim, otherwise you may unintentionally agree to some protocol you do not understand.
33596  *
33597  * [`claim_funds`]: Self::claim_funds
33598  */
33599 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
33600
33601 /**
33602  * Gets the node_id held by this ChannelManager
33603  */
33604 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
33605
33606 /**
33607  * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
33608  *
33609  * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
33610  * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
33611  * the channel.
33612  *
33613  * The `user_channel_id` parameter will be provided back in
33614  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
33615  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
33616  *
33617  * Note that this method will return an error and reject the channel, if it requires support
33618  * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
33619  * used to accept such channels.
33620  *
33621  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
33622  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
33623  */
33624 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);
33625
33626 /**
33627  * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
33628  * it as confirmed immediately.
33629  *
33630  * The `user_channel_id` parameter will be provided back in
33631  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
33632  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
33633  *
33634  * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
33635  * and (if the counterparty agrees), enables forwarding of payments immediately.
33636  *
33637  * This fully trusts that the counterparty has honestly and correctly constructed the funding
33638  * transaction and blindly assumes that it will eventually confirm.
33639  *
33640  * If it does not confirm before we decide to close the channel, or if the funding transaction
33641  * does not pay to the correct script the correct amount, *you will lose funds*.
33642  *
33643  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
33644  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
33645  */
33646 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);
33647
33648 /**
33649  * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
33650  * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
33651  * [`Bolt12Invoice`] once it is received.
33652  *
33653  * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
33654  * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
33655  * The optional parameters are used in the builder, if `Some`:
33656  * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
33657  *   [`Offer::expects_quantity`] is `true`.
33658  * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
33659  * - `payer_note` for [`InvoiceRequest::payer_note`].
33660  *
33661  * If `max_total_routing_fee_msat` is not specified, The default from
33662  * [`RouteParameters::from_payment_params_and_value`] is applied.
33663  *
33664  * # Payment
33665  *
33666  * The provided `payment_id` is used to ensure that only one invoice is paid for the request
33667  * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
33668  * been sent.
33669  *
33670  * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
33671  * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
33672  * payment will fail with an [`Event::InvoiceRequestFailed`].
33673  *
33674  * # Privacy
33675  *
33676  * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
33677  * as the introduction node and a derived payer id for payer privacy. As such, currently, the
33678  * node must be announced. Otherwise, there is no way to find a path to the introduction node
33679  * in order to send the [`Bolt12Invoice`].
33680  *
33681  * # Limitations
33682  *
33683  * Requires a direct connection to an introduction node in [`Offer::paths`] or to
33684  * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
33685  * [`Bolt12Invoice::payment_paths`].
33686  *
33687  * # Errors
33688  *
33689  * Errors if:
33690  * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
33691  * - the provided parameters are invalid for the offer,
33692  * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
33693  *   request.
33694  *
33695  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
33696  * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
33697  * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
33698  * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
33699  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
33700  * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
33701  * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
33702  */
33703 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);
33704
33705 /**
33706  * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
33707  * message.
33708  *
33709  * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
33710  * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
33711  * [`PaymentPreimage`].
33712  *
33713  * # Limitations
33714  *
33715  * Requires a direct connection to an introduction node in [`Refund::paths`] or to
33716  * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
33717  * node meeting the aforementioned criteria, but there's no guarantee that they will be
33718  * received and no retries will be made.
33719  *
33720  * # Errors
33721  *
33722  * Errors if the parameterized [`Router`] is unable to create a blinded payment path or reply
33723  * path for the invoice.
33724  *
33725  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
33726  */
33727 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
33728
33729 /**
33730  * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
33731  * to pay us.
33732  *
33733  * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
33734  * [`PaymentHash`] and [`PaymentPreimage`] for you.
33735  *
33736  * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
33737  * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
33738  * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
33739  * passed directly to [`claim_funds`].
33740  *
33741  * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
33742  *
33743  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
33744  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
33745  *
33746  * # Note
33747  *
33748  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
33749  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
33750  *
33751  * Errors if `min_value_msat` is greater than total bitcoin supply.
33752  *
33753  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
33754  * on versions of LDK prior to 0.0.114.
33755  *
33756  * [`claim_funds`]: Self::claim_funds
33757  * [`PaymentClaimable`]: events::Event::PaymentClaimable
33758  * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
33759  * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
33760  * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
33761  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
33762  */
33763 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);
33764
33765 /**
33766  * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
33767  * stored external to LDK.
33768  *
33769  * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
33770  * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
33771  * the `min_value_msat` provided here, if one is provided.
33772  *
33773  * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
33774  * note that LDK will not stop you from registering duplicate payment hashes for inbound
33775  * payments.
33776  *
33777  * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
33778  * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
33779  * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
33780  * sender \"proof-of-payment\" unless they have paid the required amount.
33781  *
33782  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
33783  * in excess of the current time. This should roughly match the expiry time set in the invoice.
33784  * After this many seconds, we will remove the inbound payment, resulting in any attempts to
33785  * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
33786  * invoices when no timeout is set.
33787  *
33788  * Note that we use block header time to time-out pending inbound payments (with some margin
33789  * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
33790  * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
33791  * If you need exact expiry semantics, you should enforce them upon receipt of
33792  * [`PaymentClaimable`].
33793  *
33794  * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
33795  * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
33796  *
33797  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
33798  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
33799  *
33800  * # Note
33801  *
33802  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
33803  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
33804  *
33805  * Errors if `min_value_msat` is greater than total bitcoin supply.
33806  *
33807  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
33808  * on versions of LDK prior to 0.0.114.
33809  *
33810  * [`create_inbound_payment`]: Self::create_inbound_payment
33811  * [`PaymentClaimable`]: events::Event::PaymentClaimable
33812  */
33813 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);
33814
33815 /**
33816  * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
33817  * previously returned from [`create_inbound_payment`].
33818  *
33819  * [`create_inbound_payment`]: Self::create_inbound_payment
33820  */
33821 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);
33822
33823 /**
33824  * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
33825  * are used when constructing the phantom invoice's route hints.
33826  *
33827  * [phantom node payments]: crate::sign::PhantomKeysManager
33828  */
33829 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
33830
33831 /**
33832  * Gets route hints for use in receiving [phantom node payments].
33833  *
33834  * [phantom node payments]: crate::sign::PhantomKeysManager
33835  */
33836 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
33837
33838 /**
33839  * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
33840  * used when constructing the route hints for HTLCs intended to be intercepted. See
33841  * [`ChannelManager::forward_intercepted_htlc`].
33842  *
33843  * Note that this method is not guaranteed to return unique values, you may need to call it a few
33844  * times to get a unique scid.
33845  */
33846 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
33847
33848 /**
33849  * Gets inflight HTLC information by processing pending outbound payments that are in
33850  * our channels. May be used during pathfinding to account for in-use channel liquidity.
33851  */
33852 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
33853
33854 /**
33855  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
33856  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
33857  */
33858 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
33859
33860 /**
33861  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
33862  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
33863  */
33864 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
33865
33866 /**
33867  * Constructs a new Listen which calls the relevant methods on this_arg.
33868  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
33869  */
33870 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
33871
33872 /**
33873  * Constructs a new Confirm which calls the relevant methods on this_arg.
33874  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
33875  */
33876 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
33877
33878 /**
33879  * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
33880  * may have events that need processing.
33881  *
33882  * In order to check if this [`ChannelManager`] needs persisting, call
33883  * [`Self::get_and_clear_needs_persistence`].
33884  *
33885  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
33886  * [`ChannelManager`] and should instead register actions to be taken later.
33887  */
33888 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
33889
33890 /**
33891  * Returns true if this [`ChannelManager`] needs to be persisted.
33892  */
33893 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
33894
33895 /**
33896  * Gets the latest best block which was connected either via the [`chain::Listen`] or
33897  * [`chain::Confirm`] interfaces.
33898  */
33899 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
33900
33901 /**
33902  * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
33903  * [`ChannelManager`].
33904  */
33905 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
33906
33907 /**
33908  * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
33909  * [`ChannelManager`].
33910  */
33911 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
33912
33913 /**
33914  * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
33915  * [`ChannelManager`].
33916  */
33917 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
33918
33919 /**
33920  * Fetches the set of [`InitFeatures`] flags that are provided by or required by
33921  * [`ChannelManager`].
33922  */
33923 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
33924
33925 /**
33926  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
33927  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
33928  */
33929 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
33930
33931 /**
33932  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
33933  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
33934  */
33935 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
33936
33937 /**
33938  * Fetches the set of [`InitFeatures`] flags that are provided by or required by
33939  * [`ChannelManager`].
33940  */
33941 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
33942
33943 /**
33944  * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
33945  */
33946 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
33947
33948 /**
33949  * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
33950  */
33951 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
33952
33953 /**
33954  * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
33955  */
33956 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
33957
33958 /**
33959  * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
33960  */
33961 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
33962
33963 /**
33964  * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
33965  */
33966 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
33967
33968 /**
33969  * Read a ChannelDetails from a byte array, created by ChannelDetails_write
33970  */
33971 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
33972
33973 /**
33974  * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
33975  */
33976 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
33977
33978 /**
33979  * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
33980  */
33981 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
33982
33983 /**
33984  * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
33985  */
33986 struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
33987
33988 /**
33989  * Read a BlindedForward from a byte array, created by BlindedForward_write
33990  */
33991 struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
33992
33993 /**
33994  * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
33995  */
33996 struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
33997
33998 /**
33999  * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
34000  */
34001 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
34002
34003 /**
34004  * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
34005  */
34006 struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
34007
34008 /**
34009  * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
34010  */
34011 struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
34012
34013 /**
34014  * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
34015  */
34016 struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
34017
34018 /**
34019  * Read a BlindedFailure from a byte array, created by BlindedFailure_write
34020  */
34021 struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
34022
34023 /**
34024  * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
34025  */
34026 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
34027
34028 /**
34029  * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
34030  */
34031 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
34032
34033 /**
34034  * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
34035  */
34036 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
34037
34038 /**
34039  * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
34040  */
34041 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
34042
34043 /**
34044  * A cryptographically secure source of entropy.
34045  */
34046 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34047
34048 /**
34049  * A cryptographically secure source of entropy.
34050  */
34051 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
34052
34053 /**
34054  * A signer that is able to perform node-scoped cryptographic operations.
34055  */
34056 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34057
34058 /**
34059  * A signer that is able to perform node-scoped cryptographic operations.
34060  */
34061 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
34062
34063 /**
34064  * The keys provider which will give us relevant keys. Some keys will be loaded during
34065  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
34066  * signing data.
34067  */
34068 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34069
34070 /**
34071  * The keys provider which will give us relevant keys. Some keys will be loaded during
34072  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
34073  * signing data.
34074  */
34075 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
34076
34077 /**
34078  * The fee_estimator for use in the ChannelManager in the future.
34079  *
34080  * No calls to the FeeEstimator will be made during deserialization.
34081  */
34082 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34083
34084 /**
34085  * The fee_estimator for use in the ChannelManager in the future.
34086  *
34087  * No calls to the FeeEstimator will be made during deserialization.
34088  */
34089 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
34090
34091 /**
34092  * The chain::Watch for use in the ChannelManager in the future.
34093  *
34094  * No calls to the chain::Watch will be made during deserialization. It is assumed that
34095  * you have deserialized ChannelMonitors separately and will add them to your
34096  * chain::Watch after deserializing this ChannelManager.
34097  */
34098 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34099
34100 /**
34101  * The chain::Watch for use in the ChannelManager in the future.
34102  *
34103  * No calls to the chain::Watch will be made during deserialization. It is assumed that
34104  * you have deserialized ChannelMonitors separately and will add them to your
34105  * chain::Watch after deserializing this ChannelManager.
34106  */
34107 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
34108
34109 /**
34110  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
34111  * used to broadcast the latest local commitment transactions of channels which must be
34112  * force-closed during deserialization.
34113  */
34114 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34115
34116 /**
34117  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
34118  * used to broadcast the latest local commitment transactions of channels which must be
34119  * force-closed during deserialization.
34120  */
34121 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
34122
34123 /**
34124  * The router which will be used in the ChannelManager in the future for finding routes
34125  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
34126  *
34127  * No calls to the router will be made during deserialization.
34128  */
34129 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34130
34131 /**
34132  * The router which will be used in the ChannelManager in the future for finding routes
34133  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
34134  *
34135  * No calls to the router will be made during deserialization.
34136  */
34137 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
34138
34139 /**
34140  * The Logger for use in the ChannelManager and which may be used to log information during
34141  * deserialization.
34142  */
34143 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34144
34145 /**
34146  * The Logger for use in the ChannelManager and which may be used to log information during
34147  * deserialization.
34148  */
34149 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
34150
34151 /**
34152  * Default settings used for new channels. Any existing channels will continue to use the
34153  * runtime settings which were stored when the ChannelManager was serialized.
34154  */
34155 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34156
34157 /**
34158  * Default settings used for new channels. Any existing channels will continue to use the
34159  * runtime settings which were stored when the ChannelManager was serialized.
34160  */
34161 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
34162
34163 /**
34164  * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
34165  * HashMap for you. This is primarily useful for C bindings where it is not practical to
34166  * populate a HashMap directly from C.
34167  */
34168 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);
34169
34170 /**
34171  * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
34172  */
34173 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
34174
34175 /**
34176  * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
34177  */
34178 void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
34179
34180 struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
34181
34182 void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34183
34184 /**
34185  * Constructs a new DelayedPaymentBasepoint given each field
34186  */
34187 MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
34188
34189 /**
34190  * Checks if two DelayedPaymentBasepoints contain equal inner contents.
34191  * This ignores pointers and is_owned flags and looks at the values in fields.
34192  * Two objects with NULL inner values will be considered "equal" here.
34193  */
34194 bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
34195
34196 /**
34197  * Creates a copy of the DelayedPaymentBasepoint
34198  */
34199 struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
34200
34201 /**
34202  * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
34203  */
34204 uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
34205
34206 /**
34207  * Get inner Public Key
34208  */
34209 MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
34210
34211 /**
34212  * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
34213  */
34214 struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
34215
34216 /**
34217  * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
34218  */
34219 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
34220
34221 /**
34222  * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
34223  */
34224 void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
34225
34226 struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
34227
34228 void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34229
34230 /**
34231  * Constructs a new DelayedPaymentKey given each field
34232  */
34233 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
34234
34235 /**
34236  * Checks if two DelayedPaymentKeys contain equal inner contents.
34237  * This ignores pointers and is_owned flags and looks at the values in fields.
34238  * Two objects with NULL inner values will be considered "equal" here.
34239  */
34240 bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
34241
34242 /**
34243  * Creates a copy of the DelayedPaymentKey
34244  */
34245 struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
34246
34247 /**
34248  *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
34249  */
34250 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
34251
34252 /**
34253  *Build a delayedpubkey directly from an already-derived private key
34254  */
34255 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
34256
34257 /**
34258  * Get inner Public Key
34259  */
34260 MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
34261
34262 /**
34263  * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
34264  */
34265 struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
34266
34267 /**
34268  * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
34269  */
34270 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
34271
34272 /**
34273  * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
34274  */
34275 void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
34276
34277 struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
34278
34279 void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34280
34281 /**
34282  * Constructs a new HtlcBasepoint given each field
34283  */
34284 MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
34285
34286 /**
34287  * Checks if two HtlcBasepoints contain equal inner contents.
34288  * This ignores pointers and is_owned flags and looks at the values in fields.
34289  * Two objects with NULL inner values will be considered "equal" here.
34290  */
34291 bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
34292
34293 /**
34294  * Creates a copy of the HtlcBasepoint
34295  */
34296 struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
34297
34298 /**
34299  * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
34300  */
34301 uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
34302
34303 /**
34304  * Get inner Public Key
34305  */
34306 MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
34307
34308 /**
34309  * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
34310  */
34311 struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
34312
34313 /**
34314  * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
34315  */
34316 struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
34317
34318 /**
34319  * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
34320  */
34321 void HtlcKey_free(struct LDKHtlcKey this_obj);
34322
34323 struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
34324
34325 void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34326
34327 /**
34328  * Constructs a new HtlcKey given each field
34329  */
34330 MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
34331
34332 /**
34333  * Checks if two HtlcKeys contain equal inner contents.
34334  * This ignores pointers and is_owned flags and looks at the values in fields.
34335  * Two objects with NULL inner values will be considered "equal" here.
34336  */
34337 bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
34338
34339 /**
34340  * Creates a copy of the HtlcKey
34341  */
34342 struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
34343
34344 /**
34345  *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
34346  */
34347 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
34348
34349 /**
34350  *Build a htlcpubkey directly from an already-derived private key
34351  */
34352 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
34353
34354 /**
34355  * Get inner Public Key
34356  */
34357 MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
34358
34359 /**
34360  * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
34361  */
34362 struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
34363
34364 /**
34365  * Read a HtlcKey from a byte array, created by HtlcKey_write
34366  */
34367 struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
34368
34369 /**
34370  * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
34371  */
34372 void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
34373
34374 struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
34375
34376 void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34377
34378 /**
34379  * Constructs a new RevocationBasepoint given each field
34380  */
34381 MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
34382
34383 /**
34384  * Checks if two RevocationBasepoints contain equal inner contents.
34385  * This ignores pointers and is_owned flags and looks at the values in fields.
34386  * Two objects with NULL inner values will be considered "equal" here.
34387  */
34388 bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
34389
34390 /**
34391  * Creates a copy of the RevocationBasepoint
34392  */
34393 struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
34394
34395 /**
34396  * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
34397  */
34398 uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
34399
34400 /**
34401  * Get inner Public Key
34402  */
34403 MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
34404
34405 /**
34406  * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
34407  */
34408 struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
34409
34410 /**
34411  * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
34412  */
34413 struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
34414
34415 /**
34416  * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
34417  */
34418 void RevocationKey_free(struct LDKRevocationKey this_obj);
34419
34420 struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
34421
34422 void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34423
34424 /**
34425  * Constructs a new RevocationKey given each field
34426  */
34427 MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
34428
34429 /**
34430  * Checks if two RevocationKeys contain equal inner contents.
34431  * This ignores pointers and is_owned flags and looks at the values in fields.
34432  * Two objects with NULL inner values will be considered "equal" here.
34433  */
34434 bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
34435
34436 /**
34437  * Creates a copy of the RevocationKey
34438  */
34439 struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
34440
34441 /**
34442  * Generates a non-cryptographic 64-bit hash of the RevocationKey.
34443  */
34444 uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
34445
34446 /**
34447  * Derives a per-commitment-transaction revocation public key from one party's per-commitment
34448  * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
34449  * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
34450  * key instead of private keys.
34451  *
34452  * Note that this is infallible iff we trust that at least one of the two input keys are randomly
34453  * generated (ie our own).
34454  *
34455  * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
34456  */
34457 MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
34458
34459 /**
34460  * Get inner Public Key
34461  */
34462 MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
34463
34464 /**
34465  * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
34466  */
34467 struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
34468
34469 /**
34470  * Read a RevocationKey from a byte array, created by RevocationKey_write
34471  */
34472 struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
34473
34474 /**
34475  * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
34476  */
34477 void ExpandedKey_free(struct LDKExpandedKey this_obj);
34478
34479 /**
34480  * Create a  new [`ExpandedKey`] for generating an inbound payment hash and secret.
34481  *
34482  * It is recommended to cache this value and not regenerate it for each new inbound payment.
34483  */
34484 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
34485
34486 /**
34487  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
34488  * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
34489  * a `ChannelManager`.
34490  *
34491  * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
34492  * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
34493  * regenerate it for each new inbound payment.
34494  *
34495  * `current_time` is a Unix timestamp representing the current time.
34496  *
34497  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
34498  * on versions of LDK prior to 0.0.114.
34499  *
34500  * [phantom node payments]: crate::sign::PhantomKeysManager
34501  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
34502  */
34503 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);
34504
34505 /**
34506  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
34507  * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
34508  * without a `ChannelManager`.
34509  *
34510  * See [`create`] for information on the `keys` and `current_time` parameters.
34511  *
34512  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
34513  * on versions of LDK prior to 0.0.114.
34514  *
34515  * [phantom node payments]: crate::sign::PhantomKeysManager
34516  */
34517 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);
34518
34519 /**
34520  * Frees any resources used by the DecodeError
34521  */
34522 void DecodeError_free(struct LDKDecodeError this_ptr);
34523
34524 /**
34525  * Creates a copy of the DecodeError
34526  */
34527 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
34528
34529 /**
34530  * Utility method to constructs a new UnknownVersion-variant DecodeError
34531  */
34532 struct LDKDecodeError DecodeError_unknown_version(void);
34533
34534 /**
34535  * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
34536  */
34537 struct LDKDecodeError DecodeError_unknown_required_feature(void);
34538
34539 /**
34540  * Utility method to constructs a new InvalidValue-variant DecodeError
34541  */
34542 struct LDKDecodeError DecodeError_invalid_value(void);
34543
34544 /**
34545  * Utility method to constructs a new ShortRead-variant DecodeError
34546  */
34547 struct LDKDecodeError DecodeError_short_read(void);
34548
34549 /**
34550  * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
34551  */
34552 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
34553
34554 /**
34555  * Utility method to constructs a new Io-variant DecodeError
34556  */
34557 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
34558
34559 /**
34560  * Utility method to constructs a new UnsupportedCompression-variant DecodeError
34561  */
34562 struct LDKDecodeError DecodeError_unsupported_compression(void);
34563
34564 /**
34565  * Generates a non-cryptographic 64-bit hash of the DecodeError.
34566  */
34567 uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
34568
34569 /**
34570  * Checks if two DecodeErrors contain equal inner contents.
34571  * This ignores pointers and is_owned flags and looks at the values in fields.
34572  */
34573 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
34574
34575 /**
34576  * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
34577  */
34578 void Init_free(struct LDKInit this_obj);
34579
34580 /**
34581  * The relevant features which the sender supports.
34582  */
34583 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
34584
34585 /**
34586  * The relevant features which the sender supports.
34587  */
34588 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
34589
34590 /**
34591  * Indicates chains the sender is interested in.
34592  *
34593  * If there are no common chains, the connection will be closed.
34594  *
34595  * Returns a copy of the field.
34596  */
34597 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
34598
34599 /**
34600  * Indicates chains the sender is interested in.
34601  *
34602  * If there are no common chains, the connection will be closed.
34603  */
34604 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
34605
34606 /**
34607  * The receipient's network address.
34608  *
34609  * This adds the option to report a remote IP address back to a connecting peer using the init
34610  * message. A node can decide to use that information to discover a potential update to its
34611  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
34612  * the new address.
34613  */
34614 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
34615
34616 /**
34617  * The receipient's network address.
34618  *
34619  * This adds the option to report a remote IP address back to a connecting peer using the init
34620  * message. A node can decide to use that information to discover a potential update to its
34621  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
34622  * the new address.
34623  */
34624 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
34625
34626 /**
34627  * Constructs a new Init given each field
34628  */
34629 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
34630
34631 /**
34632  * Creates a copy of the Init
34633  */
34634 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
34635
34636 /**
34637  * Generates a non-cryptographic 64-bit hash of the Init.
34638  */
34639 uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
34640
34641 /**
34642  * Checks if two Inits contain equal inner contents.
34643  * This ignores pointers and is_owned flags and looks at the values in fields.
34644  * Two objects with NULL inner values will be considered "equal" here.
34645  */
34646 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
34647
34648 /**
34649  * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
34650  */
34651 void ErrorMessage_free(struct LDKErrorMessage this_obj);
34652
34653 /**
34654  * The channel ID involved in the error.
34655  *
34656  * All-0s indicates a general error unrelated to a specific channel, after which all channels
34657  * with the sending peer should be closed.
34658  */
34659 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
34660
34661 /**
34662  * The channel ID involved in the error.
34663  *
34664  * All-0s indicates a general error unrelated to a specific channel, after which all channels
34665  * with the sending peer should be closed.
34666  */
34667 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34668
34669 /**
34670  * A possibly human-readable error description.
34671  *
34672  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
34673  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
34674  * the terminal emulator or the logging subsystem.
34675  */
34676 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
34677
34678 /**
34679  * A possibly human-readable error description.
34680  *
34681  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
34682  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
34683  * the terminal emulator or the logging subsystem.
34684  */
34685 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
34686
34687 /**
34688  * Constructs a new ErrorMessage given each field
34689  */
34690 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
34691
34692 /**
34693  * Creates a copy of the ErrorMessage
34694  */
34695 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
34696
34697 /**
34698  * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
34699  */
34700 uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
34701
34702 /**
34703  * Checks if two ErrorMessages contain equal inner contents.
34704  * This ignores pointers and is_owned flags and looks at the values in fields.
34705  * Two objects with NULL inner values will be considered "equal" here.
34706  */
34707 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
34708
34709 /**
34710  * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
34711  */
34712 void WarningMessage_free(struct LDKWarningMessage this_obj);
34713
34714 /**
34715  * The channel ID involved in the warning.
34716  *
34717  * All-0s indicates a warning unrelated to a specific channel.
34718  */
34719 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
34720
34721 /**
34722  * The channel ID involved in the warning.
34723  *
34724  * All-0s indicates a warning unrelated to a specific channel.
34725  */
34726 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34727
34728 /**
34729  * A possibly human-readable warning description.
34730  *
34731  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
34732  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
34733  * the terminal emulator or the logging subsystem.
34734  */
34735 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
34736
34737 /**
34738  * A possibly human-readable warning description.
34739  *
34740  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
34741  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
34742  * the terminal emulator or the logging subsystem.
34743  */
34744 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
34745
34746 /**
34747  * Constructs a new WarningMessage given each field
34748  */
34749 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
34750
34751 /**
34752  * Creates a copy of the WarningMessage
34753  */
34754 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
34755
34756 /**
34757  * Generates a non-cryptographic 64-bit hash of the WarningMessage.
34758  */
34759 uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
34760
34761 /**
34762  * Checks if two WarningMessages contain equal inner contents.
34763  * This ignores pointers and is_owned flags and looks at the values in fields.
34764  * Two objects with NULL inner values will be considered "equal" here.
34765  */
34766 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
34767
34768 /**
34769  * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
34770  */
34771 void Ping_free(struct LDKPing this_obj);
34772
34773 /**
34774  * The desired response length.
34775  */
34776 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
34777
34778 /**
34779  * The desired response length.
34780  */
34781 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
34782
34783 /**
34784  * The ping packet size.
34785  *
34786  * This field is not sent on the wire. byteslen zeros are sent.
34787  */
34788 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
34789
34790 /**
34791  * The ping packet size.
34792  *
34793  * This field is not sent on the wire. byteslen zeros are sent.
34794  */
34795 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
34796
34797 /**
34798  * Constructs a new Ping given each field
34799  */
34800 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
34801
34802 /**
34803  * Creates a copy of the Ping
34804  */
34805 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
34806
34807 /**
34808  * Generates a non-cryptographic 64-bit hash of the Ping.
34809  */
34810 uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
34811
34812 /**
34813  * Checks if two Pings contain equal inner contents.
34814  * This ignores pointers and is_owned flags and looks at the values in fields.
34815  * Two objects with NULL inner values will be considered "equal" here.
34816  */
34817 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
34818
34819 /**
34820  * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
34821  */
34822 void Pong_free(struct LDKPong this_obj);
34823
34824 /**
34825  * The pong packet size.
34826  *
34827  * This field is not sent on the wire. byteslen zeros are sent.
34828  */
34829 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
34830
34831 /**
34832  * The pong packet size.
34833  *
34834  * This field is not sent on the wire. byteslen zeros are sent.
34835  */
34836 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
34837
34838 /**
34839  * Constructs a new Pong given each field
34840  */
34841 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
34842
34843 /**
34844  * Creates a copy of the Pong
34845  */
34846 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
34847
34848 /**
34849  * Generates a non-cryptographic 64-bit hash of the Pong.
34850  */
34851 uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
34852
34853 /**
34854  * Checks if two Pongs contain equal inner contents.
34855  * This ignores pointers and is_owned flags and looks at the values in fields.
34856  * Two objects with NULL inner values will be considered "equal" here.
34857  */
34858 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
34859
34860 /**
34861  * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
34862  */
34863 void OpenChannel_free(struct LDKOpenChannel this_obj);
34864
34865 /**
34866  * The genesis hash of the blockchain where the channel is to be opened
34867  */
34868 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
34869
34870 /**
34871  * The genesis hash of the blockchain where the channel is to be opened
34872  */
34873 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34874
34875 /**
34876  * A temporary channel ID, until the funding outpoint is announced
34877  */
34878 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
34879
34880 /**
34881  * A temporary channel ID, until the funding outpoint is announced
34882  */
34883 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34884
34885 /**
34886  * The channel value
34887  */
34888 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34889
34890 /**
34891  * The channel value
34892  */
34893 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34894
34895 /**
34896  * The amount to push to the counterparty as part of the open, in milli-satoshi
34897  */
34898 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34899
34900 /**
34901  * The amount to push to the counterparty as part of the open, in milli-satoshi
34902  */
34903 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34904
34905 /**
34906  * The threshold below which outputs on transactions broadcast by sender will be omitted
34907  */
34908 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34909
34910 /**
34911  * The threshold below which outputs on transactions broadcast by sender will be omitted
34912  */
34913 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34914
34915 /**
34916  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
34917  */
34918 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34919
34920 /**
34921  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
34922  */
34923 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34924
34925 /**
34926  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
34927  */
34928 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34929
34930 /**
34931  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
34932  */
34933 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34934
34935 /**
34936  * The minimum HTLC size incoming to sender, in milli-satoshi
34937  */
34938 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34939
34940 /**
34941  * The minimum HTLC size incoming to sender, in milli-satoshi
34942  */
34943 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34944
34945 /**
34946  * The feerate per 1000-weight of sender generated transactions, until updated by
34947  * [`UpdateFee`]
34948  */
34949 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34950
34951 /**
34952  * The feerate per 1000-weight of sender generated transactions, until updated by
34953  * [`UpdateFee`]
34954  */
34955 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
34956
34957 /**
34958  * The number of blocks which the counterparty will have to wait to claim on-chain funds if
34959  * they broadcast a commitment transaction
34960  */
34961 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34962
34963 /**
34964  * The number of blocks which the counterparty will have to wait to claim on-chain funds if
34965  * they broadcast a commitment transaction
34966  */
34967 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
34968
34969 /**
34970  * The maximum number of inbound HTLCs towards sender
34971  */
34972 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34973
34974 /**
34975  * The maximum number of inbound HTLCs towards sender
34976  */
34977 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
34978
34979 /**
34980  * The sender's key controlling the funding transaction
34981  */
34982 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34983
34984 /**
34985  * The sender's key controlling the funding transaction
34986  */
34987 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34988
34989 /**
34990  * Used to derive a revocation key for transactions broadcast by counterparty
34991  */
34992 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34993
34994 /**
34995  * Used to derive a revocation key for transactions broadcast by counterparty
34996  */
34997 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34998
34999 /**
35000  * A payment key to sender for transactions broadcast by counterparty
35001  */
35002 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35003
35004 /**
35005  * A payment key to sender for transactions broadcast by counterparty
35006  */
35007 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35008
35009 /**
35010  * Used to derive a payment key to sender for transactions broadcast by sender
35011  */
35012 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35013
35014 /**
35015  * Used to derive a payment key to sender for transactions broadcast by sender
35016  */
35017 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35018
35019 /**
35020  * Used to derive an HTLC payment key to sender
35021  */
35022 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35023
35024 /**
35025  * Used to derive an HTLC payment key to sender
35026  */
35027 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35028
35029 /**
35030  * The first to-be-broadcast-by-sender transaction's per commitment point
35031  */
35032 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35033
35034 /**
35035  * The first to-be-broadcast-by-sender transaction's per commitment point
35036  */
35037 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35038
35039 /**
35040  * The channel flags to be used
35041  */
35042 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35043
35044 /**
35045  * The channel flags to be used
35046  */
35047 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
35048
35049 /**
35050  * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
35051  */
35052 struct LDKCOption_CVec_u8ZZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35053
35054 /**
35055  * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
35056  */
35057 void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
35058
35059 /**
35060  * The channel type that this channel will represent
35061  *
35062  * If this is `None`, we derive the channel type from the intersection of our
35063  * feature bits with our counterparty's feature bits from the [`Init`] message.
35064  *
35065  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35066  */
35067 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35068
35069 /**
35070  * The channel type that this channel will represent
35071  *
35072  * If this is `None`, we derive the channel type from the intersection of our
35073  * feature bits with our counterparty's feature bits from the [`Init`] message.
35074  *
35075  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35076  */
35077 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
35078
35079 /**
35080  * Constructs a new OpenChannel given each field
35081  *
35082  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35083  */
35084 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);
35085
35086 /**
35087  * Creates a copy of the OpenChannel
35088  */
35089 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
35090
35091 /**
35092  * Generates a non-cryptographic 64-bit hash of the OpenChannel.
35093  */
35094 uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
35095
35096 /**
35097  * Checks if two OpenChannels contain equal inner contents.
35098  * This ignores pointers and is_owned flags and looks at the values in fields.
35099  * Two objects with NULL inner values will be considered "equal" here.
35100  */
35101 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
35102
35103 /**
35104  * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
35105  */
35106 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
35107
35108 /**
35109  * The genesis hash of the blockchain where the channel is to be opened
35110  */
35111 const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
35112
35113 /**
35114  * The genesis hash of the blockchain where the channel is to be opened
35115  */
35116 void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35117
35118 /**
35119  * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
35120  */
35121 const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
35122
35123 /**
35124  * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
35125  */
35126 void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35127
35128 /**
35129  * The feerate for the funding transaction set by the channel initiator
35130  */
35131 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35132
35133 /**
35134  * The feerate for the funding transaction set by the channel initiator
35135  */
35136 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
35137
35138 /**
35139  * The feerate for the commitment transaction set by the channel initiator
35140  */
35141 uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35142
35143 /**
35144  * The feerate for the commitment transaction set by the channel initiator
35145  */
35146 void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
35147
35148 /**
35149  * Part of the channel value contributed by the channel initiator
35150  */
35151 uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35152
35153 /**
35154  * Part of the channel value contributed by the channel initiator
35155  */
35156 void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35157
35158 /**
35159  * The threshold below which outputs on transactions broadcast by the channel initiator will be
35160  * omitted
35161  */
35162 uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35163
35164 /**
35165  * The threshold below which outputs on transactions broadcast by the channel initiator will be
35166  * omitted
35167  */
35168 void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35169
35170 /**
35171  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
35172  */
35173 uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35174
35175 /**
35176  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
35177  */
35178 void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35179
35180 /**
35181  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
35182  */
35183 uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35184
35185 /**
35186  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
35187  */
35188 void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35189
35190 /**
35191  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
35192  * broadcast a commitment transaction
35193  */
35194 uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35195
35196 /**
35197  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
35198  * broadcast a commitment transaction
35199  */
35200 void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
35201
35202 /**
35203  * The maximum number of inbound HTLCs towards channel initiator
35204  */
35205 uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35206
35207 /**
35208  * The maximum number of inbound HTLCs towards channel initiator
35209  */
35210 void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
35211
35212 /**
35213  * The locktime for the funding transaction
35214  */
35215 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35216
35217 /**
35218  * The locktime for the funding transaction
35219  */
35220 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
35221
35222 /**
35223  * The channel initiator's key controlling the funding transaction
35224  */
35225 struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35226
35227 /**
35228  * The channel initiator's key controlling the funding transaction
35229  */
35230 void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35231
35232 /**
35233  * Used to derive a revocation key for transactions broadcast by counterparty
35234  */
35235 struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35236
35237 /**
35238  * Used to derive a revocation key for transactions broadcast by counterparty
35239  */
35240 void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35241
35242 /**
35243  * A payment key to channel initiator for transactions broadcast by counterparty
35244  */
35245 struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35246
35247 /**
35248  * A payment key to channel initiator for transactions broadcast by counterparty
35249  */
35250 void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35251
35252 /**
35253  * Used to derive a payment key to channel initiator for transactions broadcast by channel
35254  * initiator
35255  */
35256 struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35257
35258 /**
35259  * Used to derive a payment key to channel initiator for transactions broadcast by channel
35260  * initiator
35261  */
35262 void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35263
35264 /**
35265  * Used to derive an HTLC payment key to channel initiator
35266  */
35267 struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35268
35269 /**
35270  * Used to derive an HTLC payment key to channel initiator
35271  */
35272 void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35273
35274 /**
35275  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
35276  */
35277 struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35278
35279 /**
35280  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
35281  */
35282 void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35283
35284 /**
35285  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
35286  */
35287 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35288
35289 /**
35290  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
35291  */
35292 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35293
35294 /**
35295  * Channel flags
35296  */
35297 uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35298
35299 /**
35300  * Channel flags
35301  */
35302 void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val);
35303
35304 /**
35305  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
35306  * collaboratively close
35307  */
35308 struct LDKCOption_CVec_u8ZZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35309
35310 /**
35311  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
35312  * collaboratively close
35313  */
35314 void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
35315
35316 /**
35317  * The channel type that this channel will represent. If none is set, we derive the channel
35318  * type from the intersection of our feature bits with our counterparty's feature bits from
35319  * the Init message.
35320  *
35321  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35322  */
35323 struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35324
35325 /**
35326  * The channel type that this channel will represent. If none is set, we derive the channel
35327  * type from the intersection of our feature bits with our counterparty's feature bits from
35328  * the Init message.
35329  *
35330  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35331  */
35332 void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
35333
35334 /**
35335  * Optionally, a requirement that only confirmed inputs can be added
35336  */
35337 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35338
35339 /**
35340  * Optionally, a requirement that only confirmed inputs can be added
35341  */
35342 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
35343
35344 /**
35345  * Constructs a new OpenChannelV2 given each field
35346  *
35347  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35348  */
35349 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);
35350
35351 /**
35352  * Creates a copy of the OpenChannelV2
35353  */
35354 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
35355
35356 /**
35357  * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
35358  */
35359 uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
35360
35361 /**
35362  * Checks if two OpenChannelV2s contain equal inner contents.
35363  * This ignores pointers and is_owned flags and looks at the values in fields.
35364  * Two objects with NULL inner values will be considered "equal" here.
35365  */
35366 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
35367
35368 /**
35369  * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
35370  */
35371 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
35372
35373 /**
35374  * A temporary channel ID, until the funding outpoint is announced
35375  */
35376 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
35377
35378 /**
35379  * A temporary channel ID, until the funding outpoint is announced
35380  */
35381 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35382
35383 /**
35384  * The threshold below which outputs on transactions broadcast by sender will be omitted
35385  */
35386 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35387
35388 /**
35389  * The threshold below which outputs on transactions broadcast by sender will be omitted
35390  */
35391 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
35392
35393 /**
35394  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
35395  */
35396 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35397
35398 /**
35399  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
35400  */
35401 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
35402
35403 /**
35404  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
35405  */
35406 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35407
35408 /**
35409  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
35410  */
35411 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
35412
35413 /**
35414  * The minimum HTLC size incoming to sender, in milli-satoshi
35415  */
35416 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35417
35418 /**
35419  * The minimum HTLC size incoming to sender, in milli-satoshi
35420  */
35421 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
35422
35423 /**
35424  * Minimum depth of the funding transaction before the channel is considered open
35425  */
35426 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35427
35428 /**
35429  * Minimum depth of the funding transaction before the channel is considered open
35430  */
35431 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
35432
35433 /**
35434  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
35435  */
35436 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35437
35438 /**
35439  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
35440  */
35441 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
35442
35443 /**
35444  * The maximum number of inbound HTLCs towards sender
35445  */
35446 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35447
35448 /**
35449  * The maximum number of inbound HTLCs towards sender
35450  */
35451 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
35452
35453 /**
35454  * The sender's key controlling the funding transaction
35455  */
35456 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35457
35458 /**
35459  * The sender's key controlling the funding transaction
35460  */
35461 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35462
35463 /**
35464  * Used to derive a revocation key for transactions broadcast by counterparty
35465  */
35466 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35467
35468 /**
35469  * Used to derive a revocation key for transactions broadcast by counterparty
35470  */
35471 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35472
35473 /**
35474  * A payment key to sender for transactions broadcast by counterparty
35475  */
35476 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35477
35478 /**
35479  * A payment key to sender for transactions broadcast by counterparty
35480  */
35481 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35482
35483 /**
35484  * Used to derive a payment key to sender for transactions broadcast by sender
35485  */
35486 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35487
35488 /**
35489  * Used to derive a payment key to sender for transactions broadcast by sender
35490  */
35491 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35492
35493 /**
35494  * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
35495  */
35496 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35497
35498 /**
35499  * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
35500  */
35501 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35502
35503 /**
35504  * The first to-be-broadcast-by-sender transaction's per commitment point
35505  */
35506 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35507
35508 /**
35509  * The first to-be-broadcast-by-sender transaction's per commitment point
35510  */
35511 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35512
35513 /**
35514  * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
35515  */
35516 struct LDKCOption_CVec_u8ZZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35517
35518 /**
35519  * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
35520  */
35521 void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
35522
35523 /**
35524  * The channel type that this channel will represent.
35525  *
35526  * If this is `None`, we derive the channel type from the intersection of
35527  * our feature bits with our counterparty's feature bits from the [`Init`] message.
35528  * This is required to match the equivalent field in [`OpenChannel::channel_type`].
35529  *
35530  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35531  */
35532 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35533
35534 /**
35535  * The channel type that this channel will represent.
35536  *
35537  * If this is `None`, we derive the channel type from the intersection of
35538  * our feature bits with our counterparty's feature bits from the [`Init`] message.
35539  * This is required to match the equivalent field in [`OpenChannel::channel_type`].
35540  *
35541  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35542  */
35543 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
35544
35545 /**
35546  * Constructs a new AcceptChannel given each field
35547  *
35548  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35549  */
35550 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);
35551
35552 /**
35553  * Creates a copy of the AcceptChannel
35554  */
35555 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
35556
35557 /**
35558  * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
35559  */
35560 uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
35561
35562 /**
35563  * Checks if two AcceptChannels contain equal inner contents.
35564  * This ignores pointers and is_owned flags and looks at the values in fields.
35565  * Two objects with NULL inner values will be considered "equal" here.
35566  */
35567 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
35568
35569 /**
35570  * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
35571  */
35572 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
35573
35574 /**
35575  * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
35576  */
35577 const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32];
35578
35579 /**
35580  * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
35581  */
35582 void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35583
35584 /**
35585  * Part of the channel value contributed by the channel acceptor
35586  */
35587 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35588
35589 /**
35590  * Part of the channel value contributed by the channel acceptor
35591  */
35592 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35593
35594 /**
35595  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
35596  * omitted
35597  */
35598 uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35599
35600 /**
35601  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
35602  * omitted
35603  */
35604 void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35605
35606 /**
35607  * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
35608  */
35609 uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35610
35611 /**
35612  * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
35613  */
35614 void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35615
35616 /**
35617  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
35618  */
35619 uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35620
35621 /**
35622  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
35623  */
35624 void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35625
35626 /**
35627  * Minimum depth of the funding transaction before the channel is considered open
35628  */
35629 uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35630
35631 /**
35632  * Minimum depth of the funding transaction before the channel is considered open
35633  */
35634 void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
35635
35636 /**
35637  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
35638  * broadcast a commitment transaction
35639  */
35640 uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35641
35642 /**
35643  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
35644  * broadcast a commitment transaction
35645  */
35646 void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
35647
35648 /**
35649  * The maximum number of inbound HTLCs towards channel acceptor
35650  */
35651 uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35652
35653 /**
35654  * The maximum number of inbound HTLCs towards channel acceptor
35655  */
35656 void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
35657
35658 /**
35659  * The channel acceptor's key controlling the funding transaction
35660  */
35661 struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35662
35663 /**
35664  * The channel acceptor's key controlling the funding transaction
35665  */
35666 void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35667
35668 /**
35669  * Used to derive a revocation key for transactions broadcast by counterparty
35670  */
35671 struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35672
35673 /**
35674  * Used to derive a revocation key for transactions broadcast by counterparty
35675  */
35676 void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35677
35678 /**
35679  * A payment key to channel acceptor for transactions broadcast by counterparty
35680  */
35681 struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35682
35683 /**
35684  * A payment key to channel acceptor for transactions broadcast by counterparty
35685  */
35686 void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35687
35688 /**
35689  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
35690  * acceptor
35691  */
35692 struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35693
35694 /**
35695  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
35696  * acceptor
35697  */
35698 void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35699
35700 /**
35701  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
35702  */
35703 struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35704
35705 /**
35706  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
35707  */
35708 void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35709
35710 /**
35711  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
35712  */
35713 struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35714
35715 /**
35716  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
35717  */
35718 void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35719
35720 /**
35721  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
35722  */
35723 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35724
35725 /**
35726  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
35727  */
35728 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35729
35730 /**
35731  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
35732  * collaboratively close
35733  */
35734 struct LDKCOption_CVec_u8ZZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35735
35736 /**
35737  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
35738  * collaboratively close
35739  */
35740 void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
35741
35742 /**
35743  * The channel type that this channel will represent. If none is set, we derive the channel
35744  * type from the intersection of our feature bits with our counterparty's feature bits from
35745  * the Init message.
35746  *
35747  * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
35748  *
35749  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35750  */
35751 struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35752
35753 /**
35754  * The channel type that this channel will represent. If none is set, we derive the channel
35755  * type from the intersection of our feature bits with our counterparty's feature bits from
35756  * the Init message.
35757  *
35758  * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
35759  *
35760  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35761  */
35762 void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
35763
35764 /**
35765  * Optionally, a requirement that only confirmed inputs can be added
35766  */
35767 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35768
35769 /**
35770  * Optionally, a requirement that only confirmed inputs can be added
35771  */
35772 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
35773
35774 /**
35775  * Constructs a new AcceptChannelV2 given each field
35776  *
35777  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35778  */
35779 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);
35780
35781 /**
35782  * Creates a copy of the AcceptChannelV2
35783  */
35784 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
35785
35786 /**
35787  * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
35788  */
35789 uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
35790
35791 /**
35792  * Checks if two AcceptChannelV2s contain equal inner contents.
35793  * This ignores pointers and is_owned flags and looks at the values in fields.
35794  * Two objects with NULL inner values will be considered "equal" here.
35795  */
35796 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
35797
35798 /**
35799  * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
35800  */
35801 void FundingCreated_free(struct LDKFundingCreated this_obj);
35802
35803 /**
35804  * A temporary channel ID, until the funding is established
35805  */
35806 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
35807
35808 /**
35809  * A temporary channel ID, until the funding is established
35810  */
35811 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35812
35813 /**
35814  * The funding transaction ID
35815  */
35816 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
35817
35818 /**
35819  * The funding transaction ID
35820  */
35821 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35822
35823 /**
35824  * The specific output index funding this channel
35825  */
35826 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
35827
35828 /**
35829  * The specific output index funding this channel
35830  */
35831 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
35832
35833 /**
35834  * The signature of the channel initiator (funder) on the initial commitment transaction
35835  */
35836 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
35837
35838 /**
35839  * The signature of the channel initiator (funder) on the initial commitment transaction
35840  */
35841 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
35842
35843 /**
35844  * Constructs a new FundingCreated given each field
35845  */
35846 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);
35847
35848 /**
35849  * Creates a copy of the FundingCreated
35850  */
35851 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
35852
35853 /**
35854  * Generates a non-cryptographic 64-bit hash of the FundingCreated.
35855  */
35856 uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
35857
35858 /**
35859  * Checks if two FundingCreateds contain equal inner contents.
35860  * This ignores pointers and is_owned flags and looks at the values in fields.
35861  * Two objects with NULL inner values will be considered "equal" here.
35862  */
35863 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
35864
35865 /**
35866  * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
35867  */
35868 void FundingSigned_free(struct LDKFundingSigned this_obj);
35869
35870 /**
35871  * The channel ID
35872  */
35873 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
35874
35875 /**
35876  * The channel ID
35877  */
35878 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35879
35880 /**
35881  * The signature of the channel acceptor (fundee) on the initial commitment transaction
35882  */
35883 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
35884
35885 /**
35886  * The signature of the channel acceptor (fundee) on the initial commitment transaction
35887  */
35888 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
35889
35890 /**
35891  * Constructs a new FundingSigned given each field
35892  */
35893 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg);
35894
35895 /**
35896  * Creates a copy of the FundingSigned
35897  */
35898 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
35899
35900 /**
35901  * Generates a non-cryptographic 64-bit hash of the FundingSigned.
35902  */
35903 uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
35904
35905 /**
35906  * Checks if two FundingSigneds contain equal inner contents.
35907  * This ignores pointers and is_owned flags and looks at the values in fields.
35908  * Two objects with NULL inner values will be considered "equal" here.
35909  */
35910 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
35911
35912 /**
35913  * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
35914  */
35915 void ChannelReady_free(struct LDKChannelReady this_obj);
35916
35917 /**
35918  * The channel ID
35919  */
35920 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
35921
35922 /**
35923  * The channel ID
35924  */
35925 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35926
35927 /**
35928  * The per-commitment point of the second commitment transaction
35929  */
35930 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
35931
35932 /**
35933  * The per-commitment point of the second commitment transaction
35934  */
35935 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35936
35937 /**
35938  * If set, provides a `short_channel_id` alias for this channel.
35939  *
35940  * The sender will accept payments to be forwarded over this SCID and forward them to this
35941  * messages' recipient.
35942  */
35943 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
35944
35945 /**
35946  * If set, provides a `short_channel_id` alias for this channel.
35947  *
35948  * The sender will accept payments to be forwarded over this SCID and forward them to this
35949  * messages' recipient.
35950  */
35951 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
35952
35953 /**
35954  * Constructs a new ChannelReady given each field
35955  */
35956 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);
35957
35958 /**
35959  * Creates a copy of the ChannelReady
35960  */
35961 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
35962
35963 /**
35964  * Generates a non-cryptographic 64-bit hash of the ChannelReady.
35965  */
35966 uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
35967
35968 /**
35969  * Checks if two ChannelReadys contain equal inner contents.
35970  * This ignores pointers and is_owned flags and looks at the values in fields.
35971  * Two objects with NULL inner values will be considered "equal" here.
35972  */
35973 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
35974
35975 /**
35976  * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
35977  */
35978 void Stfu_free(struct LDKStfu this_obj);
35979
35980 /**
35981  * The channel ID where quiescence is intended
35982  */
35983 const uint8_t (*Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr))[32];
35984
35985 /**
35986  * The channel ID where quiescence is intended
35987  */
35988 void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35989
35990 /**
35991  * Initiator flag, 1 if initiating, 0 if replying to an stfu.
35992  */
35993 uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
35994
35995 /**
35996  * Initiator flag, 1 if initiating, 0 if replying to an stfu.
35997  */
35998 void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
35999
36000 /**
36001  * Constructs a new Stfu given each field
36002  */
36003 MUST_USE_RES struct LDKStfu Stfu_new(struct LDKThirtyTwoBytes channel_id_arg, uint8_t initiator_arg);
36004
36005 /**
36006  * Creates a copy of the Stfu
36007  */
36008 struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
36009
36010 /**
36011  * Checks if two Stfus contain equal inner contents.
36012  * This ignores pointers and is_owned flags and looks at the values in fields.
36013  * Two objects with NULL inner values will be considered "equal" here.
36014  */
36015 bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
36016
36017 /**
36018  * Frees any resources used by the Splice, if is_owned is set and inner is non-NULL.
36019  */
36020 void Splice_free(struct LDKSplice this_obj);
36021
36022 /**
36023  * The channel ID where splicing is intended
36024  */
36025 const uint8_t (*Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
36026
36027 /**
36028  * The channel ID where splicing is intended
36029  */
36030 void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36031
36032 /**
36033  * The genesis hash of the blockchain where the channel is intended to be spliced
36034  */
36035 const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
36036
36037 /**
36038  * The genesis hash of the blockchain where the channel is intended to be spliced
36039  */
36040 void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36041
36042 /**
36043  * The intended change in channel capacity: the amount to be added (positive value)
36044  * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
36045  */
36046 int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr);
36047
36048 /**
36049  * The intended change in channel capacity: the amount to be added (positive value)
36050  * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
36051  */
36052 void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val);
36053
36054 /**
36055  * The feerate for the new funding transaction, set by the splice initiator
36056  */
36057 uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr);
36058
36059 /**
36060  * The feerate for the new funding transaction, set by the splice initiator
36061  */
36062 void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
36063
36064 /**
36065  * The locktime for the new funding transaction
36066  */
36067 uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr);
36068
36069 /**
36070  * The locktime for the new funding transaction
36071  */
36072 void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
36073
36074 /**
36075  * The key of the sender (splice initiator) controlling the new funding transaction
36076  */
36077 struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr);
36078
36079 /**
36080  * The key of the sender (splice initiator) controlling the new funding transaction
36081  */
36082 void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36083
36084 /**
36085  * Constructs a new Splice given each field
36086  */
36087 MUST_USE_RES struct LDKSplice Splice_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg);
36088
36089 /**
36090  * Creates a copy of the Splice
36091  */
36092 struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig);
36093
36094 /**
36095  * Checks if two Splices contain equal inner contents.
36096  * This ignores pointers and is_owned flags and looks at the values in fields.
36097  * Two objects with NULL inner values will be considered "equal" here.
36098  */
36099 bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b);
36100
36101 /**
36102  * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
36103  */
36104 void SpliceAck_free(struct LDKSpliceAck this_obj);
36105
36106 /**
36107  * The channel ID where splicing is intended
36108  */
36109 const uint8_t (*SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
36110
36111 /**
36112  * The channel ID where splicing is intended
36113  */
36114 void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36115
36116 /**
36117  * The genesis hash of the blockchain where the channel is intended to be spliced
36118  */
36119 const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
36120
36121 /**
36122  * The genesis hash of the blockchain where the channel is intended to be spliced
36123  */
36124 void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36125
36126 /**
36127  * The intended change in channel capacity: the amount to be added (positive value)
36128  * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
36129  */
36130 int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
36131
36132 /**
36133  * The intended change in channel capacity: the amount to be added (positive value)
36134  * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
36135  */
36136 void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
36137
36138 /**
36139  * The key of the sender (splice acceptor) controlling the new funding transaction
36140  */
36141 struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
36142
36143 /**
36144  * The key of the sender (splice acceptor) controlling the new funding transaction
36145  */
36146 void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36147
36148 /**
36149  * Constructs a new SpliceAck given each field
36150  */
36151 MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, struct LDKPublicKey funding_pubkey_arg);
36152
36153 /**
36154  * Creates a copy of the SpliceAck
36155  */
36156 struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
36157
36158 /**
36159  * Checks if two SpliceAcks contain equal inner contents.
36160  * This ignores pointers and is_owned flags and looks at the values in fields.
36161  * Two objects with NULL inner values will be considered "equal" here.
36162  */
36163 bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
36164
36165 /**
36166  * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
36167  */
36168 void SpliceLocked_free(struct LDKSpliceLocked this_obj);
36169
36170 /**
36171  * The channel ID
36172  */
36173 const uint8_t (*SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr))[32];
36174
36175 /**
36176  * The channel ID
36177  */
36178 void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36179
36180 /**
36181  * Constructs a new SpliceLocked given each field
36182  */
36183 MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKThirtyTwoBytes channel_id_arg);
36184
36185 /**
36186  * Creates a copy of the SpliceLocked
36187  */
36188 struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
36189
36190 /**
36191  * Checks if two SpliceLockeds contain equal inner contents.
36192  * This ignores pointers and is_owned flags and looks at the values in fields.
36193  * Two objects with NULL inner values will be considered "equal" here.
36194  */
36195 bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
36196
36197 /**
36198  * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
36199  */
36200 void TxAddInput_free(struct LDKTxAddInput this_obj);
36201
36202 /**
36203  * The channel ID
36204  */
36205 const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32];
36206
36207 /**
36208  * The channel ID
36209  */
36210 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36211
36212 /**
36213  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
36214  * non-initiators.
36215  */
36216 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
36217
36218 /**
36219  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
36220  * non-initiators.
36221  */
36222 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
36223
36224 /**
36225  * Serialized transaction that contains the output this input spends to verify that it is non
36226  * malleable.
36227  */
36228 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
36229
36230 /**
36231  * Serialized transaction that contains the output this input spends to verify that it is non
36232  * malleable.
36233  */
36234 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
36235
36236 /**
36237  * The index of the output being spent
36238  */
36239 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
36240
36241 /**
36242  * The index of the output being spent
36243  */
36244 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
36245
36246 /**
36247  * The sequence number of this input
36248  */
36249 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
36250
36251 /**
36252  * The sequence number of this input
36253  */
36254 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
36255
36256 /**
36257  * Constructs a new TxAddInput given each field
36258  */
36259 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);
36260
36261 /**
36262  * Creates a copy of the TxAddInput
36263  */
36264 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
36265
36266 /**
36267  * Generates a non-cryptographic 64-bit hash of the TxAddInput.
36268  */
36269 uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
36270
36271 /**
36272  * Checks if two TxAddInputs contain equal inner contents.
36273  * This ignores pointers and is_owned flags and looks at the values in fields.
36274  * Two objects with NULL inner values will be considered "equal" here.
36275  */
36276 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
36277
36278 /**
36279  * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
36280  */
36281 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
36282
36283 /**
36284  * The channel ID
36285  */
36286 const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32];
36287
36288 /**
36289  * The channel ID
36290  */
36291 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36292
36293 /**
36294  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
36295  * non-initiators.
36296  */
36297 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
36298
36299 /**
36300  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
36301  * non-initiators.
36302  */
36303 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
36304
36305 /**
36306  * The satoshi value of the output
36307  */
36308 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
36309
36310 /**
36311  * The satoshi value of the output
36312  */
36313 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
36314
36315 /**
36316  * The scriptPubKey for the output
36317  */
36318 struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
36319
36320 /**
36321  * The scriptPubKey for the output
36322  */
36323 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36324
36325 /**
36326  * Constructs a new TxAddOutput given each field
36327  */
36328 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);
36329
36330 /**
36331  * Creates a copy of the TxAddOutput
36332  */
36333 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
36334
36335 /**
36336  * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
36337  */
36338 uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
36339
36340 /**
36341  * Checks if two TxAddOutputs contain equal inner contents.
36342  * This ignores pointers and is_owned flags and looks at the values in fields.
36343  * Two objects with NULL inner values will be considered "equal" here.
36344  */
36345 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
36346
36347 /**
36348  * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
36349  */
36350 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
36351
36352 /**
36353  * The channel ID
36354  */
36355 const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32];
36356
36357 /**
36358  * The channel ID
36359  */
36360 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36361
36362 /**
36363  * The serial ID of the input to be removed
36364  */
36365 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
36366
36367 /**
36368  * The serial ID of the input to be removed
36369  */
36370 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
36371
36372 /**
36373  * Constructs a new TxRemoveInput given each field
36374  */
36375 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
36376
36377 /**
36378  * Creates a copy of the TxRemoveInput
36379  */
36380 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
36381
36382 /**
36383  * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
36384  */
36385 uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
36386
36387 /**
36388  * Checks if two TxRemoveInputs contain equal inner contents.
36389  * This ignores pointers and is_owned flags and looks at the values in fields.
36390  * Two objects with NULL inner values will be considered "equal" here.
36391  */
36392 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
36393
36394 /**
36395  * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
36396  */
36397 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
36398
36399 /**
36400  * The channel ID
36401  */
36402 const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32];
36403
36404 /**
36405  * The channel ID
36406  */
36407 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36408
36409 /**
36410  * The serial ID of the output to be removed
36411  */
36412 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
36413
36414 /**
36415  * The serial ID of the output to be removed
36416  */
36417 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
36418
36419 /**
36420  * Constructs a new TxRemoveOutput given each field
36421  */
36422 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
36423
36424 /**
36425  * Creates a copy of the TxRemoveOutput
36426  */
36427 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
36428
36429 /**
36430  * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
36431  */
36432 uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
36433
36434 /**
36435  * Checks if two TxRemoveOutputs contain equal inner contents.
36436  * This ignores pointers and is_owned flags and looks at the values in fields.
36437  * Two objects with NULL inner values will be considered "equal" here.
36438  */
36439 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
36440
36441 /**
36442  * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
36443  */
36444 void TxComplete_free(struct LDKTxComplete this_obj);
36445
36446 /**
36447  * The channel ID
36448  */
36449 const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32];
36450
36451 /**
36452  * The channel ID
36453  */
36454 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36455
36456 /**
36457  * Constructs a new TxComplete given each field
36458  */
36459 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg);
36460
36461 /**
36462  * Creates a copy of the TxComplete
36463  */
36464 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
36465
36466 /**
36467  * Generates a non-cryptographic 64-bit hash of the TxComplete.
36468  */
36469 uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
36470
36471 /**
36472  * Checks if two TxCompletes contain equal inner contents.
36473  * This ignores pointers and is_owned flags and looks at the values in fields.
36474  * Two objects with NULL inner values will be considered "equal" here.
36475  */
36476 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
36477
36478 /**
36479  * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
36480  */
36481 void TxSignatures_free(struct LDKTxSignatures this_obj);
36482
36483 /**
36484  * The channel ID
36485  */
36486 const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
36487
36488 /**
36489  * The channel ID
36490  */
36491 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36492
36493 /**
36494  * The TXID
36495  */
36496 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
36497
36498 /**
36499  * The TXID
36500  */
36501 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36502
36503 /**
36504  * The list of witnesses
36505  *
36506  * Returns a copy of the field.
36507  */
36508 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
36509
36510 /**
36511  * The list of witnesses
36512  */
36513 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
36514
36515 /**
36516  * Constructs a new TxSignatures given each field
36517  */
36518 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg);
36519
36520 /**
36521  * Creates a copy of the TxSignatures
36522  */
36523 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
36524
36525 /**
36526  * Generates a non-cryptographic 64-bit hash of the TxSignatures.
36527  */
36528 uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
36529
36530 /**
36531  * Checks if two TxSignaturess contain equal inner contents.
36532  * This ignores pointers and is_owned flags and looks at the values in fields.
36533  * Two objects with NULL inner values will be considered "equal" here.
36534  */
36535 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
36536
36537 /**
36538  * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
36539  */
36540 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
36541
36542 /**
36543  * The channel ID
36544  */
36545 const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32];
36546
36547 /**
36548  * The channel ID
36549  */
36550 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36551
36552 /**
36553  * The locktime of the transaction
36554  */
36555 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
36556
36557 /**
36558  * The locktime of the transaction
36559  */
36560 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
36561
36562 /**
36563  * The feerate of the transaction
36564  */
36565 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
36566
36567 /**
36568  * The feerate of the transaction
36569  */
36570 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
36571
36572 /**
36573  * The number of satoshis the sender will contribute to or, if negative, remove from
36574  * (e.g. splice-out) the funding output of the transaction
36575  */
36576 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
36577
36578 /**
36579  * The number of satoshis the sender will contribute to or, if negative, remove from
36580  * (e.g. splice-out) the funding output of the transaction
36581  */
36582 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
36583
36584 /**
36585  * Constructs a new TxInitRbf given each field
36586  */
36587 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);
36588
36589 /**
36590  * Creates a copy of the TxInitRbf
36591  */
36592 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
36593
36594 /**
36595  * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
36596  */
36597 uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
36598
36599 /**
36600  * Checks if two TxInitRbfs contain equal inner contents.
36601  * This ignores pointers and is_owned flags and looks at the values in fields.
36602  * Two objects with NULL inner values will be considered "equal" here.
36603  */
36604 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
36605
36606 /**
36607  * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
36608  */
36609 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
36610
36611 /**
36612  * The channel ID
36613  */
36614 const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32];
36615
36616 /**
36617  * The channel ID
36618  */
36619 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36620
36621 /**
36622  * The number of satoshis the sender will contribute to or, if negative, remove from
36623  * (e.g. splice-out) the funding output of the transaction
36624  */
36625 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
36626
36627 /**
36628  * The number of satoshis the sender will contribute to or, if negative, remove from
36629  * (e.g. splice-out) the funding output of the transaction
36630  */
36631 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
36632
36633 /**
36634  * Constructs a new TxAckRbf given each field
36635  */
36636 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
36637
36638 /**
36639  * Creates a copy of the TxAckRbf
36640  */
36641 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
36642
36643 /**
36644  * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
36645  */
36646 uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
36647
36648 /**
36649  * Checks if two TxAckRbfs contain equal inner contents.
36650  * This ignores pointers and is_owned flags and looks at the values in fields.
36651  * Two objects with NULL inner values will be considered "equal" here.
36652  */
36653 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
36654
36655 /**
36656  * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
36657  */
36658 void TxAbort_free(struct LDKTxAbort this_obj);
36659
36660 /**
36661  * The channel ID
36662  */
36663 const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32];
36664
36665 /**
36666  * The channel ID
36667  */
36668 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36669
36670 /**
36671  * Message data
36672  *
36673  * Returns a copy of the field.
36674  */
36675 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
36676
36677 /**
36678  * Message data
36679  */
36680 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36681
36682 /**
36683  * Constructs a new TxAbort given each field
36684  */
36685 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
36686
36687 /**
36688  * Creates a copy of the TxAbort
36689  */
36690 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
36691
36692 /**
36693  * Generates a non-cryptographic 64-bit hash of the TxAbort.
36694  */
36695 uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
36696
36697 /**
36698  * Checks if two TxAborts contain equal inner contents.
36699  * This ignores pointers and is_owned flags and looks at the values in fields.
36700  * Two objects with NULL inner values will be considered "equal" here.
36701  */
36702 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
36703
36704 /**
36705  * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
36706  */
36707 void Shutdown_free(struct LDKShutdown this_obj);
36708
36709 /**
36710  * The channel ID
36711  */
36712 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
36713
36714 /**
36715  * The channel ID
36716  */
36717 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36718
36719 /**
36720  * The destination of this peer's funds on closing.
36721  *
36722  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
36723  */
36724 struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
36725
36726 /**
36727  * The destination of this peer's funds on closing.
36728  *
36729  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
36730  */
36731 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36732
36733 /**
36734  * Constructs a new Shutdown given each field
36735  */
36736 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
36737
36738 /**
36739  * Creates a copy of the Shutdown
36740  */
36741 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
36742
36743 /**
36744  * Generates a non-cryptographic 64-bit hash of the Shutdown.
36745  */
36746 uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
36747
36748 /**
36749  * Checks if two Shutdowns contain equal inner contents.
36750  * This ignores pointers and is_owned flags and looks at the values in fields.
36751  * Two objects with NULL inner values will be considered "equal" here.
36752  */
36753 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
36754
36755 /**
36756  * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
36757  */
36758 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
36759
36760 /**
36761  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
36762  * transaction.
36763  */
36764 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
36765
36766 /**
36767  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
36768  * transaction.
36769  */
36770 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
36771
36772 /**
36773  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
36774  * transaction.
36775  */
36776 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
36777
36778 /**
36779  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
36780  * transaction.
36781  */
36782 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
36783
36784 /**
36785  * Constructs a new ClosingSignedFeeRange given each field
36786  */
36787 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
36788
36789 /**
36790  * Creates a copy of the ClosingSignedFeeRange
36791  */
36792 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
36793
36794 /**
36795  * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
36796  */
36797 uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
36798
36799 /**
36800  * Checks if two ClosingSignedFeeRanges contain equal inner contents.
36801  * This ignores pointers and is_owned flags and looks at the values in fields.
36802  * Two objects with NULL inner values will be considered "equal" here.
36803  */
36804 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
36805
36806 /**
36807  * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
36808  */
36809 void ClosingSigned_free(struct LDKClosingSigned this_obj);
36810
36811 /**
36812  * The channel ID
36813  */
36814 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
36815
36816 /**
36817  * The channel ID
36818  */
36819 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36820
36821 /**
36822  * The proposed total fee for the closing transaction
36823  */
36824 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
36825
36826 /**
36827  * The proposed total fee for the closing transaction
36828  */
36829 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
36830
36831 /**
36832  * A signature on the closing transaction
36833  */
36834 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
36835
36836 /**
36837  * A signature on the closing transaction
36838  */
36839 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
36840
36841 /**
36842  * The minimum and maximum fees which the sender is willing to accept, provided only by new
36843  * nodes.
36844  *
36845  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36846  */
36847 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
36848
36849 /**
36850  * The minimum and maximum fees which the sender is willing to accept, provided only by new
36851  * nodes.
36852  *
36853  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36854  */
36855 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
36856
36857 /**
36858  * Constructs a new ClosingSigned given each field
36859  *
36860  * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36861  */
36862 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);
36863
36864 /**
36865  * Creates a copy of the ClosingSigned
36866  */
36867 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
36868
36869 /**
36870  * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
36871  */
36872 uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
36873
36874 /**
36875  * Checks if two ClosingSigneds contain equal inner contents.
36876  * This ignores pointers and is_owned flags and looks at the values in fields.
36877  * Two objects with NULL inner values will be considered "equal" here.
36878  */
36879 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
36880
36881 /**
36882  * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
36883  */
36884 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
36885
36886 /**
36887  * The channel ID
36888  */
36889 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
36890
36891 /**
36892  * The channel ID
36893  */
36894 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36895
36896 /**
36897  * The HTLC ID
36898  */
36899 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36900
36901 /**
36902  * The HTLC ID
36903  */
36904 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
36905
36906 /**
36907  * The HTLC value in milli-satoshi
36908  */
36909 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36910
36911 /**
36912  * The HTLC value in milli-satoshi
36913  */
36914 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
36915
36916 /**
36917  * The payment hash, the pre-image of which controls HTLC redemption
36918  */
36919 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
36920
36921 /**
36922  * The payment hash, the pre-image of which controls HTLC redemption
36923  */
36924 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36925
36926 /**
36927  * The expiry height of the HTLC
36928  */
36929 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36930
36931 /**
36932  * The expiry height of the HTLC
36933  */
36934 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
36935
36936 /**
36937  * The extra fee skimmed by the sender of this message. See
36938  * [`ChannelConfig::accept_underpaying_htlcs`].
36939  *
36940  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
36941  */
36942 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36943
36944 /**
36945  * The extra fee skimmed by the sender of this message. See
36946  * [`ChannelConfig::accept_underpaying_htlcs`].
36947  *
36948  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
36949  */
36950 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36951
36952 /**
36953  * The onion routing packet with encrypted data for the next hop.
36954  */
36955 struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36956
36957 /**
36958  * The onion routing packet with encrypted data for the next hop.
36959  */
36960 void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
36961
36962 /**
36963  * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
36964  * routing packet and the recipient-provided encrypted payload within.
36965  *
36966  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36967  */
36968 struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36969
36970 /**
36971  * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
36972  * routing packet and the recipient-provided encrypted payload within.
36973  *
36974  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36975  */
36976 void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36977
36978 /**
36979  * Constructs a new UpdateAddHTLC given each field
36980  *
36981  * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36982  */
36983 MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg);
36984
36985 /**
36986  * Creates a copy of the UpdateAddHTLC
36987  */
36988 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
36989
36990 /**
36991  * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
36992  */
36993 uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
36994
36995 /**
36996  * Checks if two UpdateAddHTLCs contain equal inner contents.
36997  * This ignores pointers and is_owned flags and looks at the values in fields.
36998  * Two objects with NULL inner values will be considered "equal" here.
36999  */
37000 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
37001
37002 /**
37003  * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
37004  */
37005 void OnionMessage_free(struct LDKOnionMessage this_obj);
37006
37007 /**
37008  * Used in decrypting the onion packet's payload.
37009  */
37010 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
37011
37012 /**
37013  * Used in decrypting the onion packet's payload.
37014  */
37015 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
37016
37017 /**
37018  * The full onion packet including hop data, pubkey, and hmac
37019  */
37020 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
37021
37022 /**
37023  * The full onion packet including hop data, pubkey, and hmac
37024  */
37025 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
37026
37027 /**
37028  * Constructs a new OnionMessage given each field
37029  */
37030 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
37031
37032 /**
37033  * Creates a copy of the OnionMessage
37034  */
37035 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
37036
37037 /**
37038  * Generates a non-cryptographic 64-bit hash of the OnionMessage.
37039  */
37040 uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
37041
37042 /**
37043  * Checks if two OnionMessages contain equal inner contents.
37044  * This ignores pointers and is_owned flags and looks at the values in fields.
37045  * Two objects with NULL inner values will be considered "equal" here.
37046  */
37047 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
37048
37049 /**
37050  * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
37051  */
37052 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
37053
37054 /**
37055  * The channel ID
37056  */
37057 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
37058
37059 /**
37060  * The channel ID
37061  */
37062 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37063
37064 /**
37065  * The HTLC ID
37066  */
37067 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
37068
37069 /**
37070  * The HTLC ID
37071  */
37072 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
37073
37074 /**
37075  * The pre-image of the payment hash, allowing HTLC redemption
37076  */
37077 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
37078
37079 /**
37080  * The pre-image of the payment hash, allowing HTLC redemption
37081  */
37082 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37083
37084 /**
37085  * Constructs a new UpdateFulfillHTLC given each field
37086  */
37087 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
37088
37089 /**
37090  * Creates a copy of the UpdateFulfillHTLC
37091  */
37092 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
37093
37094 /**
37095  * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
37096  */
37097 uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
37098
37099 /**
37100  * Checks if two UpdateFulfillHTLCs contain equal inner contents.
37101  * This ignores pointers and is_owned flags and looks at the values in fields.
37102  * Two objects with NULL inner values will be considered "equal" here.
37103  */
37104 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
37105
37106 /**
37107  * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
37108  */
37109 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
37110
37111 /**
37112  * The channel ID
37113  */
37114 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
37115
37116 /**
37117  * The channel ID
37118  */
37119 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37120
37121 /**
37122  * The HTLC ID
37123  */
37124 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
37125
37126 /**
37127  * The HTLC ID
37128  */
37129 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
37130
37131 /**
37132  * Creates a copy of the UpdateFailHTLC
37133  */
37134 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
37135
37136 /**
37137  * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
37138  */
37139 uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
37140
37141 /**
37142  * Checks if two UpdateFailHTLCs contain equal inner contents.
37143  * This ignores pointers and is_owned flags and looks at the values in fields.
37144  * Two objects with NULL inner values will be considered "equal" here.
37145  */
37146 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
37147
37148 /**
37149  * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
37150  */
37151 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
37152
37153 /**
37154  * The channel ID
37155  */
37156 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
37157
37158 /**
37159  * The channel ID
37160  */
37161 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37162
37163 /**
37164  * The HTLC ID
37165  */
37166 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
37167
37168 /**
37169  * The HTLC ID
37170  */
37171 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
37172
37173 /**
37174  * The failure code
37175  */
37176 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
37177
37178 /**
37179  * The failure code
37180  */
37181 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
37182
37183 /**
37184  * Creates a copy of the UpdateFailMalformedHTLC
37185  */
37186 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
37187
37188 /**
37189  * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
37190  */
37191 uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
37192
37193 /**
37194  * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
37195  * This ignores pointers and is_owned flags and looks at the values in fields.
37196  * Two objects with NULL inner values will be considered "equal" here.
37197  */
37198 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
37199
37200 /**
37201  * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
37202  */
37203 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
37204
37205 /**
37206  * The channel ID
37207  */
37208 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
37209
37210 /**
37211  * The channel ID
37212  */
37213 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37214
37215 /**
37216  * A signature on the commitment transaction
37217  */
37218 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
37219
37220 /**
37221  * A signature on the commitment transaction
37222  */
37223 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37224
37225 /**
37226  * Signatures on the HTLC transactions
37227  *
37228  * Returns a copy of the field.
37229  */
37230 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
37231
37232 /**
37233  * Signatures on the HTLC transactions
37234  */
37235 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
37236
37237 /**
37238  * Constructs a new CommitmentSigned given each field
37239  */
37240 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
37241
37242 /**
37243  * Creates a copy of the CommitmentSigned
37244  */
37245 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
37246
37247 /**
37248  * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
37249  */
37250 uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
37251
37252 /**
37253  * Checks if two CommitmentSigneds contain equal inner contents.
37254  * This ignores pointers and is_owned flags and looks at the values in fields.
37255  * Two objects with NULL inner values will be considered "equal" here.
37256  */
37257 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
37258
37259 /**
37260  * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
37261  */
37262 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
37263
37264 /**
37265  * The channel ID
37266  */
37267 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
37268
37269 /**
37270  * The channel ID
37271  */
37272 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37273
37274 /**
37275  * The secret corresponding to the per-commitment point
37276  */
37277 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
37278
37279 /**
37280  * The secret corresponding to the per-commitment point
37281  */
37282 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37283
37284 /**
37285  * The next sender-broadcast commitment transaction's per-commitment point
37286  */
37287 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
37288
37289 /**
37290  * The next sender-broadcast commitment transaction's per-commitment point
37291  */
37292 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
37293
37294 /**
37295  * Constructs a new RevokeAndACK given each field
37296  */
37297 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);
37298
37299 /**
37300  * Creates a copy of the RevokeAndACK
37301  */
37302 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
37303
37304 /**
37305  * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
37306  */
37307 uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
37308
37309 /**
37310  * Checks if two RevokeAndACKs contain equal inner contents.
37311  * This ignores pointers and is_owned flags and looks at the values in fields.
37312  * Two objects with NULL inner values will be considered "equal" here.
37313  */
37314 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
37315
37316 /**
37317  * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
37318  */
37319 void UpdateFee_free(struct LDKUpdateFee this_obj);
37320
37321 /**
37322  * The channel ID
37323  */
37324 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
37325
37326 /**
37327  * The channel ID
37328  */
37329 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37330
37331 /**
37332  * Fee rate per 1000-weight of the transaction
37333  */
37334 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
37335
37336 /**
37337  * Fee rate per 1000-weight of the transaction
37338  */
37339 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
37340
37341 /**
37342  * Constructs a new UpdateFee given each field
37343  */
37344 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
37345
37346 /**
37347  * Creates a copy of the UpdateFee
37348  */
37349 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
37350
37351 /**
37352  * Generates a non-cryptographic 64-bit hash of the UpdateFee.
37353  */
37354 uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
37355
37356 /**
37357  * Checks if two UpdateFees contain equal inner contents.
37358  * This ignores pointers and is_owned flags and looks at the values in fields.
37359  * Two objects with NULL inner values will be considered "equal" here.
37360  */
37361 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
37362
37363 /**
37364  * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
37365  */
37366 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
37367
37368 /**
37369  * The channel ID
37370  */
37371 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
37372
37373 /**
37374  * The channel ID
37375  */
37376 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37377
37378 /**
37379  * The next commitment number for the sender
37380  */
37381 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
37382
37383 /**
37384  * The next commitment number for the sender
37385  */
37386 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
37387
37388 /**
37389  * The next commitment number for the recipient
37390  */
37391 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
37392
37393 /**
37394  * The next commitment number for the recipient
37395  */
37396 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
37397
37398 /**
37399  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
37400  * belonging to the recipient
37401  */
37402 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
37403
37404 /**
37405  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
37406  * belonging to the recipient
37407  */
37408 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37409
37410 /**
37411  * The sender's per-commitment point for their current commitment transaction
37412  */
37413 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
37414
37415 /**
37416  * The sender's per-commitment point for their current commitment transaction
37417  */
37418 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
37419
37420 /**
37421  * The next funding transaction ID
37422  */
37423 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
37424
37425 /**
37426  * The next funding transaction ID
37427  */
37428 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
37429
37430 /**
37431  * Constructs a new ChannelReestablish given each field
37432  */
37433 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);
37434
37435 /**
37436  * Creates a copy of the ChannelReestablish
37437  */
37438 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
37439
37440 /**
37441  * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
37442  */
37443 uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
37444
37445 /**
37446  * Checks if two ChannelReestablishs contain equal inner contents.
37447  * This ignores pointers and is_owned flags and looks at the values in fields.
37448  * Two objects with NULL inner values will be considered "equal" here.
37449  */
37450 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
37451
37452 /**
37453  * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
37454  */
37455 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
37456
37457 /**
37458  * The channel ID
37459  */
37460 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
37461
37462 /**
37463  * The channel ID
37464  */
37465 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37466
37467 /**
37468  * The short channel ID
37469  */
37470 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
37471
37472 /**
37473  * The short channel ID
37474  */
37475 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
37476
37477 /**
37478  * A signature by the node key
37479  */
37480 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
37481
37482 /**
37483  * A signature by the node key
37484  */
37485 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37486
37487 /**
37488  * A signature by the funding key
37489  */
37490 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
37491
37492 /**
37493  * A signature by the funding key
37494  */
37495 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37496
37497 /**
37498  * Constructs a new AnnouncementSignatures given each field
37499  */
37500 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);
37501
37502 /**
37503  * Creates a copy of the AnnouncementSignatures
37504  */
37505 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
37506
37507 /**
37508  * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
37509  */
37510 uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
37511
37512 /**
37513  * Checks if two AnnouncementSignaturess contain equal inner contents.
37514  * This ignores pointers and is_owned flags and looks at the values in fields.
37515  * Two objects with NULL inner values will be considered "equal" here.
37516  */
37517 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
37518
37519 /**
37520  * Frees any resources used by the SocketAddress
37521  */
37522 void SocketAddress_free(struct LDKSocketAddress this_ptr);
37523
37524 /**
37525  * Creates a copy of the SocketAddress
37526  */
37527 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
37528
37529 /**
37530  * Utility method to constructs a new TcpIpV4-variant SocketAddress
37531  */
37532 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
37533
37534 /**
37535  * Utility method to constructs a new TcpIpV6-variant SocketAddress
37536  */
37537 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
37538
37539 /**
37540  * Utility method to constructs a new OnionV2-variant SocketAddress
37541  */
37542 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
37543
37544 /**
37545  * Utility method to constructs a new OnionV3-variant SocketAddress
37546  */
37547 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
37548
37549 /**
37550  * Utility method to constructs a new Hostname-variant SocketAddress
37551  */
37552 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
37553
37554 /**
37555  * Generates a non-cryptographic 64-bit hash of the SocketAddress.
37556  */
37557 uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
37558
37559 /**
37560  * Checks if two SocketAddresss contain equal inner contents.
37561  * This ignores pointers and is_owned flags and looks at the values in fields.
37562  */
37563 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
37564
37565 /**
37566  * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
37567  */
37568 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
37569
37570 /**
37571  * Read a SocketAddress from a byte array, created by SocketAddress_write
37572  */
37573 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
37574
37575 /**
37576  * Creates a copy of the SocketAddressParseError
37577  */
37578 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
37579
37580 /**
37581  * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
37582  */
37583 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
37584
37585 /**
37586  * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
37587  */
37588 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
37589
37590 /**
37591  * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
37592  */
37593 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
37594
37595 /**
37596  * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
37597  */
37598 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
37599
37600 /**
37601  * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
37602  */
37603 uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
37604
37605 /**
37606  * Checks if two SocketAddressParseErrors contain equal inner contents.
37607  * This ignores pointers and is_owned flags and looks at the values in fields.
37608  */
37609 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
37610
37611 /**
37612  * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
37613  *
37614  * The host part must end with \".onion\".
37615  */
37616 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
37617
37618 /**
37619  * Get the string representation of a SocketAddress object
37620  */
37621 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
37622
37623 /**
37624  * Read a SocketAddress object from a string
37625  */
37626 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
37627
37628 /**
37629  * Frees any resources used by the UnsignedGossipMessage
37630  */
37631 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
37632
37633 /**
37634  * Creates a copy of the UnsignedGossipMessage
37635  */
37636 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
37637
37638 /**
37639  * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
37640  */
37641 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
37642
37643 /**
37644  * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
37645  */
37646 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
37647
37648 /**
37649  * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
37650  */
37651 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
37652
37653 /**
37654  * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
37655  */
37656 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
37657
37658 /**
37659  * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
37660  */
37661 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
37662
37663 /**
37664  * The advertised features
37665  */
37666 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37667
37668 /**
37669  * The advertised features
37670  */
37671 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
37672
37673 /**
37674  * A strictly monotonic announcement counter, with gaps allowed
37675  */
37676 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37677
37678 /**
37679  * A strictly monotonic announcement counter, with gaps allowed
37680  */
37681 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
37682
37683 /**
37684  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
37685  * to this node).
37686  */
37687 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37688
37689 /**
37690  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
37691  * to this node).
37692  */
37693 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37694
37695 /**
37696  * An RGB color for UI purposes
37697  */
37698 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
37699
37700 /**
37701  * An RGB color for UI purposes
37702  */
37703 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
37704
37705 /**
37706  * An alias, for UI purposes.
37707  *
37708  * This should be sanitized before use. There is no guarantee of uniqueness.
37709  */
37710 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37711
37712 /**
37713  * An alias, for UI purposes.
37714  *
37715  * This should be sanitized before use. There is no guarantee of uniqueness.
37716  */
37717 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
37718
37719 /**
37720  * List of addresses on which this node is reachable
37721  *
37722  * Returns a copy of the field.
37723  */
37724 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37725
37726 /**
37727  * List of addresses on which this node is reachable
37728  */
37729 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
37730
37731 /**
37732  * Creates a copy of the UnsignedNodeAnnouncement
37733  */
37734 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
37735
37736 /**
37737  * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
37738  */
37739 uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
37740
37741 /**
37742  * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
37743  * This ignores pointers and is_owned flags and looks at the values in fields.
37744  * Two objects with NULL inner values will be considered "equal" here.
37745  */
37746 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
37747
37748 /**
37749  * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
37750  */
37751 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
37752
37753 /**
37754  * The signature by the node key
37755  */
37756 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
37757
37758 /**
37759  * The signature by the node key
37760  */
37761 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37762
37763 /**
37764  * The actual content of the announcement
37765  */
37766 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
37767
37768 /**
37769  * The actual content of the announcement
37770  */
37771 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
37772
37773 /**
37774  * Constructs a new NodeAnnouncement given each field
37775  */
37776 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
37777
37778 /**
37779  * Creates a copy of the NodeAnnouncement
37780  */
37781 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
37782
37783 /**
37784  * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
37785  */
37786 uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
37787
37788 /**
37789  * Checks if two NodeAnnouncements contain equal inner contents.
37790  * This ignores pointers and is_owned flags and looks at the values in fields.
37791  * Two objects with NULL inner values will be considered "equal" here.
37792  */
37793 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
37794
37795 /**
37796  * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
37797  */
37798 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
37799
37800 /**
37801  * The advertised channel features
37802  */
37803 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37804
37805 /**
37806  * The advertised channel features
37807  */
37808 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
37809
37810 /**
37811  * The genesis hash of the blockchain where the channel is to be opened
37812  */
37813 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
37814
37815 /**
37816  * The genesis hash of the blockchain where the channel is to be opened
37817  */
37818 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37819
37820 /**
37821  * The short channel ID
37822  */
37823 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37824
37825 /**
37826  * The short channel ID
37827  */
37828 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
37829
37830 /**
37831  * One of the two `node_id`s which are endpoints of this channel
37832  */
37833 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37834
37835 /**
37836  * One of the two `node_id`s which are endpoints of this channel
37837  */
37838 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37839
37840 /**
37841  * The other of the two `node_id`s which are endpoints of this channel
37842  */
37843 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37844
37845 /**
37846  * The other of the two `node_id`s which are endpoints of this channel
37847  */
37848 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37849
37850 /**
37851  * The funding key for the first node
37852  */
37853 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37854
37855 /**
37856  * The funding key for the first node
37857  */
37858 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37859
37860 /**
37861  * The funding key for the second node
37862  */
37863 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37864
37865 /**
37866  * The funding key for the second node
37867  */
37868 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37869
37870 /**
37871  * Excess data which was signed as a part of the message which we do not (yet) understand how
37872  * to decode.
37873  *
37874  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
37875  *
37876  * Returns a copy of the field.
37877  */
37878 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37879
37880 /**
37881  * Excess data which was signed as a part of the message which we do not (yet) understand how
37882  * to decode.
37883  *
37884  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
37885  */
37886 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
37887
37888 /**
37889  * Constructs a new UnsignedChannelAnnouncement given each field
37890  */
37891 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);
37892
37893 /**
37894  * Creates a copy of the UnsignedChannelAnnouncement
37895  */
37896 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
37897
37898 /**
37899  * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
37900  */
37901 uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
37902
37903 /**
37904  * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
37905  * This ignores pointers and is_owned flags and looks at the values in fields.
37906  * Two objects with NULL inner values will be considered "equal" here.
37907  */
37908 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
37909
37910 /**
37911  * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
37912  */
37913 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
37914
37915 /**
37916  * Authentication of the announcement by the first public node
37917  */
37918 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37919
37920 /**
37921  * Authentication of the announcement by the first public node
37922  */
37923 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37924
37925 /**
37926  * Authentication of the announcement by the second public node
37927  */
37928 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37929
37930 /**
37931  * Authentication of the announcement by the second public node
37932  */
37933 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37934
37935 /**
37936  * Proof of funding UTXO ownership by the first public node
37937  */
37938 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37939
37940 /**
37941  * Proof of funding UTXO ownership by the first public node
37942  */
37943 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37944
37945 /**
37946  * Proof of funding UTXO ownership by the second public node
37947  */
37948 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37949
37950 /**
37951  * Proof of funding UTXO ownership by the second public node
37952  */
37953 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37954
37955 /**
37956  * The actual announcement
37957  */
37958 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37959
37960 /**
37961  * The actual announcement
37962  */
37963 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
37964
37965 /**
37966  * Constructs a new ChannelAnnouncement given each field
37967  */
37968 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);
37969
37970 /**
37971  * Creates a copy of the ChannelAnnouncement
37972  */
37973 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
37974
37975 /**
37976  * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
37977  */
37978 uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
37979
37980 /**
37981  * Checks if two ChannelAnnouncements contain equal inner contents.
37982  * This ignores pointers and is_owned flags and looks at the values in fields.
37983  * Two objects with NULL inner values will be considered "equal" here.
37984  */
37985 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
37986
37987 /**
37988  * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
37989  */
37990 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
37991
37992 /**
37993  * The genesis hash of the blockchain where the channel is to be opened
37994  */
37995 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
37996
37997 /**
37998  * The genesis hash of the blockchain where the channel is to be opened
37999  */
38000 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38001
38002 /**
38003  * The short channel ID
38004  */
38005 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38006
38007 /**
38008  * The short channel ID
38009  */
38010 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
38011
38012 /**
38013  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
38014  */
38015 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38016
38017 /**
38018  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
38019  */
38020 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
38021
38022 /**
38023  * Channel flags
38024  */
38025 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38026
38027 /**
38028  * Channel flags
38029  */
38030 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
38031
38032 /**
38033  * The number of blocks such that if:
38034  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
38035  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
38036  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
38037  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
38038  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
38039  * forwarding. Note that the HTLC sender is the one who originally sets this value when
38040  * constructing the route.
38041  */
38042 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38043
38044 /**
38045  * The number of blocks such that if:
38046  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
38047  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
38048  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
38049  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
38050  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
38051  * forwarding. Note that the HTLC sender is the one who originally sets this value when
38052  * constructing the route.
38053  */
38054 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
38055
38056 /**
38057  * The minimum HTLC size incoming to sender, in milli-satoshi
38058  */
38059 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38060
38061 /**
38062  * The minimum HTLC size incoming to sender, in milli-satoshi
38063  */
38064 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
38065
38066 /**
38067  * The maximum HTLC value incoming to sender, in milli-satoshi.
38068  *
38069  * This used to be optional.
38070  */
38071 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38072
38073 /**
38074  * The maximum HTLC value incoming to sender, in milli-satoshi.
38075  *
38076  * This used to be optional.
38077  */
38078 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
38079
38080 /**
38081  * The base HTLC fee charged by sender, in milli-satoshi
38082  */
38083 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38084
38085 /**
38086  * The base HTLC fee charged by sender, in milli-satoshi
38087  */
38088 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
38089
38090 /**
38091  * The amount to fee multiplier, in micro-satoshi
38092  */
38093 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38094
38095 /**
38096  * The amount to fee multiplier, in micro-satoshi
38097  */
38098 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
38099
38100 /**
38101  * Excess data which was signed as a part of the message which we do not (yet) understand how
38102  * to decode.
38103  *
38104  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
38105  *
38106  * Returns a copy of the field.
38107  */
38108 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38109
38110 /**
38111  * Excess data which was signed as a part of the message which we do not (yet) understand how
38112  * to decode.
38113  *
38114  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
38115  */
38116 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
38117
38118 /**
38119  * Constructs a new UnsignedChannelUpdate given each field
38120  */
38121 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);
38122
38123 /**
38124  * Creates a copy of the UnsignedChannelUpdate
38125  */
38126 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
38127
38128 /**
38129  * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
38130  */
38131 uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
38132
38133 /**
38134  * Checks if two UnsignedChannelUpdates contain equal inner contents.
38135  * This ignores pointers and is_owned flags and looks at the values in fields.
38136  * Two objects with NULL inner values will be considered "equal" here.
38137  */
38138 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
38139
38140 /**
38141  * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
38142  */
38143 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
38144
38145 /**
38146  * A signature of the channel update
38147  */
38148 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
38149
38150 /**
38151  * A signature of the channel update
38152  */
38153 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
38154
38155 /**
38156  * The actual channel update
38157  */
38158 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
38159
38160 /**
38161  * The actual channel update
38162  */
38163 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
38164
38165 /**
38166  * Constructs a new ChannelUpdate given each field
38167  */
38168 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
38169
38170 /**
38171  * Creates a copy of the ChannelUpdate
38172  */
38173 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
38174
38175 /**
38176  * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
38177  */
38178 uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
38179
38180 /**
38181  * Checks if two ChannelUpdates contain equal inner contents.
38182  * This ignores pointers and is_owned flags and looks at the values in fields.
38183  * Two objects with NULL inner values will be considered "equal" here.
38184  */
38185 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
38186
38187 /**
38188  * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
38189  */
38190 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
38191
38192 /**
38193  * The genesis hash of the blockchain being queried
38194  */
38195 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
38196
38197 /**
38198  * The genesis hash of the blockchain being queried
38199  */
38200 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38201
38202 /**
38203  * The height of the first block for the channel UTXOs being queried
38204  */
38205 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
38206
38207 /**
38208  * The height of the first block for the channel UTXOs being queried
38209  */
38210 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
38211
38212 /**
38213  * The number of blocks to include in the query results
38214  */
38215 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
38216
38217 /**
38218  * The number of blocks to include in the query results
38219  */
38220 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
38221
38222 /**
38223  * Constructs a new QueryChannelRange given each field
38224  */
38225 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
38226
38227 /**
38228  * Creates a copy of the QueryChannelRange
38229  */
38230 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
38231
38232 /**
38233  * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
38234  */
38235 uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
38236
38237 /**
38238  * Checks if two QueryChannelRanges contain equal inner contents.
38239  * This ignores pointers and is_owned flags and looks at the values in fields.
38240  * Two objects with NULL inner values will be considered "equal" here.
38241  */
38242 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
38243
38244 /**
38245  * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
38246  */
38247 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
38248
38249 /**
38250  * The genesis hash of the blockchain being queried
38251  */
38252 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
38253
38254 /**
38255  * The genesis hash of the blockchain being queried
38256  */
38257 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38258
38259 /**
38260  * The height of the first block in the range of the reply
38261  */
38262 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
38263
38264 /**
38265  * The height of the first block in the range of the reply
38266  */
38267 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
38268
38269 /**
38270  * The number of blocks included in the range of the reply
38271  */
38272 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
38273
38274 /**
38275  * The number of blocks included in the range of the reply
38276  */
38277 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
38278
38279 /**
38280  * True when this is the final reply for a query
38281  */
38282 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
38283
38284 /**
38285  * True when this is the final reply for a query
38286  */
38287 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
38288
38289 /**
38290  * The `short_channel_id`s in the channel range
38291  *
38292  * Returns a copy of the field.
38293  */
38294 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
38295
38296 /**
38297  * The `short_channel_id`s in the channel range
38298  */
38299 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
38300
38301 /**
38302  * Constructs a new ReplyChannelRange given each field
38303  */
38304 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);
38305
38306 /**
38307  * Creates a copy of the ReplyChannelRange
38308  */
38309 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
38310
38311 /**
38312  * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
38313  */
38314 uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
38315
38316 /**
38317  * Checks if two ReplyChannelRanges contain equal inner contents.
38318  * This ignores pointers and is_owned flags and looks at the values in fields.
38319  * Two objects with NULL inner values will be considered "equal" here.
38320  */
38321 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
38322
38323 /**
38324  * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
38325  */
38326 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
38327
38328 /**
38329  * The genesis hash of the blockchain being queried
38330  */
38331 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
38332
38333 /**
38334  * The genesis hash of the blockchain being queried
38335  */
38336 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38337
38338 /**
38339  * The short_channel_ids that are being queried
38340  *
38341  * Returns a copy of the field.
38342  */
38343 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
38344
38345 /**
38346  * The short_channel_ids that are being queried
38347  */
38348 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
38349
38350 /**
38351  * Constructs a new QueryShortChannelIds given each field
38352  */
38353 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
38354
38355 /**
38356  * Creates a copy of the QueryShortChannelIds
38357  */
38358 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
38359
38360 /**
38361  * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
38362  */
38363 uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
38364
38365 /**
38366  * Checks if two QueryShortChannelIdss contain equal inner contents.
38367  * This ignores pointers and is_owned flags and looks at the values in fields.
38368  * Two objects with NULL inner values will be considered "equal" here.
38369  */
38370 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
38371
38372 /**
38373  * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
38374  */
38375 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
38376
38377 /**
38378  * The genesis hash of the blockchain that was queried
38379  */
38380 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
38381
38382 /**
38383  * The genesis hash of the blockchain that was queried
38384  */
38385 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38386
38387 /**
38388  * Indicates if the query recipient maintains up-to-date channel
38389  * information for the `chain_hash`
38390  */
38391 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
38392
38393 /**
38394  * Indicates if the query recipient maintains up-to-date channel
38395  * information for the `chain_hash`
38396  */
38397 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
38398
38399 /**
38400  * Constructs a new ReplyShortChannelIdsEnd given each field
38401  */
38402 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
38403
38404 /**
38405  * Creates a copy of the ReplyShortChannelIdsEnd
38406  */
38407 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
38408
38409 /**
38410  * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
38411  */
38412 uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
38413
38414 /**
38415  * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
38416  * This ignores pointers and is_owned flags and looks at the values in fields.
38417  * Two objects with NULL inner values will be considered "equal" here.
38418  */
38419 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
38420
38421 /**
38422  * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
38423  */
38424 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
38425
38426 /**
38427  * The genesis hash of the blockchain for channel and node information
38428  */
38429 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
38430
38431 /**
38432  * The genesis hash of the blockchain for channel and node information
38433  */
38434 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38435
38436 /**
38437  * The starting unix timestamp
38438  */
38439 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
38440
38441 /**
38442  * The starting unix timestamp
38443  */
38444 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
38445
38446 /**
38447  * The range of information in seconds
38448  */
38449 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
38450
38451 /**
38452  * The range of information in seconds
38453  */
38454 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
38455
38456 /**
38457  * Constructs a new GossipTimestampFilter given each field
38458  */
38459 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
38460
38461 /**
38462  * Creates a copy of the GossipTimestampFilter
38463  */
38464 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
38465
38466 /**
38467  * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
38468  */
38469 uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
38470
38471 /**
38472  * Checks if two GossipTimestampFilters contain equal inner contents.
38473  * This ignores pointers and is_owned flags and looks at the values in fields.
38474  * Two objects with NULL inner values will be considered "equal" here.
38475  */
38476 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
38477
38478 /**
38479  * Frees any resources used by the ErrorAction
38480  */
38481 void ErrorAction_free(struct LDKErrorAction this_ptr);
38482
38483 /**
38484  * Creates a copy of the ErrorAction
38485  */
38486 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
38487
38488 /**
38489  * Utility method to constructs a new DisconnectPeer-variant ErrorAction
38490  */
38491 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
38492
38493 /**
38494  * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
38495  */
38496 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
38497
38498 /**
38499  * Utility method to constructs a new IgnoreError-variant ErrorAction
38500  */
38501 struct LDKErrorAction ErrorAction_ignore_error(void);
38502
38503 /**
38504  * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
38505  */
38506 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
38507
38508 /**
38509  * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
38510  */
38511 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
38512
38513 /**
38514  * Utility method to constructs a new SendErrorMessage-variant ErrorAction
38515  */
38516 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
38517
38518 /**
38519  * Utility method to constructs a new SendWarningMessage-variant ErrorAction
38520  */
38521 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
38522
38523 /**
38524  * Generates a non-cryptographic 64-bit hash of the ErrorAction.
38525  */
38526 uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
38527
38528 /**
38529  * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
38530  */
38531 void LightningError_free(struct LDKLightningError this_obj);
38532
38533 /**
38534  * A human-readable message describing the error
38535  */
38536 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
38537
38538 /**
38539  * A human-readable message describing the error
38540  */
38541 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
38542
38543 /**
38544  * The action which should be taken against the offending peer.
38545  */
38546 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
38547
38548 /**
38549  * The action which should be taken against the offending peer.
38550  */
38551 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
38552
38553 /**
38554  * Constructs a new LightningError given each field
38555  */
38556 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
38557
38558 /**
38559  * Creates a copy of the LightningError
38560  */
38561 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
38562
38563 /**
38564  * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
38565  */
38566 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
38567
38568 /**
38569  * `update_add_htlc` messages which should be sent
38570  */
38571 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38572
38573 /**
38574  * `update_add_htlc` messages which should be sent
38575  */
38576 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
38577
38578 /**
38579  * `update_fulfill_htlc` messages which should be sent
38580  */
38581 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38582
38583 /**
38584  * `update_fulfill_htlc` messages which should be sent
38585  */
38586 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
38587
38588 /**
38589  * `update_fail_htlc` messages which should be sent
38590  */
38591 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38592
38593 /**
38594  * `update_fail_htlc` messages which should be sent
38595  */
38596 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
38597
38598 /**
38599  * `update_fail_malformed_htlc` messages which should be sent
38600  */
38601 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38602
38603 /**
38604  * `update_fail_malformed_htlc` messages which should be sent
38605  */
38606 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
38607
38608 /**
38609  * An `update_fee` message which should be sent
38610  *
38611  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38612  */
38613 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38614
38615 /**
38616  * An `update_fee` message which should be sent
38617  *
38618  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38619  */
38620 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
38621
38622 /**
38623  * A `commitment_signed` message which should be sent
38624  */
38625 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38626
38627 /**
38628  * A `commitment_signed` message which should be sent
38629  */
38630 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
38631
38632 /**
38633  * Constructs a new CommitmentUpdate given each field
38634  *
38635  * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
38636  */
38637 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);
38638
38639 /**
38640  * Creates a copy of the CommitmentUpdate
38641  */
38642 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
38643
38644 /**
38645  * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
38646  */
38647 uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
38648
38649 /**
38650  * Checks if two CommitmentUpdates contain equal inner contents.
38651  * This ignores pointers and is_owned flags and looks at the values in fields.
38652  * Two objects with NULL inner values will be considered "equal" here.
38653  */
38654 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
38655
38656 /**
38657  * Calls the free function if one is set
38658  */
38659 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
38660
38661 /**
38662  * Calls the free function if one is set
38663  */
38664 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
38665
38666 /**
38667  * Calls the free function if one is set
38668  */
38669 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
38670
38671 /**
38672  * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
38673  */
38674 void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
38675
38676 /**
38677  * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
38678  * Because it is generated by the recipient and included in the invoice, it also provides
38679  * proof to the recipient that the payment was sent by someone with the generated invoice.
38680  */
38681 const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
38682
38683 /**
38684  * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
38685  * Because it is generated by the recipient and included in the invoice, it also provides
38686  * proof to the recipient that the payment was sent by someone with the generated invoice.
38687  */
38688 void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38689
38690 /**
38691  * The intended total amount that this payment is for.
38692  *
38693  * Message serialization may panic if this value is more than 21 million Bitcoin.
38694  */
38695 uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
38696
38697 /**
38698  * The intended total amount that this payment is for.
38699  *
38700  * Message serialization may panic if this value is more than 21 million Bitcoin.
38701  */
38702 void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
38703
38704 /**
38705  * Constructs a new FinalOnionHopData given each field
38706  */
38707 MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
38708
38709 /**
38710  * Creates a copy of the FinalOnionHopData
38711  */
38712 struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
38713
38714 /**
38715  * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
38716  */
38717 void OnionPacket_free(struct LDKOnionPacket this_obj);
38718
38719 /**
38720  * BOLT 4 version number.
38721  */
38722 uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
38723
38724 /**
38725  * BOLT 4 version number.
38726  */
38727 void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
38728
38729 /**
38730  * In order to ensure we always return an error on onion decode in compliance with [BOLT
38731  * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
38732  * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
38733  * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
38734  * like.
38735  *
38736  * Returns a copy of the field.
38737  */
38738 struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
38739
38740 /**
38741  * In order to ensure we always return an error on onion decode in compliance with [BOLT
38742  * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
38743  * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
38744  * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
38745  * like.
38746  */
38747 void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
38748
38749 /**
38750  * HMAC to verify the integrity of hop_data.
38751  */
38752 const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
38753
38754 /**
38755  * HMAC to verify the integrity of hop_data.
38756  */
38757 void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38758
38759 /**
38760  * Creates a copy of the OnionPacket
38761  */
38762 struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
38763
38764 /**
38765  * Generates a non-cryptographic 64-bit hash of the OnionPacket.
38766  */
38767 uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
38768
38769 /**
38770  * Checks if two OnionPackets contain equal inner contents.
38771  * This ignores pointers and is_owned flags and looks at the values in fields.
38772  * Two objects with NULL inner values will be considered "equal" here.
38773  */
38774 bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
38775
38776 /**
38777  * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
38778  */
38779 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
38780
38781 /**
38782  * Read a AcceptChannel from a byte array, created by AcceptChannel_write
38783  */
38784 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
38785
38786 /**
38787  * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
38788  */
38789 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
38790
38791 /**
38792  * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
38793  */
38794 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
38795
38796 /**
38797  * Serialize the Stfu object into a byte array which can be read by Stfu_read
38798  */
38799 struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
38800
38801 /**
38802  * Read a Stfu from a byte array, created by Stfu_write
38803  */
38804 struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
38805
38806 /**
38807  * Serialize the Splice object into a byte array which can be read by Splice_read
38808  */
38809 struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj);
38810
38811 /**
38812  * Read a Splice from a byte array, created by Splice_write
38813  */
38814 struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser);
38815
38816 /**
38817  * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
38818  */
38819 struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
38820
38821 /**
38822  * Read a SpliceAck from a byte array, created by SpliceAck_write
38823  */
38824 struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
38825
38826 /**
38827  * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
38828  */
38829 struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
38830
38831 /**
38832  * Read a SpliceLocked from a byte array, created by SpliceLocked_write
38833  */
38834 struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
38835
38836 /**
38837  * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
38838  */
38839 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
38840
38841 /**
38842  * Read a TxAddInput from a byte array, created by TxAddInput_write
38843  */
38844 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
38845
38846 /**
38847  * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
38848  */
38849 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
38850
38851 /**
38852  * Read a TxAddOutput from a byte array, created by TxAddOutput_write
38853  */
38854 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
38855
38856 /**
38857  * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
38858  */
38859 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
38860
38861 /**
38862  * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
38863  */
38864 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
38865
38866 /**
38867  * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
38868  */
38869 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
38870
38871 /**
38872  * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
38873  */
38874 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
38875
38876 /**
38877  * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
38878  */
38879 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
38880
38881 /**
38882  * Read a TxComplete from a byte array, created by TxComplete_write
38883  */
38884 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
38885
38886 /**
38887  * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
38888  */
38889 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
38890
38891 /**
38892  * Read a TxSignatures from a byte array, created by TxSignatures_write
38893  */
38894 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
38895
38896 /**
38897  * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
38898  */
38899 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
38900
38901 /**
38902  * Read a TxInitRbf from a byte array, created by TxInitRbf_write
38903  */
38904 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
38905
38906 /**
38907  * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
38908  */
38909 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
38910
38911 /**
38912  * Read a TxAckRbf from a byte array, created by TxAckRbf_write
38913  */
38914 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
38915
38916 /**
38917  * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
38918  */
38919 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
38920
38921 /**
38922  * Read a TxAbort from a byte array, created by TxAbort_write
38923  */
38924 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
38925
38926 /**
38927  * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
38928  */
38929 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
38930
38931 /**
38932  * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
38933  */
38934 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
38935
38936 /**
38937  * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
38938  */
38939 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
38940
38941 /**
38942  * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
38943  */
38944 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
38945
38946 /**
38947  * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
38948  */
38949 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
38950
38951 /**
38952  * Read a ClosingSigned from a byte array, created by ClosingSigned_write
38953  */
38954 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
38955
38956 /**
38957  * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
38958  */
38959 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
38960
38961 /**
38962  * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
38963  */
38964 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
38965
38966 /**
38967  * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
38968  */
38969 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
38970
38971 /**
38972  * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
38973  */
38974 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
38975
38976 /**
38977  * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
38978  */
38979 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
38980
38981 /**
38982  * Read a FundingCreated from a byte array, created by FundingCreated_write
38983  */
38984 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
38985
38986 /**
38987  * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
38988  */
38989 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
38990
38991 /**
38992  * Read a FundingSigned from a byte array, created by FundingSigned_write
38993  */
38994 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
38995
38996 /**
38997  * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
38998  */
38999 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
39000
39001 /**
39002  * Read a ChannelReady from a byte array, created by ChannelReady_write
39003  */
39004 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
39005
39006 /**
39007  * Serialize the Init object into a byte array which can be read by Init_read
39008  */
39009 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
39010
39011 /**
39012  * Read a Init from a byte array, created by Init_write
39013  */
39014 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
39015
39016 /**
39017  * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
39018  */
39019 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
39020
39021 /**
39022  * Read a OpenChannel from a byte array, created by OpenChannel_write
39023  */
39024 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
39025
39026 /**
39027  * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
39028  */
39029 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
39030
39031 /**
39032  * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
39033  */
39034 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
39035
39036 /**
39037  * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
39038  */
39039 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
39040
39041 /**
39042  * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
39043  */
39044 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
39045
39046 /**
39047  * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
39048  */
39049 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
39050
39051 /**
39052  * Read a Shutdown from a byte array, created by Shutdown_write
39053  */
39054 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
39055
39056 /**
39057  * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
39058  */
39059 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
39060
39061 /**
39062  * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
39063  */
39064 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
39065
39066 /**
39067  * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
39068  */
39069 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
39070
39071 /**
39072  * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
39073  */
39074 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
39075
39076 /**
39077  * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
39078  */
39079 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
39080
39081 /**
39082  * Read a UpdateFee from a byte array, created by UpdateFee_write
39083  */
39084 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
39085
39086 /**
39087  * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
39088  */
39089 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
39090
39091 /**
39092  * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
39093  */
39094 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
39095
39096 /**
39097  * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
39098  */
39099 struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
39100
39101 /**
39102  * Read a OnionPacket from a byte array, created by OnionPacket_write
39103  */
39104 struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
39105
39106 /**
39107  * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
39108  */
39109 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
39110
39111 /**
39112  * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
39113  */
39114 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
39115
39116 /**
39117  * Read a OnionMessage from a byte array, created by OnionMessage_write
39118  */
39119 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
39120
39121 /**
39122  * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
39123  */
39124 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
39125
39126 /**
39127  * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
39128  */
39129 struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
39130
39131 /**
39132  * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
39133  */
39134 struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
39135
39136 /**
39137  * Serialize the Ping object into a byte array which can be read by Ping_read
39138  */
39139 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
39140
39141 /**
39142  * Read a Ping from a byte array, created by Ping_write
39143  */
39144 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
39145
39146 /**
39147  * Serialize the Pong object into a byte array which can be read by Pong_read
39148  */
39149 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
39150
39151 /**
39152  * Read a Pong from a byte array, created by Pong_write
39153  */
39154 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
39155
39156 /**
39157  * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
39158  */
39159 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
39160
39161 /**
39162  * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
39163  */
39164 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
39165
39166 /**
39167  * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
39168  */
39169 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
39170
39171 /**
39172  * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
39173  */
39174 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
39175
39176 /**
39177  * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
39178  */
39179 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
39180
39181 /**
39182  * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
39183  */
39184 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
39185
39186 /**
39187  * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
39188  */
39189 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
39190
39191 /**
39192  * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
39193  */
39194 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
39195
39196 /**
39197  * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
39198  */
39199 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
39200
39201 /**
39202  * Read a ErrorMessage from a byte array, created by ErrorMessage_write
39203  */
39204 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
39205
39206 /**
39207  * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
39208  */
39209 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
39210
39211 /**
39212  * Read a WarningMessage from a byte array, created by WarningMessage_write
39213  */
39214 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
39215
39216 /**
39217  * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
39218  */
39219 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
39220
39221 /**
39222  * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
39223  */
39224 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
39225
39226 /**
39227  * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
39228  */
39229 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
39230
39231 /**
39232  * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
39233  */
39234 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
39235
39236 /**
39237  * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
39238  */
39239 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
39240
39241 /**
39242  * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
39243  */
39244 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
39245
39246 /**
39247  * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
39248  */
39249 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
39250
39251 /**
39252  * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
39253  */
39254 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
39255
39256 /**
39257  * Calculates the overflow safe ending block height for the query.
39258  *
39259  * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
39260  */
39261 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
39262
39263 /**
39264  * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
39265  */
39266 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
39267
39268 /**
39269  * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
39270  */
39271 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
39272
39273 /**
39274  * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
39275  */
39276 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
39277
39278 /**
39279  * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
39280  */
39281 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
39282
39283 /**
39284  * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
39285  */
39286 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
39287
39288 /**
39289  * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
39290  */
39291 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
39292
39293 /**
39294  * Calls the free function if one is set
39295  */
39296 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
39297
39298 /**
39299  * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
39300  */
39301 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
39302
39303 /**
39304  * Constructs a new IgnoringMessageHandler given each field
39305  */
39306 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
39307
39308 /**
39309  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
39310  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
39311  */
39312 struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39313
39314 /**
39315  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
39316  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
39317  */
39318 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39319
39320 /**
39321  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
39322  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
39323  */
39324 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39325
39326 /**
39327  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
39328  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
39329  */
39330 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39331
39332 /**
39333  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
39334  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
39335  */
39336 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39337
39338 /**
39339  * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
39340  * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
39341  */
39342 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39343
39344 /**
39345  * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
39346  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
39347  */
39348 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39349
39350 /**
39351  * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
39352  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
39353  */
39354 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39355
39356 /**
39357  * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
39358  */
39359 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
39360
39361 /**
39362  * Constructs a new ErroringMessageHandler
39363  */
39364 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
39365
39366 /**
39367  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
39368  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
39369  */
39370 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
39371
39372 /**
39373  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
39374  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
39375  */
39376 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
39377
39378 /**
39379  * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
39380  */
39381 void MessageHandler_free(struct LDKMessageHandler this_obj);
39382
39383 /**
39384  * A message handler which handles messages specific to channels. Usually this is just a
39385  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
39386  *
39387  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
39388  */
39389 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
39390
39391 /**
39392  * A message handler which handles messages specific to channels. Usually this is just a
39393  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
39394  *
39395  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
39396  */
39397 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
39398
39399 /**
39400  * A message handler which handles messages updating our knowledge of the network channel
39401  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
39402  *
39403  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
39404  */
39405 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
39406
39407 /**
39408  * A message handler which handles messages updating our knowledge of the network channel
39409  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
39410  *
39411  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
39412  */
39413 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
39414
39415 /**
39416  * A message handler which handles onion messages. This should generally be an
39417  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
39418  *
39419  * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
39420  */
39421 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
39422
39423 /**
39424  * A message handler which handles onion messages. This should generally be an
39425  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
39426  *
39427  * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
39428  */
39429 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
39430
39431 /**
39432  * A message handler which handles custom messages. The only LDK-provided implementation is
39433  * [`IgnoringMessageHandler`].
39434  */
39435 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
39436
39437 /**
39438  * A message handler which handles custom messages. The only LDK-provided implementation is
39439  * [`IgnoringMessageHandler`].
39440  */
39441 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
39442
39443 /**
39444  * Constructs a new MessageHandler given each field
39445  */
39446 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);
39447
39448 /**
39449  * Creates a copy of a SocketDescriptor
39450  */
39451 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
39452
39453 /**
39454  * Calls the free function if one is set
39455  */
39456 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
39457
39458 /**
39459  * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
39460  */
39461 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
39462
39463 /**
39464  * Constructs a new PeerHandleError given each field
39465  */
39466 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
39467
39468 /**
39469  * Creates a copy of the PeerHandleError
39470  */
39471 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
39472
39473 /**
39474  * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
39475  */
39476 void PeerManager_free(struct LDKPeerManager this_obj);
39477
39478 /**
39479  * Constructs a new `PeerManager` with the given message handlers.
39480  *
39481  * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
39482  * cryptographically secure random bytes.
39483  *
39484  * `current_time` is used as an always-increasing counter that survives across restarts and is
39485  * incremented irregularly internally. In general it is best to simply use the current UNIX
39486  * timestamp, however if it is not available a persistent counter that increases once per
39487  * minute should suffice.
39488  */
39489 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);
39490
39491 /**
39492  * Get a list of tuples mapping from node id to network addresses for peers which have
39493  * completed the initial handshake.
39494  *
39495  * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
39496  * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
39497  * handshake has completed and we are sure the remote peer has the private key for the given
39498  * [`PublicKey`].
39499  *
39500  * The returned `Option`s will only be `Some` if an address had been previously given via
39501  * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
39502  */
39503 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
39504
39505 /**
39506  * Indicates a new outbound connection has been established to a node with the given `node_id`
39507  * and an optional remote network address.
39508  *
39509  * The remote network address adds the option to report a remote IP address back to a connecting
39510  * peer using the init message.
39511  * The user should pass the remote network address of the host they are connected to.
39512  *
39513  * If an `Err` is returned here you must disconnect the connection immediately.
39514  *
39515  * Returns a small number of bytes to send to the remote node (currently always 50).
39516  *
39517  * Panics if descriptor is duplicative with some other descriptor which has not yet been
39518  * [`socket_disconnected`].
39519  *
39520  * [`socket_disconnected`]: PeerManager::socket_disconnected
39521  */
39522 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);
39523
39524 /**
39525  * Indicates a new inbound connection has been established to a node with an optional remote
39526  * network address.
39527  *
39528  * The remote network address adds the option to report a remote IP address back to a connecting
39529  * peer using the init message.
39530  * The user should pass the remote network address of the host they are connected to.
39531  *
39532  * May refuse the connection by returning an Err, but will never write bytes to the remote end
39533  * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
39534  * the connection immediately.
39535  *
39536  * Panics if descriptor is duplicative with some other descriptor which has not yet been
39537  * [`socket_disconnected`].
39538  *
39539  * [`socket_disconnected`]: PeerManager::socket_disconnected
39540  */
39541 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);
39542
39543 /**
39544  * Indicates that there is room to write data to the given socket descriptor.
39545  *
39546  * May return an Err to indicate that the connection should be closed.
39547  *
39548  * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
39549  * returning. Thus, be very careful with reentrancy issues! The invariants around calling
39550  * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
39551  * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
39552  * sufficient!
39553  *
39554  * [`send_data`]: SocketDescriptor::send_data
39555  * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
39556  */
39557 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
39558
39559 /**
39560  * Indicates that data was read from the given socket descriptor.
39561  *
39562  * May return an Err to indicate that the connection should be closed.
39563  *
39564  * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
39565  * Thus, however, you should call [`process_events`] after any `read_event` to generate
39566  * [`send_data`] calls to handle responses.
39567  *
39568  * If `Ok(true)` is returned, further read_events should not be triggered until a
39569  * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
39570  * send buffer).
39571  *
39572  * In order to avoid processing too many messages at once per peer, `data` should be on the
39573  * order of 4KiB.
39574  *
39575  * [`send_data`]: SocketDescriptor::send_data
39576  * [`process_events`]: PeerManager::process_events
39577  */
39578 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);
39579
39580 /**
39581  * Checks for any events generated by our handlers and processes them. Includes sending most
39582  * response messages as well as messages generated by calls to handler functions directly (eg
39583  * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
39584  *
39585  * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
39586  * issues!
39587  *
39588  * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
39589  * or one of the other clients provided in our language bindings.
39590  *
39591  * Note that if there are any other calls to this function waiting on lock(s) this may return
39592  * without doing any work. All available events that need handling will be handled before the
39593  * other calls return.
39594  *
39595  * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
39596  * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
39597  * [`send_data`]: SocketDescriptor::send_data
39598  */
39599 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
39600
39601 /**
39602  * Indicates that the given socket descriptor's connection is now closed.
39603  */
39604 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
39605
39606 /**
39607  * Disconnect a peer given its node id.
39608  *
39609  * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
39610  * peer. Thus, be very careful about reentrancy issues.
39611  *
39612  * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
39613  */
39614 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
39615
39616 /**
39617  * Disconnects all currently-connected peers. This is useful on platforms where there may be
39618  * an indication that TCP sockets have stalled even if we weren't around to time them out
39619  * using regular ping/pongs.
39620  */
39621 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
39622
39623 /**
39624  * Send pings to each peer and disconnect those which did not respond to the last round of
39625  * pings.
39626  *
39627  * This may be called on any timescale you want, however, roughly once every ten seconds is
39628  * preferred. The call rate determines both how often we send a ping to our peers and how much
39629  * time they have to respond before we disconnect them.
39630  *
39631  * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
39632  * issues!
39633  *
39634  * [`send_data`]: SocketDescriptor::send_data
39635  */
39636 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
39637
39638 /**
39639  * Generates a signed node_announcement from the given arguments, sending it to all connected
39640  * peers. Note that peers will likely ignore this message unless we have at least one public
39641  * channel which has at least six confirmations on-chain.
39642  *
39643  * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
39644  * node to humans. They carry no in-protocol meaning.
39645  *
39646  * `addresses` represent the set (possibly empty) of socket addresses on which this node
39647  * accepts incoming connections. These will be included in the node_announcement, publicly
39648  * tying these addresses together and to this node. If you wish to preserve user privacy,
39649  * addresses should likely contain only Tor Onion addresses.
39650  *
39651  * Panics if `addresses` is absurdly large (more than 100).
39652  *
39653  * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
39654  */
39655 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
39656
39657 /**
39658  * Gets the weight for an HTLC-Success transaction.
39659  */
39660 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
39661
39662 /**
39663  * Gets the weight for an HTLC-Timeout transaction.
39664  */
39665 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
39666
39667 /**
39668  * Creates a copy of the HTLCClaim
39669  */
39670 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
39671
39672 /**
39673  * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
39674  */
39675 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
39676
39677 /**
39678  * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
39679  */
39680 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
39681
39682 /**
39683  * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
39684  */
39685 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
39686
39687 /**
39688  * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
39689  */
39690 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
39691
39692 /**
39693  * Utility method to constructs a new Revocation-variant HTLCClaim
39694  */
39695 enum LDKHTLCClaim HTLCClaim_revocation(void);
39696
39697 /**
39698  * Checks if two HTLCClaims contain equal inner contents.
39699  * This ignores pointers and is_owned flags and looks at the values in fields.
39700  */
39701 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
39702
39703 /**
39704  * Check if a given input witness attempts to claim a HTLC.
39705  */
39706 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
39707
39708 /**
39709  * Build the commitment secret from the seed and the commitment number
39710  */
39711 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
39712
39713 /**
39714  * Build a closing transaction
39715  */
39716 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);
39717
39718 /**
39719  * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
39720  */
39721 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
39722
39723 /**
39724  * Creates a copy of the CounterpartyCommitmentSecrets
39725  */
39726 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
39727
39728 /**
39729  * Creates a new empty `CounterpartyCommitmentSecrets` structure.
39730  */
39731 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
39732
39733 /**
39734  * Returns the minimum index of all stored secrets. Note that indexes start
39735  * at 1 << 48 and get decremented by one for each new secret.
39736  */
39737 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
39738
39739 /**
39740  * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
39741  * was generated in accordance with BOLT 3 and is consistent with previous secrets.
39742  */
39743 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
39744
39745 /**
39746  * Returns the secret at `idx`.
39747  * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
39748  *
39749  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39750  */
39751 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
39752
39753 /**
39754  * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
39755  */
39756 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
39757
39758 /**
39759  * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
39760  */
39761 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
39762
39763 /**
39764  * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
39765  * from the base secret and the per_commitment_point.
39766  */
39767 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
39768
39769 /**
39770  * Derives a per-commitment-transaction revocation key from its constituent parts.
39771  *
39772  * Only the cheating participant owns a valid witness to propagate a revoked
39773  * commitment transaction, thus per_commitment_secret always come from cheater
39774  * and revocation_base_secret always come from punisher, which is the broadcaster
39775  * of the transaction spending with this key knowledge.
39776  */
39777 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
39778
39779 /**
39780  * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
39781  */
39782 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
39783
39784 /**
39785  * The broadcaster's per-commitment public key which was used to derive the other keys.
39786  */
39787 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39788
39789 /**
39790  * The broadcaster's per-commitment public key which was used to derive the other keys.
39791  */
39792 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39793
39794 /**
39795  * The revocation key which is used to allow the broadcaster of the commitment
39796  * transaction to provide their counterparty the ability to punish them if they broadcast
39797  * an old state.
39798  */
39799 struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39800
39801 /**
39802  * The revocation key which is used to allow the broadcaster of the commitment
39803  * transaction to provide their counterparty the ability to punish them if they broadcast
39804  * an old state.
39805  */
39806 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
39807
39808 /**
39809  * Broadcaster's HTLC Key
39810  */
39811 struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39812
39813 /**
39814  * Broadcaster's HTLC Key
39815  */
39816 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
39817
39818 /**
39819  * Countersignatory's HTLC Key
39820  */
39821 struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39822
39823 /**
39824  * Countersignatory's HTLC Key
39825  */
39826 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
39827
39828 /**
39829  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
39830  */
39831 struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39832
39833 /**
39834  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
39835  */
39836 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
39837
39838 /**
39839  * Constructs a new TxCreationKeys given each field
39840  */
39841 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKRevocationKey revocation_key_arg, struct LDKHtlcKey broadcaster_htlc_key_arg, struct LDKHtlcKey countersignatory_htlc_key_arg, struct LDKDelayedPaymentKey broadcaster_delayed_payment_key_arg);
39842
39843 /**
39844  * Checks if two TxCreationKeyss contain equal inner contents.
39845  * This ignores pointers and is_owned flags and looks at the values in fields.
39846  * Two objects with NULL inner values will be considered "equal" here.
39847  */
39848 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
39849
39850 /**
39851  * Creates a copy of the TxCreationKeys
39852  */
39853 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
39854
39855 /**
39856  * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
39857  */
39858 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
39859
39860 /**
39861  * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
39862  */
39863 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
39864
39865 /**
39866  * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
39867  */
39868 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
39869
39870 /**
39871  * The public key which is used to sign all commitment transactions, as it appears in the
39872  * on-chain channel lock-in 2-of-2 multisig output.
39873  */
39874 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39875
39876 /**
39877  * The public key which is used to sign all commitment transactions, as it appears in the
39878  * on-chain channel lock-in 2-of-2 multisig output.
39879  */
39880 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39881
39882 /**
39883  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
39884  * revocation keys. This is combined with the per-commitment-secret generated by the
39885  * counterparty to create a secret which the counterparty can reveal to revoke previous
39886  * states.
39887  */
39888 struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39889
39890 /**
39891  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
39892  * revocation keys. This is combined with the per-commitment-secret generated by the
39893  * counterparty to create a secret which the counterparty can reveal to revoke previous
39894  * states.
39895  */
39896 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
39897
39898 /**
39899  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
39900  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
39901  * static across every commitment transaction.
39902  */
39903 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39904
39905 /**
39906  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
39907  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
39908  * static across every commitment transaction.
39909  */
39910 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39911
39912 /**
39913  * The base point which is used (with derive_public_key) to derive a per-commitment payment
39914  * public key which receives non-HTLC-encumbered funds which are only available for spending
39915  * after some delay (or can be claimed via the revocation path).
39916  */
39917 struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39918
39919 /**
39920  * The base point which is used (with derive_public_key) to derive a per-commitment payment
39921  * public key which receives non-HTLC-encumbered funds which are only available for spending
39922  * after some delay (or can be claimed via the revocation path).
39923  */
39924 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
39925
39926 /**
39927  * The base point which is used (with derive_public_key) to derive a per-commitment public key
39928  * which is used to encumber HTLC-in-flight outputs.
39929  */
39930 struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39931
39932 /**
39933  * The base point which is used (with derive_public_key) to derive a per-commitment public key
39934  * which is used to encumber HTLC-in-flight outputs.
39935  */
39936 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
39937
39938 /**
39939  * Constructs a new ChannelPublicKeys given each field
39940  */
39941 MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKRevocationBasepoint revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKDelayedPaymentBasepoint delayed_payment_basepoint_arg, struct LDKHtlcBasepoint htlc_basepoint_arg);
39942
39943 /**
39944  * Creates a copy of the ChannelPublicKeys
39945  */
39946 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
39947
39948 /**
39949  * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
39950  */
39951 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
39952
39953 /**
39954  * Checks if two ChannelPublicKeyss contain equal inner contents.
39955  * This ignores pointers and is_owned flags and looks at the values in fields.
39956  * Two objects with NULL inner values will be considered "equal" here.
39957  */
39958 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
39959
39960 /**
39961  * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
39962  */
39963 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
39964
39965 /**
39966  * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
39967  */
39968 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
39969
39970 /**
39971  * Create per-state keys from channel base points and the per-commitment point.
39972  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
39973  */
39974 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR broadcaster_delayed_payment_base, const struct LDKHtlcBasepoint *NONNULL_PTR broadcaster_htlc_base, const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_revocation_base, const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_htlc_base);
39975
39976 /**
39977  * Generate per-state keys from channel static keys.
39978  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
39979  */
39980 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);
39981
39982 /**
39983  * A script either spendable by the revocation
39984  * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
39985  * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
39986  */
39987 struct LDKCVec_u8Z get_revokeable_redeemscript(const struct LDKRevocationKey *NONNULL_PTR revocation_key, uint16_t contest_delay, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key);
39988
39989 /**
39990  * Returns the script for the counterparty's output on a holder's commitment transaction based on
39991  * the channel type.
39992  */
39993 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
39994
39995 /**
39996  * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
39997  */
39998 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
39999
40000 /**
40001  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
40002  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
40003  * need to compare this value to whether the commitment transaction in question is that of
40004  * the counterparty or our own.
40005  */
40006 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
40007
40008 /**
40009  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
40010  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
40011  * need to compare this value to whether the commitment transaction in question is that of
40012  * the counterparty or our own.
40013  */
40014 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
40015
40016 /**
40017  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
40018  * this divided by 1000.
40019  */
40020 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
40021
40022 /**
40023  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
40024  * this divided by 1000.
40025  */
40026 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
40027
40028 /**
40029  * The CLTV lock-time at which this HTLC expires.
40030  */
40031 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
40032
40033 /**
40034  * The CLTV lock-time at which this HTLC expires.
40035  */
40036 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
40037
40038 /**
40039  * The hash of the preimage which unlocks this HTLC.
40040  */
40041 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
40042
40043 /**
40044  * The hash of the preimage which unlocks this HTLC.
40045  */
40046 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40047
40048 /**
40049  * The position within the commitment transactions' outputs. This may be None if the value is
40050  * below the dust limit (in which case no output appears in the commitment transaction and the
40051  * value is spent to additional transaction fees).
40052  */
40053 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
40054
40055 /**
40056  * The position within the commitment transactions' outputs. This may be None if the value is
40057  * below the dust limit (in which case no output appears in the commitment transaction and the
40058  * value is spent to additional transaction fees).
40059  */
40060 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
40061
40062 /**
40063  * Constructs a new HTLCOutputInCommitment given each field
40064  */
40065 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);
40066
40067 /**
40068  * Creates a copy of the HTLCOutputInCommitment
40069  */
40070 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
40071
40072 /**
40073  * Checks if two HTLCOutputInCommitments contain equal inner contents.
40074  * This ignores pointers and is_owned flags and looks at the values in fields.
40075  * Two objects with NULL inner values will be considered "equal" here.
40076  */
40077 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
40078
40079 /**
40080  * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
40081  */
40082 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
40083
40084 /**
40085  * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
40086  */
40087 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
40088
40089 /**
40090  * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
40091  * does not need to have its previous_output_index filled.
40092  */
40093 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);
40094
40095 /**
40096  * Gets the redeemscript for a funding output from the two funding public keys.
40097  * Note that the order of funding public keys does not matter.
40098  */
40099 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
40100
40101 /**
40102  * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
40103  * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
40104  * transaction which needs signing, and can be used to construct an HTLC transaction which is
40105  * broadcastable given a counterparty HTLC signature.
40106  *
40107  * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
40108  * commitment transaction).
40109  */
40110 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, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key, const struct LDKRevocationKey *NONNULL_PTR revocation_key);
40111
40112 /**
40113  * Returns the witness required to satisfy and spend a HTLC input.
40114  */
40115 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);
40116
40117 /**
40118  * Gets the witnessScript for the to_remote output when anchors are enabled.
40119  */
40120 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
40121
40122 /**
40123  * Gets the witnessScript for an anchor output from the funding public key.
40124  * The witness in the spending input must be:
40125  * <BIP 143 funding_signature>
40126  * After 16 blocks of confirmation, an alternative satisfying witness could be:
40127  * <>
40128  * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
40129  */
40130 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
40131
40132 /**
40133  * Returns the witness required to satisfy and spend an anchor input.
40134  */
40135 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
40136
40137 /**
40138  * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
40139  */
40140 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
40141
40142 /**
40143  * Holder public keys
40144  */
40145 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40146
40147 /**
40148  * Holder public keys
40149  */
40150 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
40151
40152 /**
40153  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
40154  */
40155 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40156
40157 /**
40158  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
40159  */
40160 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
40161
40162 /**
40163  * Whether the holder is the initiator of this channel.
40164  * This is an input to the commitment number obscure factor computation.
40165  */
40166 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40167
40168 /**
40169  * Whether the holder is the initiator of this channel.
40170  * This is an input to the commitment number obscure factor computation.
40171  */
40172 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
40173
40174 /**
40175  * The late-bound counterparty channel transaction parameters.
40176  * These parameters are populated at the point in the protocol where the counterparty provides them.
40177  *
40178  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40179  */
40180 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40181
40182 /**
40183  * The late-bound counterparty channel transaction parameters.
40184  * These parameters are populated at the point in the protocol where the counterparty provides them.
40185  *
40186  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40187  */
40188 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
40189
40190 /**
40191  * The late-bound funding outpoint
40192  *
40193  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40194  */
40195 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40196
40197 /**
40198  * The late-bound funding outpoint
40199  *
40200  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40201  */
40202 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
40203
40204 /**
40205  * This channel's type, as negotiated during channel open. For old objects where this field
40206  * wasn't serialized, it will default to static_remote_key at deserialization.
40207  */
40208 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40209
40210 /**
40211  * This channel's type, as negotiated during channel open. For old objects where this field
40212  * wasn't serialized, it will default to static_remote_key at deserialization.
40213  */
40214 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
40215
40216 /**
40217  * Constructs a new ChannelTransactionParameters given each field
40218  *
40219  * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40220  * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40221  */
40222 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);
40223
40224 /**
40225  * Creates a copy of the ChannelTransactionParameters
40226  */
40227 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
40228
40229 /**
40230  * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
40231  */
40232 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
40233
40234 /**
40235  * Checks if two ChannelTransactionParameterss contain equal inner contents.
40236  * This ignores pointers and is_owned flags and looks at the values in fields.
40237  * Two objects with NULL inner values will be considered "equal" here.
40238  */
40239 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
40240
40241 /**
40242  * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
40243  */
40244 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
40245
40246 /**
40247  * Counter-party public keys
40248  */
40249 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
40250
40251 /**
40252  * Counter-party public keys
40253  */
40254 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
40255
40256 /**
40257  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
40258  */
40259 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
40260
40261 /**
40262  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
40263  */
40264 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
40265
40266 /**
40267  * Constructs a new CounterpartyChannelTransactionParameters given each field
40268  */
40269 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
40270
40271 /**
40272  * Creates a copy of the CounterpartyChannelTransactionParameters
40273  */
40274 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
40275
40276 /**
40277  * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
40278  */
40279 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
40280
40281 /**
40282  * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
40283  * This ignores pointers and is_owned flags and looks at the values in fields.
40284  * Two objects with NULL inner values will be considered "equal" here.
40285  */
40286 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
40287
40288 /**
40289  * Whether the late bound parameters are populated.
40290  */
40291 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
40292
40293 /**
40294  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
40295  * given that the holder is the broadcaster.
40296  *
40297  * self.is_populated() must be true before calling this function.
40298  */
40299 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
40300
40301 /**
40302  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
40303  * given that the counterparty is the broadcaster.
40304  *
40305  * self.is_populated() must be true before calling this function.
40306  */
40307 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
40308
40309 /**
40310  * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
40311  */
40312 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
40313
40314 /**
40315  * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
40316  */
40317 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
40318
40319 /**
40320  * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
40321  */
40322 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
40323
40324 /**
40325  * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
40326  */
40327 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
40328
40329 /**
40330  * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
40331  */
40332 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
40333
40334 /**
40335  * Get the channel pubkeys for the broadcaster
40336  */
40337 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40338
40339 /**
40340  * Get the channel pubkeys for the countersignatory
40341  */
40342 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40343
40344 /**
40345  * Get the contest delay applicable to the transactions.
40346  * Note that the contest delay was selected by the countersignatory.
40347  */
40348 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40349
40350 /**
40351  * Whether the channel is outbound from the broadcaster.
40352  *
40353  * The boolean representing the side that initiated the channel is
40354  * an input to the commitment number obscure factor computation.
40355  */
40356 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40357
40358 /**
40359  * The funding outpoint
40360  */
40361 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40362
40363 /**
40364  * Whether to use anchors for this channel
40365  */
40366 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40367
40368 /**
40369  * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
40370  */
40371 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
40372
40373 /**
40374  * Our counterparty's signature for the transaction
40375  */
40376 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
40377
40378 /**
40379  * Our counterparty's signature for the transaction
40380  */
40381 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40382
40383 /**
40384  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
40385  *
40386  * Returns a copy of the field.
40387  */
40388 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
40389
40390 /**
40391  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
40392  */
40393 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
40394
40395 /**
40396  * Creates a copy of the HolderCommitmentTransaction
40397  */
40398 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
40399
40400 /**
40401  * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
40402  */
40403 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
40404
40405 /**
40406  * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
40407  */
40408 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
40409
40410 /**
40411  * Create a new holder transaction with the given counterparty signatures.
40412  * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
40413  */
40414 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);
40415
40416 /**
40417  * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
40418  */
40419 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
40420
40421 /**
40422  * The commitment transaction
40423  */
40424 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
40425
40426 /**
40427  * The commitment transaction
40428  */
40429 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
40430
40431 /**
40432  * The txid for the commitment transaction.
40433  *
40434  * This is provided as a performance optimization, instead of calling transaction.txid()
40435  * multiple times.
40436  */
40437 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
40438
40439 /**
40440  * The txid for the commitment transaction.
40441  *
40442  * This is provided as a performance optimization, instead of calling transaction.txid()
40443  * multiple times.
40444  */
40445 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40446
40447 /**
40448  * Constructs a new BuiltCommitmentTransaction given each field
40449  */
40450 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
40451
40452 /**
40453  * Creates a copy of the BuiltCommitmentTransaction
40454  */
40455 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
40456
40457 /**
40458  * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
40459  */
40460 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
40461
40462 /**
40463  * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
40464  */
40465 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
40466
40467 /**
40468  * Get the SIGHASH_ALL sighash value of the transaction.
40469  *
40470  * This can be used to verify a signature.
40471  */
40472 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);
40473
40474 /**
40475  * Signs the counterparty's commitment transaction.
40476  */
40477 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);
40478
40479 /**
40480  * Signs the holder commitment transaction because we are about to broadcast it.
40481  */
40482 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);
40483
40484 /**
40485  * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
40486  */
40487 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
40488
40489 /**
40490  * Creates a copy of the ClosingTransaction
40491  */
40492 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
40493
40494 /**
40495  * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
40496  */
40497 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
40498
40499 /**
40500  * Checks if two ClosingTransactions contain equal inner contents.
40501  * This ignores pointers and is_owned flags and looks at the values in fields.
40502  * Two objects with NULL inner values will be considered "equal" here.
40503  */
40504 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
40505
40506 /**
40507  * Construct an object of the class
40508  */
40509 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);
40510
40511 /**
40512  * Trust our pre-built transaction.
40513  *
40514  * Applies a wrapper which allows access to the transaction.
40515  *
40516  * This should only be used if you fully trust the builder of this object. It should not
40517  * be used by an external signer - instead use the verify function.
40518  */
40519 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40520
40521 /**
40522  * Verify our pre-built transaction.
40523  *
40524  * Applies a wrapper which allows access to the transaction.
40525  *
40526  * An external validating signer must call this method before signing
40527  * or using the built transaction.
40528  */
40529 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
40530
40531 /**
40532  * The value to be sent to the holder, or zero if the output will be omitted
40533  */
40534 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40535
40536 /**
40537  * The value to be sent to the counterparty, or zero if the output will be omitted
40538  */
40539 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40540
40541 /**
40542  * The destination of the holder's output
40543  */
40544 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40545
40546 /**
40547  * The destination of the counterparty's output
40548  */
40549 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40550
40551 /**
40552  * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
40553  */
40554 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
40555
40556 /**
40557  * The pre-built Bitcoin commitment transaction
40558  */
40559 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
40560
40561 /**
40562  * Get the SIGHASH_ALL sighash value of the transaction.
40563  *
40564  * This can be used to verify a signature.
40565  */
40566 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);
40567
40568 /**
40569  * Sign a transaction, either because we are counter-signing the counterparty's transaction or
40570  * because we are about to broadcast a holder transaction.
40571  */
40572 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);
40573
40574 /**
40575  * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
40576  */
40577 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
40578
40579 /**
40580  * Creates a copy of the CommitmentTransaction
40581  */
40582 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
40583
40584 /**
40585  * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
40586  */
40587 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
40588
40589 /**
40590  * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
40591  */
40592 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
40593
40594 /**
40595  * The backwards-counting commitment number
40596  */
40597 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40598
40599 /**
40600  * The per commitment point used by the broadcaster.
40601  */
40602 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40603
40604 /**
40605  * The value to be sent to the broadcaster
40606  */
40607 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40608
40609 /**
40610  * The value to be sent to the counterparty
40611  */
40612 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40613
40614 /**
40615  * The feerate paid per 1000-weight-unit in this commitment transaction.
40616  */
40617 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40618
40619 /**
40620  * Trust our pre-built transaction and derived transaction creation public keys.
40621  *
40622  * Applies a wrapper which allows access to these fields.
40623  *
40624  * This should only be used if you fully trust the builder of this object.  It should not
40625  * be used by an external signer - instead use the verify function.
40626  */
40627 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40628
40629 /**
40630  * Verify our pre-built transaction and derived transaction creation public keys.
40631  *
40632  * Applies a wrapper which allows access to these fields.
40633  *
40634  * An external validating signer must call this method before signing
40635  * or using the built transaction.
40636  */
40637 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);
40638
40639 /**
40640  * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
40641  */
40642 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
40643
40644 /**
40645  * The transaction ID of the built Bitcoin transaction
40646  */
40647 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40648
40649 /**
40650  * The pre-built Bitcoin commitment transaction
40651  */
40652 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40653
40654 /**
40655  * The pre-calculated transaction creation public keys.
40656  */
40657 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40658
40659 /**
40660  * Should anchors be used.
40661  */
40662 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40663
40664 /**
40665  * Get a signature for each HTLC which was included in the commitment transaction (ie for
40666  * which HTLCOutputInCommitment::transaction_output_index.is_some()).
40667  *
40668  * The returned Vec has one entry for each HTLC, and in the same order.
40669  *
40670  * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
40671  */
40672 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);
40673
40674 /**
40675  * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
40676  * the broadcaster, in the built transaction, if any exists.
40677  *
40678  * There are two cases where this may return `None`:
40679  * - The balance of the revokeable output is below the dust limit (only found on commitments
40680  * early in the channel's lifetime, i.e. before the channel reserve is met).
40681  * - This commitment was created before LDK 0.0.117. In this case, the
40682  * commitment transaction previously didn't contain enough information to locate the
40683  * revokeable output.
40684  */
40685 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40686
40687 /**
40688  * Helper method to build an unsigned justice transaction spending the revokeable
40689  * `to_local` output to a destination script. Fee estimation accounts for the expected
40690  * revocation witness data that will be added when signed.
40691  *
40692  * This method will error if the given fee rate results in a fee greater than the value
40693  * of the output being spent, or if there exists no revokeable `to_local` output on this
40694  * commitment transaction. See [`Self::revokeable_output_index`] for more details.
40695  *
40696  * The built transaction will allow fee bumping with RBF, and this method takes
40697  * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
40698  * fee rates may be built.
40699  */
40700 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);
40701
40702 /**
40703  * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
40704  * shared secret first. This prevents on-chain observers from discovering how many commitment
40705  * transactions occurred in a channel before it was closed.
40706  *
40707  * This function gets the shared secret from relevant channel public keys and can be used to
40708  * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
40709  */
40710 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
40711
40712 /**
40713  * Checks if two InitFeaturess contain equal inner contents.
40714  * This ignores pointers and is_owned flags and looks at the values in fields.
40715  * Two objects with NULL inner values will be considered "equal" here.
40716  */
40717 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
40718
40719 /**
40720  * Checks if two NodeFeaturess contain equal inner contents.
40721  * This ignores pointers and is_owned flags and looks at the values in fields.
40722  * Two objects with NULL inner values will be considered "equal" here.
40723  */
40724 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
40725
40726 /**
40727  * Checks if two ChannelFeaturess contain equal inner contents.
40728  * This ignores pointers and is_owned flags and looks at the values in fields.
40729  * Two objects with NULL inner values will be considered "equal" here.
40730  */
40731 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
40732
40733 /**
40734  * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
40735  * This ignores pointers and is_owned flags and looks at the values in fields.
40736  * Two objects with NULL inner values will be considered "equal" here.
40737  */
40738 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
40739
40740 /**
40741  * Checks if two OfferFeaturess contain equal inner contents.
40742  * This ignores pointers and is_owned flags and looks at the values in fields.
40743  * Two objects with NULL inner values will be considered "equal" here.
40744  */
40745 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
40746
40747 /**
40748  * Checks if two InvoiceRequestFeaturess contain equal inner contents.
40749  * This ignores pointers and is_owned flags and looks at the values in fields.
40750  * Two objects with NULL inner values will be considered "equal" here.
40751  */
40752 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
40753
40754 /**
40755  * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
40756  * This ignores pointers and is_owned flags and looks at the values in fields.
40757  * Two objects with NULL inner values will be considered "equal" here.
40758  */
40759 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
40760
40761 /**
40762  * Checks if two BlindedHopFeaturess contain equal inner contents.
40763  * This ignores pointers and is_owned flags and looks at the values in fields.
40764  * Two objects with NULL inner values will be considered "equal" here.
40765  */
40766 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
40767
40768 /**
40769  * Checks if two ChannelTypeFeaturess contain equal inner contents.
40770  * This ignores pointers and is_owned flags and looks at the values in fields.
40771  * Two objects with NULL inner values will be considered "equal" here.
40772  */
40773 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
40774
40775 /**
40776  * Creates a copy of the InitFeatures
40777  */
40778 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
40779
40780 /**
40781  * Creates a copy of the NodeFeatures
40782  */
40783 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
40784
40785 /**
40786  * Creates a copy of the ChannelFeatures
40787  */
40788 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
40789
40790 /**
40791  * Creates a copy of the Bolt11InvoiceFeatures
40792  */
40793 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
40794
40795 /**
40796  * Creates a copy of the OfferFeatures
40797  */
40798 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
40799
40800 /**
40801  * Creates a copy of the InvoiceRequestFeatures
40802  */
40803 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
40804
40805 /**
40806  * Creates a copy of the Bolt12InvoiceFeatures
40807  */
40808 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
40809
40810 /**
40811  * Creates a copy of the BlindedHopFeatures
40812  */
40813 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
40814
40815 /**
40816  * Creates a copy of the ChannelTypeFeatures
40817  */
40818 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
40819
40820 /**
40821  * Generates a non-cryptographic 64-bit hash of the InitFeatures.
40822  */
40823 uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
40824
40825 /**
40826  * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
40827  */
40828 uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
40829
40830 /**
40831  * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
40832  */
40833 uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
40834
40835 /**
40836  * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
40837  */
40838 uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
40839
40840 /**
40841  * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
40842  */
40843 uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
40844
40845 /**
40846  * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
40847  */
40848 uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
40849
40850 /**
40851  * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
40852  */
40853 uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
40854
40855 /**
40856  * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
40857  */
40858 uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
40859
40860 /**
40861  * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
40862  */
40863 uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
40864
40865 /**
40866  * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
40867  */
40868 void InitFeatures_free(struct LDKInitFeatures this_obj);
40869
40870 /**
40871  * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
40872  */
40873 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
40874
40875 /**
40876  * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
40877  */
40878 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
40879
40880 /**
40881  * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
40882  */
40883 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
40884
40885 /**
40886  * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
40887  */
40888 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
40889
40890 /**
40891  * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
40892  */
40893 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
40894
40895 /**
40896  * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
40897  */
40898 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
40899
40900 /**
40901  * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
40902  */
40903 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
40904
40905 /**
40906  * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
40907  */
40908 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
40909
40910 /**
40911  * Create a blank Features with no features set
40912  */
40913 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
40914
40915 /**
40916  * Returns true if this `Features` object contains required features unknown by `other`.
40917  */
40918 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
40919
40920 /**
40921  * Returns true if this `Features` object contains unknown feature flags which are set as
40922  * \"required\".
40923  */
40924 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
40925
40926 /**
40927  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
40928  * by [BOLT 9].
40929  *
40930  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
40931  * be set instead (i.e., `bit - 1`).
40932  *
40933  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
40934  */
40935 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40936
40937 /**
40938  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
40939  * by [BOLT 9].
40940  *
40941  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
40942  * set instead (i.e., `bit + 1`).
40943  *
40944  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
40945  */
40946 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40947
40948 /**
40949  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
40950  * by [bLIP 2] or if it is a known `T` feature.
40951  *
40952  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
40953  * be set instead (i.e., `bit - 1`).
40954  *
40955  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
40956  */
40957 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40958
40959 /**
40960  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
40961  * by [bLIP 2] or if it is a known `T` feature.
40962  *
40963  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
40964  * set instead (i.e., `bit + 1`).
40965  *
40966  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
40967  */
40968 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40969
40970 /**
40971  * Create a blank Features with no features set
40972  */
40973 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
40974
40975 /**
40976  * Returns true if this `Features` object contains required features unknown by `other`.
40977  */
40978 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
40979
40980 /**
40981  * Returns true if this `Features` object contains unknown feature flags which are set as
40982  * \"required\".
40983  */
40984 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
40985
40986 /**
40987  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
40988  * by [BOLT 9].
40989  *
40990  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
40991  * be set instead (i.e., `bit - 1`).
40992  *
40993  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
40994  */
40995 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40996
40997 /**
40998  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
40999  * by [BOLT 9].
41000  *
41001  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41002  * set instead (i.e., `bit + 1`).
41003  *
41004  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41005  */
41006 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41007
41008 /**
41009  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41010  * by [bLIP 2] or if it is a known `T` feature.
41011  *
41012  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41013  * be set instead (i.e., `bit - 1`).
41014  *
41015  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41016  */
41017 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41018
41019 /**
41020  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41021  * by [bLIP 2] or if it is a known `T` feature.
41022  *
41023  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41024  * set instead (i.e., `bit + 1`).
41025  *
41026  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41027  */
41028 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41029
41030 /**
41031  * Create a blank Features with no features set
41032  */
41033 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
41034
41035 /**
41036  * Returns true if this `Features` object contains required features unknown by `other`.
41037  */
41038 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
41039
41040 /**
41041  * Returns true if this `Features` object contains unknown feature flags which are set as
41042  * \"required\".
41043  */
41044 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
41045
41046 /**
41047  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41048  * by [BOLT 9].
41049  *
41050  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41051  * be set instead (i.e., `bit - 1`).
41052  *
41053  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41054  */
41055 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41056
41057 /**
41058  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41059  * by [BOLT 9].
41060  *
41061  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41062  * set instead (i.e., `bit + 1`).
41063  *
41064  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41065  */
41066 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41067
41068 /**
41069  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41070  * by [bLIP 2] or if it is a known `T` feature.
41071  *
41072  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41073  * be set instead (i.e., `bit - 1`).
41074  *
41075  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41076  */
41077 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41078
41079 /**
41080  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41081  * by [bLIP 2] or if it is a known `T` feature.
41082  *
41083  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41084  * set instead (i.e., `bit + 1`).
41085  *
41086  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41087  */
41088 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41089
41090 /**
41091  * Create a blank Features with no features set
41092  */
41093 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
41094
41095 /**
41096  * Returns true if this `Features` object contains required features unknown by `other`.
41097  */
41098 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
41099
41100 /**
41101  * Returns true if this `Features` object contains unknown feature flags which are set as
41102  * \"required\".
41103  */
41104 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41105
41106 /**
41107  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41108  * by [BOLT 9].
41109  *
41110  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41111  * be set instead (i.e., `bit - 1`).
41112  *
41113  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41114  */
41115 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41116
41117 /**
41118  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41119  * by [BOLT 9].
41120  *
41121  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41122  * set instead (i.e., `bit + 1`).
41123  *
41124  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41125  */
41126 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41127
41128 /**
41129  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41130  * by [bLIP 2] or if it is a known `T` feature.
41131  *
41132  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41133  * be set instead (i.e., `bit - 1`).
41134  *
41135  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41136  */
41137 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41138
41139 /**
41140  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41141  * by [bLIP 2] or if it is a known `T` feature.
41142  *
41143  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41144  * set instead (i.e., `bit + 1`).
41145  *
41146  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41147  */
41148 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41149
41150 /**
41151  * Create a blank Features with no features set
41152  */
41153 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
41154
41155 /**
41156  * Returns true if this `Features` object contains required features unknown by `other`.
41157  */
41158 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
41159
41160 /**
41161  * Returns true if this `Features` object contains unknown feature flags which are set as
41162  * \"required\".
41163  */
41164 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
41165
41166 /**
41167  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41168  * by [BOLT 9].
41169  *
41170  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41171  * be set instead (i.e., `bit - 1`).
41172  *
41173  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41174  */
41175 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41176
41177 /**
41178  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41179  * by [BOLT 9].
41180  *
41181  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41182  * set instead (i.e., `bit + 1`).
41183  *
41184  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41185  */
41186 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41187
41188 /**
41189  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41190  * by [bLIP 2] or if it is a known `T` feature.
41191  *
41192  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41193  * be set instead (i.e., `bit - 1`).
41194  *
41195  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41196  */
41197 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41198
41199 /**
41200  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41201  * by [bLIP 2] or if it is a known `T` feature.
41202  *
41203  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41204  * set instead (i.e., `bit + 1`).
41205  *
41206  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41207  */
41208 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41209
41210 /**
41211  * Create a blank Features with no features set
41212  */
41213 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
41214
41215 /**
41216  * Returns true if this `Features` object contains required features unknown by `other`.
41217  */
41218 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
41219
41220 /**
41221  * Returns true if this `Features` object contains unknown feature flags which are set as
41222  * \"required\".
41223  */
41224 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
41225
41226 /**
41227  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41228  * by [BOLT 9].
41229  *
41230  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41231  * be set instead (i.e., `bit - 1`).
41232  *
41233  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41234  */
41235 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41236
41237 /**
41238  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41239  * by [BOLT 9].
41240  *
41241  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41242  * set instead (i.e., `bit + 1`).
41243  *
41244  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41245  */
41246 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41247
41248 /**
41249  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41250  * by [bLIP 2] or if it is a known `T` feature.
41251  *
41252  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41253  * be set instead (i.e., `bit - 1`).
41254  *
41255  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41256  */
41257 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41258
41259 /**
41260  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41261  * by [bLIP 2] or if it is a known `T` feature.
41262  *
41263  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41264  * set instead (i.e., `bit + 1`).
41265  *
41266  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41267  */
41268 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41269
41270 /**
41271  * Create a blank Features with no features set
41272  */
41273 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
41274
41275 /**
41276  * Returns true if this `Features` object contains required features unknown by `other`.
41277  */
41278 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
41279
41280 /**
41281  * Returns true if this `Features` object contains unknown feature flags which are set as
41282  * \"required\".
41283  */
41284 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41285
41286 /**
41287  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41288  * by [BOLT 9].
41289  *
41290  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41291  * be set instead (i.e., `bit - 1`).
41292  *
41293  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41294  */
41295 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41296
41297 /**
41298  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41299  * by [BOLT 9].
41300  *
41301  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41302  * set instead (i.e., `bit + 1`).
41303  *
41304  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41305  */
41306 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41307
41308 /**
41309  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41310  * by [bLIP 2] or if it is a known `T` feature.
41311  *
41312  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41313  * be set instead (i.e., `bit - 1`).
41314  *
41315  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41316  */
41317 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41318
41319 /**
41320  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41321  * by [bLIP 2] or if it is a known `T` feature.
41322  *
41323  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41324  * set instead (i.e., `bit + 1`).
41325  *
41326  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41327  */
41328 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41329
41330 /**
41331  * Create a blank Features with no features set
41332  */
41333 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
41334
41335 /**
41336  * Returns true if this `Features` object contains required features unknown by `other`.
41337  */
41338 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
41339
41340 /**
41341  * Returns true if this `Features` object contains unknown feature flags which are set as
41342  * \"required\".
41343  */
41344 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
41345
41346 /**
41347  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41348  * by [BOLT 9].
41349  *
41350  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41351  * be set instead (i.e., `bit - 1`).
41352  *
41353  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41354  */
41355 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41356
41357 /**
41358  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41359  * by [BOLT 9].
41360  *
41361  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41362  * set instead (i.e., `bit + 1`).
41363  *
41364  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41365  */
41366 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41367
41368 /**
41369  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41370  * by [bLIP 2] or if it is a known `T` feature.
41371  *
41372  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41373  * be set instead (i.e., `bit - 1`).
41374  *
41375  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41376  */
41377 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41378
41379 /**
41380  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41381  * by [bLIP 2] or if it is a known `T` feature.
41382  *
41383  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41384  * set instead (i.e., `bit + 1`).
41385  *
41386  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41387  */
41388 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41389
41390 /**
41391  * Create a blank Features with no features set
41392  */
41393 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
41394
41395 /**
41396  * Returns true if this `Features` object contains required features unknown by `other`.
41397  */
41398 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
41399
41400 /**
41401  * Returns true if this `Features` object contains unknown feature flags which are set as
41402  * \"required\".
41403  */
41404 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41405
41406 /**
41407  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41408  * by [BOLT 9].
41409  *
41410  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41411  * be set instead (i.e., `bit - 1`).
41412  *
41413  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41414  */
41415 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41416
41417 /**
41418  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41419  * by [BOLT 9].
41420  *
41421  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41422  * set instead (i.e., `bit + 1`).
41423  *
41424  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41425  */
41426 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41427
41428 /**
41429  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41430  * by [bLIP 2] or if it is a known `T` feature.
41431  *
41432  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41433  * be set instead (i.e., `bit - 1`).
41434  *
41435  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41436  */
41437 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41438
41439 /**
41440  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41441  * by [bLIP 2] or if it is a known `T` feature.
41442  *
41443  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41444  * set instead (i.e., `bit + 1`).
41445  *
41446  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41447  */
41448 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41449
41450 /**
41451  * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
41452  */
41453 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
41454
41455 /**
41456  * Read a InitFeatures from a byte array, created by InitFeatures_write
41457  */
41458 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
41459
41460 /**
41461  * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
41462  */
41463 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
41464
41465 /**
41466  * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
41467  */
41468 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
41469
41470 /**
41471  * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
41472  */
41473 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
41474
41475 /**
41476  * Read a NodeFeatures from a byte array, created by NodeFeatures_write
41477  */
41478 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
41479
41480 /**
41481  * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
41482  */
41483 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
41484
41485 /**
41486  * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
41487  */
41488 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
41489
41490 /**
41491  * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
41492  */
41493 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
41494
41495 /**
41496  * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
41497  */
41498 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
41499
41500 /**
41501  * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
41502  */
41503 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
41504
41505 /**
41506  * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
41507  */
41508 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
41509
41510 /**
41511  * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
41512  */
41513 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
41514
41515 /**
41516  * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
41517  */
41518 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
41519
41520 /**
41521  * Set this feature as optional.
41522  */
41523 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41524
41525 /**
41526  * Set this feature as required.
41527  */
41528 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41529
41530 /**
41531  * Checks if this feature is supported.
41532  */
41533 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41534
41535 /**
41536  * Set this feature as optional.
41537  */
41538 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41539
41540 /**
41541  * Set this feature as required.
41542  */
41543 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41544
41545 /**
41546  * Checks if this feature is supported.
41547  */
41548 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41549
41550 /**
41551  * Checks if this feature is required.
41552  */
41553 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41554
41555 /**
41556  * Checks if this feature is required.
41557  */
41558 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41559
41560 /**
41561  * Set this feature as optional.
41562  */
41563 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41564
41565 /**
41566  * Set this feature as required.
41567  */
41568 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41569
41570 /**
41571  * Checks if this feature is supported.
41572  */
41573 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41574
41575 /**
41576  * Set this feature as optional.
41577  */
41578 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41579
41580 /**
41581  * Set this feature as required.
41582  */
41583 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41584
41585 /**
41586  * Checks if this feature is supported.
41587  */
41588 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41589
41590 /**
41591  * Set this feature as optional.
41592  */
41593 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41594
41595 /**
41596  * Set this feature as required.
41597  */
41598 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41599
41600 /**
41601  * Checks if this feature is supported.
41602  */
41603 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41604
41605 /**
41606  * Checks if this feature is required.
41607  */
41608 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41609
41610 /**
41611  * Checks if this feature is required.
41612  */
41613 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41614
41615 /**
41616  * Set this feature as optional.
41617  */
41618 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41619
41620 /**
41621  * Set this feature as required.
41622  */
41623 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41624
41625 /**
41626  * Checks if this feature is supported.
41627  */
41628 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41629
41630 /**
41631  * Set this feature as optional.
41632  */
41633 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41634
41635 /**
41636  * Set this feature as required.
41637  */
41638 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41639
41640 /**
41641  * Checks if this feature is supported.
41642  */
41643 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41644
41645 /**
41646  * Checks if this feature is required.
41647  */
41648 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41649
41650 /**
41651  * Checks if this feature is required.
41652  */
41653 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41654
41655 /**
41656  * Set this feature as optional.
41657  */
41658 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41659
41660 /**
41661  * Set this feature as required.
41662  */
41663 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41664
41665 /**
41666  * Checks if this feature is supported.
41667  */
41668 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41669
41670 /**
41671  * Set this feature as optional.
41672  */
41673 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41674
41675 /**
41676  * Set this feature as required.
41677  */
41678 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41679
41680 /**
41681  * Checks if this feature is supported.
41682  */
41683 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41684
41685 /**
41686  * Set this feature as optional.
41687  */
41688 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41689
41690 /**
41691  * Set this feature as required.
41692  */
41693 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41694
41695 /**
41696  * Checks if this feature is supported.
41697  */
41698 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41699
41700 /**
41701  * Checks if this feature is required.
41702  */
41703 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41704
41705 /**
41706  * Checks if this feature is required.
41707  */
41708 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41709
41710 /**
41711  * Checks if this feature is required.
41712  */
41713 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41714
41715 /**
41716  * Set this feature as optional.
41717  */
41718 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41719
41720 /**
41721  * Set this feature as required.
41722  */
41723 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41724
41725 /**
41726  * Checks if this feature is supported.
41727  */
41728 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41729
41730 /**
41731  * Set this feature as optional.
41732  */
41733 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41734
41735 /**
41736  * Set this feature as required.
41737  */
41738 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41739
41740 /**
41741  * Checks if this feature is supported.
41742  */
41743 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41744
41745 /**
41746  * Set this feature as optional.
41747  */
41748 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41749
41750 /**
41751  * Set this feature as required.
41752  */
41753 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41754
41755 /**
41756  * Checks if this feature is supported.
41757  */
41758 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41759
41760 /**
41761  * Checks if this feature is required.
41762  */
41763 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41764
41765 /**
41766  * Checks if this feature is required.
41767  */
41768 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41769
41770 /**
41771  * Checks if this feature is required.
41772  */
41773 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41774
41775 /**
41776  * Set this feature as optional.
41777  */
41778 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41779
41780 /**
41781  * Set this feature as required.
41782  */
41783 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41784
41785 /**
41786  * Checks if this feature is supported.
41787  */
41788 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41789
41790 /**
41791  * Set this feature as optional.
41792  */
41793 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41794
41795 /**
41796  * Set this feature as required.
41797  */
41798 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41799
41800 /**
41801  * Checks if this feature is supported.
41802  */
41803 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41804
41805 /**
41806  * Set this feature as optional.
41807  */
41808 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41809
41810 /**
41811  * Set this feature as required.
41812  */
41813 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41814
41815 /**
41816  * Checks if this feature is supported.
41817  */
41818 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41819
41820 /**
41821  * Checks if this feature is required.
41822  */
41823 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41824
41825 /**
41826  * Checks if this feature is required.
41827  */
41828 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41829
41830 /**
41831  * Checks if this feature is required.
41832  */
41833 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41834
41835 /**
41836  * Set this feature as optional.
41837  */
41838 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41839
41840 /**
41841  * Set this feature as required.
41842  */
41843 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41844
41845 /**
41846  * Checks if this feature is supported.
41847  */
41848 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41849
41850 /**
41851  * Set this feature as optional.
41852  */
41853 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41854
41855 /**
41856  * Set this feature as required.
41857  */
41858 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41859
41860 /**
41861  * Checks if this feature is supported.
41862  */
41863 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41864
41865 /**
41866  * Set this feature as optional.
41867  */
41868 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41869
41870 /**
41871  * Set this feature as required.
41872  */
41873 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41874
41875 /**
41876  * Checks if this feature is supported.
41877  */
41878 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41879
41880 /**
41881  * Set this feature as optional.
41882  */
41883 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41884
41885 /**
41886  * Set this feature as required.
41887  */
41888 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41889
41890 /**
41891  * Checks if this feature is supported.
41892  */
41893 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41894
41895 /**
41896  * Checks if this feature is required.
41897  */
41898 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41899
41900 /**
41901  * Checks if this feature is required.
41902  */
41903 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41904
41905 /**
41906  * Checks if this feature is required.
41907  */
41908 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41909
41910 /**
41911  * Checks if this feature is required.
41912  */
41913 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41914
41915 /**
41916  * Set this feature as optional.
41917  */
41918 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41919
41920 /**
41921  * Set this feature as required.
41922  */
41923 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41924
41925 /**
41926  * Checks if this feature is supported.
41927  */
41928 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41929
41930 /**
41931  * Set this feature as optional.
41932  */
41933 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41934
41935 /**
41936  * Set this feature as required.
41937  */
41938 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41939
41940 /**
41941  * Checks if this feature is supported.
41942  */
41943 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41944
41945 /**
41946  * Checks if this feature is required.
41947  */
41948 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41949
41950 /**
41951  * Checks if this feature is required.
41952  */
41953 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41954
41955 /**
41956  * Set this feature as optional.
41957  */
41958 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41959
41960 /**
41961  * Set this feature as required.
41962  */
41963 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41964
41965 /**
41966  * Checks if this feature is supported.
41967  */
41968 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41969
41970 /**
41971  * Set this feature as optional.
41972  */
41973 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41974
41975 /**
41976  * Set this feature as required.
41977  */
41978 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41979
41980 /**
41981  * Checks if this feature is supported.
41982  */
41983 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41984
41985 /**
41986  * Set this feature as optional.
41987  */
41988 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41989
41990 /**
41991  * Set this feature as required.
41992  */
41993 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41994
41995 /**
41996  * Checks if this feature is supported.
41997  */
41998 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41999
42000 /**
42001  * Checks if this feature is required.
42002  */
42003 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42004
42005 /**
42006  * Checks if this feature is required.
42007  */
42008 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42009
42010 /**
42011  * Checks if this feature is required.
42012  */
42013 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42014
42015 /**
42016  * Set this feature as optional.
42017  */
42018 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42019
42020 /**
42021  * Set this feature as required.
42022  */
42023 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42024
42025 /**
42026  * Checks if this feature is supported.
42027  */
42028 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42029
42030 /**
42031  * Set this feature as optional.
42032  */
42033 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42034
42035 /**
42036  * Set this feature as required.
42037  */
42038 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42039
42040 /**
42041  * Checks if this feature is supported.
42042  */
42043 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42044
42045 /**
42046  * Set this feature as optional.
42047  */
42048 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42049
42050 /**
42051  * Set this feature as required.
42052  */
42053 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42054
42055 /**
42056  * Checks if this feature is supported.
42057  */
42058 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42059
42060 /**
42061  * Checks if this feature is required.
42062  */
42063 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42064
42065 /**
42066  * Checks if this feature is required.
42067  */
42068 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42069
42070 /**
42071  * Checks if this feature is required.
42072  */
42073 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42074
42075 /**
42076  * Set this feature as optional.
42077  */
42078 void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42079
42080 /**
42081  * Set this feature as required.
42082  */
42083 void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42084
42085 /**
42086  * Checks if this feature is supported.
42087  */
42088 MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42089
42090 /**
42091  * Set this feature as optional.
42092  */
42093 void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42094
42095 /**
42096  * Set this feature as required.
42097  */
42098 void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42099
42100 /**
42101  * Checks if this feature is supported.
42102  */
42103 MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42104
42105 /**
42106  * Checks if this feature is required.
42107  */
42108 MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42109
42110 /**
42111  * Checks if this feature is required.
42112  */
42113 MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42114
42115 /**
42116  * Set this feature as optional.
42117  */
42118 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42119
42120 /**
42121  * Set this feature as required.
42122  */
42123 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42124
42125 /**
42126  * Checks if this feature is supported.
42127  */
42128 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42129
42130 /**
42131  * Set this feature as optional.
42132  */
42133 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42134
42135 /**
42136  * Set this feature as required.
42137  */
42138 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42139
42140 /**
42141  * Checks if this feature is supported.
42142  */
42143 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42144
42145 /**
42146  * Checks if this feature is required.
42147  */
42148 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42149
42150 /**
42151  * Checks if this feature is required.
42152  */
42153 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42154
42155 /**
42156  * Set this feature as optional.
42157  */
42158 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42159
42160 /**
42161  * Set this feature as required.
42162  */
42163 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42164
42165 /**
42166  * Checks if this feature is supported.
42167  */
42168 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42169
42170 /**
42171  * Set this feature as optional.
42172  */
42173 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42174
42175 /**
42176  * Set this feature as required.
42177  */
42178 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42179
42180 /**
42181  * Checks if this feature is supported.
42182  */
42183 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42184
42185 /**
42186  * Set this feature as optional.
42187  */
42188 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42189
42190 /**
42191  * Set this feature as required.
42192  */
42193 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42194
42195 /**
42196  * Checks if this feature is supported.
42197  */
42198 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42199
42200 /**
42201  * Checks if this feature is required.
42202  */
42203 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42204
42205 /**
42206  * Checks if this feature is required.
42207  */
42208 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42209
42210 /**
42211  * Checks if this feature is required.
42212  */
42213 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42214
42215 /**
42216  * Set this feature as optional.
42217  */
42218 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42219
42220 /**
42221  * Set this feature as required.
42222  */
42223 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42224
42225 /**
42226  * Checks if this feature is supported.
42227  */
42228 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42229
42230 /**
42231  * Set this feature as optional.
42232  */
42233 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42234
42235 /**
42236  * Set this feature as required.
42237  */
42238 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42239
42240 /**
42241  * Checks if this feature is supported.
42242  */
42243 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42244
42245 /**
42246  * Checks if this feature is required.
42247  */
42248 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42249
42250 /**
42251  * Checks if this feature is required.
42252  */
42253 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42254
42255 /**
42256  * Set this feature as optional.
42257  */
42258 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42259
42260 /**
42261  * Set this feature as required.
42262  */
42263 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42264
42265 /**
42266  * Checks if this feature is supported.
42267  */
42268 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42269
42270 /**
42271  * Set this feature as optional.
42272  */
42273 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42274
42275 /**
42276  * Set this feature as required.
42277  */
42278 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42279
42280 /**
42281  * Checks if this feature is supported.
42282  */
42283 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42284
42285 /**
42286  * Checks if this feature is required.
42287  */
42288 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42289
42290 /**
42291  * Checks if this feature is required.
42292  */
42293 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42294
42295 /**
42296  * Set this feature as optional.
42297  */
42298 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42299
42300 /**
42301  * Set this feature as required.
42302  */
42303 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42304
42305 /**
42306  * Checks if this feature is supported.
42307  */
42308 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42309
42310 /**
42311  * Set this feature as optional.
42312  */
42313 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42314
42315 /**
42316  * Set this feature as required.
42317  */
42318 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42319
42320 /**
42321  * Checks if this feature is supported.
42322  */
42323 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42324
42325 /**
42326  * Set this feature as optional.
42327  */
42328 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42329
42330 /**
42331  * Set this feature as required.
42332  */
42333 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42334
42335 /**
42336  * Checks if this feature is supported.
42337  */
42338 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42339
42340 /**
42341  * Checks if this feature is required.
42342  */
42343 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42344
42345 /**
42346  * Checks if this feature is required.
42347  */
42348 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42349
42350 /**
42351  * Checks if this feature is required.
42352  */
42353 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42354
42355 /**
42356  * Set this feature as optional.
42357  */
42358 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
42359
42360 /**
42361  * Set this feature as required.
42362  */
42363 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
42364
42365 /**
42366  * Checks if this feature is supported.
42367  */
42368 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
42369
42370 /**
42371  * Checks if this feature is required.
42372  */
42373 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
42374
42375 /**
42376  * Set this feature as optional.
42377  */
42378 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42379
42380 /**
42381  * Set this feature as required.
42382  */
42383 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42384
42385 /**
42386  * Checks if this feature is supported.
42387  */
42388 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42389
42390 /**
42391  * Set this feature as optional.
42392  */
42393 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42394
42395 /**
42396  * Set this feature as required.
42397  */
42398 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42399
42400 /**
42401  * Checks if this feature is supported.
42402  */
42403 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42404
42405 /**
42406  * Set this feature as optional.
42407  */
42408 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42409
42410 /**
42411  * Set this feature as required.
42412  */
42413 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42414
42415 /**
42416  * Checks if this feature is supported.
42417  */
42418 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42419
42420 /**
42421  * Checks if this feature is required.
42422  */
42423 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42424
42425 /**
42426  * Checks if this feature is required.
42427  */
42428 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42429
42430 /**
42431  * Checks if this feature is required.
42432  */
42433 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42434
42435 /**
42436  * Set this feature as optional.
42437  */
42438 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42439
42440 /**
42441  * Set this feature as required.
42442  */
42443 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42444
42445 /**
42446  * Checks if this feature is supported.
42447  */
42448 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42449
42450 /**
42451  * Checks if this feature is required.
42452  */
42453 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42454
42455 /**
42456  * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
42457  */
42458 void ShutdownScript_free(struct LDKShutdownScript this_obj);
42459
42460 /**
42461  * Creates a copy of the ShutdownScript
42462  */
42463 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
42464
42465 /**
42466  * Checks if two ShutdownScripts contain equal inner contents.
42467  * This ignores pointers and is_owned flags and looks at the values in fields.
42468  * Two objects with NULL inner values will be considered "equal" here.
42469  */
42470 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
42471
42472 /**
42473  * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
42474  */
42475 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
42476
42477 /**
42478  * The script that did not meet the requirements from [BOLT #2].
42479  *
42480  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
42481  */
42482 struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
42483
42484 /**
42485  * The script that did not meet the requirements from [BOLT #2].
42486  *
42487  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
42488  */
42489 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42490
42491 /**
42492  * Constructs a new InvalidShutdownScript given each field
42493  */
42494 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
42495
42496 /**
42497  * Creates a copy of the InvalidShutdownScript
42498  */
42499 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
42500
42501 /**
42502  * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
42503  */
42504 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
42505
42506 /**
42507  * Read a ShutdownScript from a byte array, created by ShutdownScript_write
42508  */
42509 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
42510
42511 /**
42512  * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
42513  */
42514 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
42515
42516 /**
42517  * Generates a P2WSH script pubkey from the given [`WScriptHash`].
42518  */
42519 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
42520
42521 /**
42522  * Generates a witness script pubkey from the given segwit version and program.
42523  *
42524  * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
42525  * [`ShutdownScript::new_p2wsh`] instead.
42526  *
42527  * # Errors
42528  *
42529  * This function may return an error if `program` is invalid for the segwit `version`.
42530  */
42531 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
42532
42533 /**
42534  * Converts the shutdown script into the underlying [`ScriptBuf`].
42535  */
42536 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
42537
42538 /**
42539  * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
42540  *
42541  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42542  */
42543 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
42544
42545 /**
42546  * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
42547  *
42548  * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
42549  */
42550 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
42551
42552 /**
42553  * Frees any resources used by the Retry
42554  */
42555 void Retry_free(struct LDKRetry this_ptr);
42556
42557 /**
42558  * Creates a copy of the Retry
42559  */
42560 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
42561
42562 /**
42563  * Utility method to constructs a new Attempts-variant Retry
42564  */
42565 struct LDKRetry Retry_attempts(uint32_t a);
42566
42567 /**
42568  * Utility method to constructs a new Timeout-variant Retry
42569  */
42570 struct LDKRetry Retry_timeout(uint64_t a);
42571
42572 /**
42573  * Checks if two Retrys contain equal inner contents.
42574  * This ignores pointers and is_owned flags and looks at the values in fields.
42575  */
42576 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
42577
42578 /**
42579  * Generates a non-cryptographic 64-bit hash of the Retry.
42580  */
42581 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
42582
42583 /**
42584  * Serialize the Retry object into a byte array which can be read by Retry_read
42585  */
42586 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
42587
42588 /**
42589  * Read a Retry from a byte array, created by Retry_write
42590  */
42591 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
42592
42593 /**
42594  * Creates a copy of the RetryableSendFailure
42595  */
42596 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
42597
42598 /**
42599  * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
42600  */
42601 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
42602
42603 /**
42604  * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
42605  */
42606 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
42607
42608 /**
42609  * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
42610  */
42611 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
42612
42613 /**
42614  * Checks if two RetryableSendFailures contain equal inner contents.
42615  * This ignores pointers and is_owned flags and looks at the values in fields.
42616  */
42617 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
42618
42619 /**
42620  * Frees any resources used by the PaymentSendFailure
42621  */
42622 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
42623
42624 /**
42625  * Creates a copy of the PaymentSendFailure
42626  */
42627 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
42628
42629 /**
42630  * Utility method to constructs a new ParameterError-variant PaymentSendFailure
42631  */
42632 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
42633
42634 /**
42635  * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
42636  */
42637 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
42638
42639 /**
42640  * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
42641  */
42642 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
42643
42644 /**
42645  * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
42646  */
42647 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
42648
42649 /**
42650  * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
42651  */
42652 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
42653
42654 /**
42655  * Checks if two PaymentSendFailures contain equal inner contents.
42656  * This ignores pointers and is_owned flags and looks at the values in fields.
42657  */
42658 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
42659
42660 /**
42661  * Frees any resources used by the ProbeSendFailure
42662  */
42663 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
42664
42665 /**
42666  * Creates a copy of the ProbeSendFailure
42667  */
42668 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
42669
42670 /**
42671  * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
42672  */
42673 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
42674
42675 /**
42676  * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
42677  */
42678 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
42679
42680 /**
42681  * Checks if two ProbeSendFailures contain equal inner contents.
42682  * This ignores pointers and is_owned flags and looks at the values in fields.
42683  */
42684 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
42685
42686 /**
42687  * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
42688  */
42689 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
42690
42691 /**
42692  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
42693  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
42694  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
42695  * attacks.
42696  *
42697  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
42698  * multi-path payments require a recipient-provided secret.
42699  *
42700  * Some implementations may reject spontaneous payments with payment secrets, so you may only
42701  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
42702  * recipient will not reject it.
42703  */
42704 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
42705
42706 /**
42707  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
42708  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
42709  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
42710  * attacks.
42711  *
42712  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
42713  * multi-path payments require a recipient-provided secret.
42714  *
42715  * Some implementations may reject spontaneous payments with payment secrets, so you may only
42716  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
42717  * recipient will not reject it.
42718  */
42719 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
42720
42721 /**
42722  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
42723  * arbitrary length. This gives recipients substantially more flexibility to receive
42724  * additional data.
42725  *
42726  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
42727  * scheme to authenticate received payments against expected payments and invoices, this field
42728  * is not used in LDK for received payments, and can be used to store arbitrary data in
42729  * invoices which will be received with the payment.
42730  *
42731  * Note that this field was added to the lightning specification more recently than
42732  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
42733  * may not be supported as universally.
42734  *
42735  * Returns a copy of the field.
42736  */
42737 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
42738
42739 /**
42740  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
42741  * arbitrary length. This gives recipients substantially more flexibility to receive
42742  * additional data.
42743  *
42744  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
42745  * scheme to authenticate received payments against expected payments and invoices, this field
42746  * is not used in LDK for received payments, and can be used to store arbitrary data in
42747  * invoices which will be received with the payment.
42748  *
42749  * Note that this field was added to the lightning specification more recently than
42750  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
42751  * may not be supported as universally.
42752  */
42753 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
42754
42755 /**
42756  * Creates a copy of the RecipientOnionFields
42757  */
42758 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
42759
42760 /**
42761  * Checks if two RecipientOnionFieldss contain equal inner contents.
42762  * This ignores pointers and is_owned flags and looks at the values in fields.
42763  * Two objects with NULL inner values will be considered "equal" here.
42764  */
42765 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
42766
42767 /**
42768  * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
42769  */
42770 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
42771
42772 /**
42773  * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
42774  */
42775 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
42776
42777 /**
42778  * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
42779  * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
42780  * but do not require or provide any further data.
42781  */
42782 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
42783
42784 /**
42785  * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
42786  * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
42787  * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
42788  * a spontaneous MPP this will not work as all MPP require payment secrets; you may
42789  * instead want to use [`RecipientOnionFields::secret_only`].
42790  *
42791  * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
42792  * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
42793  */
42794 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
42795
42796 /**
42797  * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
42798  * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
42799  * respectively. TLV type numbers must be unique and within the range
42800  * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
42801  *
42802  * This method will also error for types in the experimental range which have been
42803  * standardized within the protocol, which only includes 5482373484 (keysend) for now.
42804  *
42805  * See [`Self::custom_tlvs`] for more info.
42806  */
42807 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
42808
42809 /**
42810  * Gets the custom TLVs that will be sent or have been received.
42811  *
42812  * Custom TLVs allow sending extra application-specific data with a payment. They provide
42813  * additional flexibility on top of payment metadata, as while other implementations may
42814  * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
42815  * do not have this restriction.
42816  *
42817  * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
42818  * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
42819  * This is validated when setting this field using [`Self::with_custom_tlvs`].
42820  */
42821 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
42822
42823 /**
42824  * Calls the free function if one is set
42825  */
42826 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
42827
42828 /**
42829  * Creates a copy of a Type
42830  */
42831 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
42832
42833 /**
42834  * Calls the free function if one is set
42835  */
42836 void Type_free(struct LDKType this_ptr);
42837
42838 /**
42839  * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
42840  */
42841 void Offer_free(struct LDKOffer this_obj);
42842
42843 /**
42844  * Creates a copy of the Offer
42845  */
42846 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
42847
42848 /**
42849  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
42850  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
42851  * for the selected chain.
42852  */
42853 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
42854
42855 /**
42856  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
42857  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
42858  */
42859 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
42860
42861 /**
42862  * The minimum amount required for a successful payment of a single item.
42863  *
42864  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42865  */
42866 MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
42867
42868 /**
42869  * A complete description of the purpose of the payment. Intended to be displayed to the user
42870  * but with the caveat that it has not been verified in any way.
42871  */
42872 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
42873
42874 /**
42875  * Features pertaining to the offer.
42876  */
42877 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
42878
42879 /**
42880  * Duration since the Unix epoch when an invoice should no longer be requested.
42881  *
42882  * If `None`, the offer does not expire.
42883  */
42884 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
42885
42886 /**
42887  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
42888  * displayed to the user but with the caveat that it has not been verified in any way.
42889  *
42890  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42891  */
42892 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
42893
42894 /**
42895  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
42896  * recipient privacy by obfuscating its node id.
42897  */
42898 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
42899
42900 /**
42901  * The quantity of items supported.
42902  */
42903 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
42904
42905 /**
42906  * The public key used by the recipient to sign invoices.
42907  */
42908 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
42909
42910 /**
42911  * Returns whether the given chain is supported by the offer.
42912  */
42913 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
42914
42915 /**
42916  * Whether the offer has expired.
42917  */
42918 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
42919
42920 /**
42921  * Whether the offer has expired given the duration since the Unix epoch.
42922  */
42923 MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
42924
42925 /**
42926  * Returns whether the given quantity is valid for the offer.
42927  */
42928 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
42929
42930 /**
42931  * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
42932  *
42933  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
42934  */
42935 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
42936
42937 /**
42938  * Serialize the Offer object into a byte array which can be read by Offer_read
42939  */
42940 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
42941
42942 /**
42943  * Frees any resources used by the Amount, if is_owned is set and inner is non-NULL.
42944  */
42945 void Amount_free(struct LDKAmount this_obj);
42946
42947 /**
42948  * Creates a copy of the Amount
42949  */
42950 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
42951
42952 /**
42953  * Frees any resources used by the Quantity, if is_owned is set and inner is non-NULL.
42954  */
42955 void Quantity_free(struct LDKQuantity this_obj);
42956
42957 /**
42958  * Creates a copy of the Quantity
42959  */
42960 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
42961
42962 /**
42963  * Read a Offer object from a string
42964  */
42965 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
42966
42967 /**
42968  * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
42969  */
42970 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
42971
42972 /**
42973  * Returns the [`TaggedHash`] of the invoice to sign.
42974  */
42975 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
42976
42977 /**
42978  * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
42979  */
42980 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
42981
42982 /**
42983  * Creates a copy of the Bolt12Invoice
42984  */
42985 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
42986
42987 /**
42988  * The chains that may be used when paying a requested invoice.
42989  *
42990  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
42991  *
42992  * [`Offer::chains`]: crate::offers::offer::Offer::chains
42993  */
42994 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
42995
42996 /**
42997  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
42998  * invoice originated from an offer.
42999  *
43000  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
43001  *
43002  * [`offer_chains`]: Self::offer_chains
43003  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
43004  */
43005 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43006
43007 /**
43008  * Opaque bytes set by the originating [`Offer`].
43009  *
43010  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
43011  * if the [`Offer`] did not set it.
43012  *
43013  * [`Offer`]: crate::offers::offer::Offer
43014  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
43015  */
43016 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43017
43018 /**
43019  * The minimum amount required for a successful payment of a single item.
43020  *
43021  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
43022  * the [`Offer`] did not set it.
43023  *
43024  * [`Offer`]: crate::offers::offer::Offer
43025  * [`Offer::amount`]: crate::offers::offer::Offer::amount
43026  *
43027  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43028  */
43029 MUST_USE_RES struct LDKAmount UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43030
43031 /**
43032  * Features pertaining to the originating [`Offer`].
43033  *
43034  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
43035  * [`Refund`].
43036  *
43037  * [`Offer`]: crate::offers::offer::Offer
43038  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
43039  *
43040  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43041  */
43042 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43043
43044 /**
43045  * A complete description of the purpose of the originating offer or refund.
43046  *
43047  * From [`Offer::description`] or [`Refund::description`].
43048  *
43049  * [`Offer::description`]: crate::offers::offer::Offer::description
43050  */
43051 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43052
43053 /**
43054  * Duration since the Unix epoch when an invoice should no longer be requested.
43055  *
43056  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
43057  *
43058  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
43059  */
43060 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43061
43062 /**
43063  * The issuer of the offer or refund.
43064  *
43065  * From [`Offer::issuer`] or [`Refund::issuer`].
43066  *
43067  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
43068  *
43069  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43070  */
43071 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43072
43073 /**
43074  * Paths to the recipient originating from publicly reachable nodes.
43075  *
43076  * From [`Offer::paths`] or [`Refund::paths`].
43077  *
43078  * [`Offer::paths`]: crate::offers::offer::Offer::paths
43079  */
43080 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43081
43082 /**
43083  * The quantity of items supported.
43084  *
43085  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
43086  * [`Refund`].
43087  *
43088  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
43089  *
43090  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43091  */
43092 MUST_USE_RES struct LDKQuantity UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43093
43094 /**
43095  * An unpredictable series of bytes from the payer.
43096  *
43097  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
43098  */
43099 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43100
43101 /**
43102  * Features pertaining to requesting an invoice.
43103  *
43104  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
43105  */
43106 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43107
43108 /**
43109  * The quantity of items requested or refunded for.
43110  *
43111  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
43112  */
43113 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43114
43115 /**
43116  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
43117  * refund in case there are no [`message_paths`].
43118  *
43119  * [`message_paths`]: Self::message_paths
43120  */
43121 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43122
43123 /**
43124  * A payer-provided note reflected back in the invoice.
43125  *
43126  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
43127  *
43128  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43129  */
43130 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43131
43132 /**
43133  * Duration since the Unix epoch when the invoice was created.
43134  */
43135 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43136
43137 /**
43138  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
43139  * should no longer be paid.
43140  */
43141 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43142
43143 /**
43144  * Whether the invoice has expired.
43145  */
43146 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43147
43148 /**
43149  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
43150  */
43151 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43152
43153 /**
43154  * The minimum amount required for a successful payment of the invoice.
43155  */
43156 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43157
43158 /**
43159  * Features pertaining to paying an invoice.
43160  */
43161 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43162
43163 /**
43164  * The public key corresponding to the key used to sign the invoice.
43165  */
43166 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43167
43168 /**
43169  * The chains that may be used when paying a requested invoice.
43170  *
43171  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
43172  *
43173  * [`Offer::chains`]: crate::offers::offer::Offer::chains
43174  */
43175 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43176
43177 /**
43178  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
43179  * invoice originated from an offer.
43180  *
43181  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
43182  *
43183  * [`offer_chains`]: Self::offer_chains
43184  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
43185  */
43186 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43187
43188 /**
43189  * Opaque bytes set by the originating [`Offer`].
43190  *
43191  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
43192  * if the [`Offer`] did not set it.
43193  *
43194  * [`Offer`]: crate::offers::offer::Offer
43195  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
43196  */
43197 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43198
43199 /**
43200  * The minimum amount required for a successful payment of a single item.
43201  *
43202  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
43203  * the [`Offer`] did not set it.
43204  *
43205  * [`Offer`]: crate::offers::offer::Offer
43206  * [`Offer::amount`]: crate::offers::offer::Offer::amount
43207  *
43208  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43209  */
43210 MUST_USE_RES struct LDKAmount Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43211
43212 /**
43213  * Features pertaining to the originating [`Offer`].
43214  *
43215  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
43216  * [`Refund`].
43217  *
43218  * [`Offer`]: crate::offers::offer::Offer
43219  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
43220  *
43221  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43222  */
43223 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43224
43225 /**
43226  * A complete description of the purpose of the originating offer or refund.
43227  *
43228  * From [`Offer::description`] or [`Refund::description`].
43229  *
43230  * [`Offer::description`]: crate::offers::offer::Offer::description
43231  */
43232 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43233
43234 /**
43235  * Duration since the Unix epoch when an invoice should no longer be requested.
43236  *
43237  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
43238  *
43239  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
43240  */
43241 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43242
43243 /**
43244  * The issuer of the offer or refund.
43245  *
43246  * From [`Offer::issuer`] or [`Refund::issuer`].
43247  *
43248  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
43249  *
43250  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43251  */
43252 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43253
43254 /**
43255  * Paths to the recipient originating from publicly reachable nodes.
43256  *
43257  * From [`Offer::paths`] or [`Refund::paths`].
43258  *
43259  * [`Offer::paths`]: crate::offers::offer::Offer::paths
43260  */
43261 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43262
43263 /**
43264  * The quantity of items supported.
43265  *
43266  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
43267  * [`Refund`].
43268  *
43269  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
43270  *
43271  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43272  */
43273 MUST_USE_RES struct LDKQuantity Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43274
43275 /**
43276  * An unpredictable series of bytes from the payer.
43277  *
43278  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
43279  */
43280 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43281
43282 /**
43283  * Features pertaining to requesting an invoice.
43284  *
43285  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
43286  */
43287 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43288
43289 /**
43290  * The quantity of items requested or refunded for.
43291  *
43292  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
43293  */
43294 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43295
43296 /**
43297  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
43298  * refund in case there are no [`message_paths`].
43299  *
43300  * [`message_paths`]: Self::message_paths
43301  */
43302 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43303
43304 /**
43305  * A payer-provided note reflected back in the invoice.
43306  *
43307  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
43308  *
43309  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43310  */
43311 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43312
43313 /**
43314  * Duration since the Unix epoch when the invoice was created.
43315  */
43316 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43317
43318 /**
43319  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
43320  * should no longer be paid.
43321  */
43322 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43323
43324 /**
43325  * Whether the invoice has expired.
43326  */
43327 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43328
43329 /**
43330  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
43331  */
43332 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43333
43334 /**
43335  * The minimum amount required for a successful payment of the invoice.
43336  */
43337 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43338
43339 /**
43340  * Features pertaining to paying an invoice.
43341  */
43342 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43343
43344 /**
43345  * The public key corresponding to the key used to sign the invoice.
43346  */
43347 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43348
43349 /**
43350  * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
43351  */
43352 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43353
43354 /**
43355  * Hash that was used for signing the invoice.
43356  */
43357 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43358
43359 /**
43360  * Verifies that the invoice was for a request or refund created using the given key. Returns
43361  * the associated [`PaymentId`] to use when sending the payment.
43362  */
43363 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
43364
43365 /**
43366  * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
43367  */
43368 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
43369
43370 /**
43371  * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
43372  */
43373 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
43374
43375 /**
43376  * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
43377  */
43378 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
43379
43380 /**
43381  * Base fee charged (in millisatoshi) for the entire blinded path.
43382  */
43383 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43384
43385 /**
43386  * Base fee charged (in millisatoshi) for the entire blinded path.
43387  */
43388 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
43389
43390 /**
43391  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
43392  * (i.e., 10,000 is 1%).
43393  */
43394 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43395
43396 /**
43397  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
43398  * (i.e., 10,000 is 1%).
43399  */
43400 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
43401
43402 /**
43403  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
43404  * path.
43405  */
43406 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43407
43408 /**
43409  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
43410  * path.
43411  */
43412 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
43413
43414 /**
43415  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
43416  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
43417  * seen by the recipient.
43418  */
43419 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43420
43421 /**
43422  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
43423  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
43424  * seen by the recipient.
43425  */
43426 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
43427
43428 /**
43429  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
43430  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
43431  * seen by the recipient.
43432  */
43433 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43434
43435 /**
43436  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
43437  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
43438  * seen by the recipient.
43439  */
43440 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
43441
43442 /**
43443  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
43444  * onion payload.
43445  */
43446 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43447
43448 /**
43449  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
43450  * onion payload.
43451  */
43452 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
43453
43454 /**
43455  * Constructs a new BlindedPayInfo given each field
43456  */
43457 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);
43458
43459 /**
43460  * Creates a copy of the BlindedPayInfo
43461  */
43462 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
43463
43464 /**
43465  * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
43466  */
43467 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
43468
43469 /**
43470  * Checks if two BlindedPayInfos contain equal inner contents.
43471  * This ignores pointers and is_owned flags and looks at the values in fields.
43472  * Two objects with NULL inner values will be considered "equal" here.
43473  */
43474 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
43475
43476 /**
43477  * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
43478  */
43479 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
43480
43481 /**
43482  * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
43483  */
43484 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
43485
43486 /**
43487  * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
43488  */
43489 void InvoiceError_free(struct LDKInvoiceError this_obj);
43490
43491 /**
43492  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
43493  *
43494  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
43495  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43496  *
43497  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43498  */
43499 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
43500
43501 /**
43502  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
43503  *
43504  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
43505  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43506  *
43507  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
43508  */
43509 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
43510
43511 /**
43512  * An explanation of the error.
43513  */
43514 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
43515
43516 /**
43517  * An explanation of the error.
43518  */
43519 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
43520
43521 /**
43522  * Constructs a new InvoiceError given each field
43523  *
43524  * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
43525  */
43526 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
43527
43528 /**
43529  * Creates a copy of the InvoiceError
43530  */
43531 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
43532
43533 /**
43534  * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
43535  */
43536 void ErroneousField_free(struct LDKErroneousField this_obj);
43537
43538 /**
43539  * The type number of the TLV field containing the error.
43540  */
43541 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
43542
43543 /**
43544  * The type number of the TLV field containing the error.
43545  */
43546 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
43547
43548 /**
43549  * A value to use for the TLV field to avoid the error.
43550  *
43551  * Returns a copy of the field.
43552  */
43553 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
43554
43555 /**
43556  * A value to use for the TLV field to avoid the error.
43557  */
43558 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
43559
43560 /**
43561  * Constructs a new ErroneousField given each field
43562  */
43563 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
43564
43565 /**
43566  * Creates a copy of the ErroneousField
43567  */
43568 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
43569
43570 /**
43571  * Creates an [`InvoiceError`] with the given message.
43572  */
43573 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
43574
43575 /**
43576  * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
43577  */
43578 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
43579
43580 /**
43581  * Read a InvoiceError from a byte array, created by InvoiceError_write
43582  */
43583 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
43584
43585 /**
43586  * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
43587  */
43588 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
43589
43590 /**
43591  * Returns the [`TaggedHash`] of the invoice to sign.
43592  */
43593 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43594
43595 /**
43596  * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
43597  */
43598 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
43599
43600 /**
43601  * Creates a copy of the InvoiceRequest
43602  */
43603 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
43604
43605 /**
43606  * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
43607  */
43608 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
43609
43610 /**
43611  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
43612  *
43613  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
43614  * [`respond_with`].
43615  *
43616  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43617  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
43618  * [`respond_with`]: Self::respond_with
43619  */
43620 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
43621
43622 /**
43623  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
43624  *
43625  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
43626  * [`respond_with`].
43627  *
43628  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43629  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
43630  * [`respond_with`]: Self::respond_with
43631  */
43632 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
43633
43634 /**
43635  * Creates a copy of the VerifiedInvoiceRequest
43636  */
43637 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
43638
43639 /**
43640  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
43641  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
43642  * for the selected chain.
43643  */
43644 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43645
43646 /**
43647  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
43648  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
43649  */
43650 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43651
43652 /**
43653  * The minimum amount required for a successful payment of a single item.
43654  *
43655  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43656  */
43657 MUST_USE_RES struct LDKAmount UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43658
43659 /**
43660  * A complete description of the purpose of the payment. Intended to be displayed to the user
43661  * but with the caveat that it has not been verified in any way.
43662  */
43663 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43664
43665 /**
43666  * Features pertaining to the offer.
43667  */
43668 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43669
43670 /**
43671  * Duration since the Unix epoch when an invoice should no longer be requested.
43672  *
43673  * If `None`, the offer does not expire.
43674  */
43675 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43676
43677 /**
43678  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
43679  * displayed to the user but with the caveat that it has not been verified in any way.
43680  *
43681  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43682  */
43683 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43684
43685 /**
43686  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
43687  * recipient privacy by obfuscating its node id.
43688  */
43689 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43690
43691 /**
43692  * The quantity of items supported.
43693  */
43694 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43695
43696 /**
43697  * The public key used by the recipient to sign invoices.
43698  */
43699 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43700
43701 /**
43702  * An unpredictable series of bytes, typically containing information about the derivation of
43703  * [`payer_id`].
43704  *
43705  * [`payer_id`]: Self::payer_id
43706  */
43707 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43708
43709 /**
43710  * A chain from [`Offer::chains`] that the offer is valid for.
43711  */
43712 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43713
43714 /**
43715  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
43716  * must be greater than or equal to [`Offer::amount`], converted if necessary.
43717  *
43718  * [`chain`]: Self::chain
43719  */
43720 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43721
43722 /**
43723  * Features pertaining to requesting an invoice.
43724  */
43725 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43726
43727 /**
43728  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
43729  */
43730 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43731
43732 /**
43733  * A possibly transient pubkey used to sign the invoice request.
43734  */
43735 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43736
43737 /**
43738  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
43739  * response.
43740  *
43741  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43742  */
43743 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43744
43745 /**
43746  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
43747  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
43748  * for the selected chain.
43749  */
43750 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43751
43752 /**
43753  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
43754  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
43755  */
43756 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43757
43758 /**
43759  * The minimum amount required for a successful payment of a single item.
43760  *
43761  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43762  */
43763 MUST_USE_RES struct LDKAmount InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43764
43765 /**
43766  * A complete description of the purpose of the payment. Intended to be displayed to the user
43767  * but with the caveat that it has not been verified in any way.
43768  */
43769 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43770
43771 /**
43772  * Features pertaining to the offer.
43773  */
43774 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43775
43776 /**
43777  * Duration since the Unix epoch when an invoice should no longer be requested.
43778  *
43779  * If `None`, the offer does not expire.
43780  */
43781 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43782
43783 /**
43784  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
43785  * displayed to the user but with the caveat that it has not been verified in any way.
43786  *
43787  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43788  */
43789 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43790
43791 /**
43792  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
43793  * recipient privacy by obfuscating its node id.
43794  */
43795 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43796
43797 /**
43798  * The quantity of items supported.
43799  */
43800 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43801
43802 /**
43803  * The public key used by the recipient to sign invoices.
43804  */
43805 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43806
43807 /**
43808  * An unpredictable series of bytes, typically containing information about the derivation of
43809  * [`payer_id`].
43810  *
43811  * [`payer_id`]: Self::payer_id
43812  */
43813 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43814
43815 /**
43816  * A chain from [`Offer::chains`] that the offer is valid for.
43817  */
43818 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43819
43820 /**
43821  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
43822  * must be greater than or equal to [`Offer::amount`], converted if necessary.
43823  *
43824  * [`chain`]: Self::chain
43825  */
43826 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43827
43828 /**
43829  * Features pertaining to requesting an invoice.
43830  */
43831 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43832
43833 /**
43834  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
43835  */
43836 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43837
43838 /**
43839  * A possibly transient pubkey used to sign the invoice request.
43840  */
43841 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43842
43843 /**
43844  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
43845  * response.
43846  *
43847  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43848  */
43849 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43850
43851 /**
43852  * Signature of the invoice request using [`payer_id`].
43853  *
43854  * [`payer_id`]: Self::payer_id
43855  */
43856 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43857
43858 /**
43859  * Verifies that the request was for an offer created using the given key. Returns the verified
43860  * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
43861  * if they could be extracted from the metadata.
43862  *
43863  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43864  */
43865 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
43866
43867 /**
43868  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
43869  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
43870  * for the selected chain.
43871  */
43872 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43873
43874 /**
43875  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
43876  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
43877  */
43878 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43879
43880 /**
43881  * The minimum amount required for a successful payment of a single item.
43882  *
43883  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43884  */
43885 MUST_USE_RES struct LDKAmount VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43886
43887 /**
43888  * A complete description of the purpose of the payment. Intended to be displayed to the user
43889  * but with the caveat that it has not been verified in any way.
43890  */
43891 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43892
43893 /**
43894  * Features pertaining to the offer.
43895  */
43896 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43897
43898 /**
43899  * Duration since the Unix epoch when an invoice should no longer be requested.
43900  *
43901  * If `None`, the offer does not expire.
43902  */
43903 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43904
43905 /**
43906  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
43907  * displayed to the user but with the caveat that it has not been verified in any way.
43908  *
43909  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43910  */
43911 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43912
43913 /**
43914  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
43915  * recipient privacy by obfuscating its node id.
43916  */
43917 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43918
43919 /**
43920  * The quantity of items supported.
43921  */
43922 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43923
43924 /**
43925  * The public key used by the recipient to sign invoices.
43926  */
43927 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43928
43929 /**
43930  * An unpredictable series of bytes, typically containing information about the derivation of
43931  * [`payer_id`].
43932  *
43933  * [`payer_id`]: Self::payer_id
43934  */
43935 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43936
43937 /**
43938  * A chain from [`Offer::chains`] that the offer is valid for.
43939  */
43940 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43941
43942 /**
43943  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
43944  * must be greater than or equal to [`Offer::amount`], converted if necessary.
43945  *
43946  * [`chain`]: Self::chain
43947  */
43948 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43949
43950 /**
43951  * Features pertaining to requesting an invoice.
43952  */
43953 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43954
43955 /**
43956  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
43957  */
43958 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43959
43960 /**
43961  * A possibly transient pubkey used to sign the invoice request.
43962  */
43963 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43964
43965 /**
43966  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
43967  * response.
43968  *
43969  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43970  */
43971 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43972
43973 /**
43974  * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
43975  */
43976 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
43977
43978 /**
43979  * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
43980  */
43981 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
43982
43983 /**
43984  * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
43985  */
43986 void TaggedHash_free(struct LDKTaggedHash this_obj);
43987
43988 /**
43989  * Creates a copy of the TaggedHash
43990  */
43991 struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
43992
43993 /**
43994  * Returns the digest to sign.
43995  */
43996 MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
43997
43998 /**
43999  * Returns the tag used in the tagged hash.
44000  */
44001 MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
44002
44003 /**
44004  * Returns the merkle root used in the tagged hash.
44005  */
44006 MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
44007
44008 /**
44009  * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
44010  */
44011 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
44012
44013 /**
44014  * Creates a copy of the Bolt12ParseError
44015  */
44016 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
44017
44018 /**
44019  * Creates a copy of the Bolt12SemanticError
44020  */
44021 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
44022
44023 /**
44024  * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
44025  */
44026 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
44027
44028 /**
44029  * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
44030  */
44031 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
44032
44033 /**
44034  * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
44035  */
44036 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
44037
44038 /**
44039  * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
44040  */
44041 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
44042
44043 /**
44044  * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
44045  */
44046 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
44047
44048 /**
44049  * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
44050  */
44051 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
44052
44053 /**
44054  * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
44055  */
44056 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
44057
44058 /**
44059  * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
44060  */
44061 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
44062
44063 /**
44064  * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
44065  */
44066 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
44067
44068 /**
44069  * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
44070  */
44071 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
44072
44073 /**
44074  * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
44075  */
44076 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
44077
44078 /**
44079  * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
44080  */
44081 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
44082
44083 /**
44084  * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
44085  */
44086 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
44087
44088 /**
44089  * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
44090  */
44091 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
44092
44093 /**
44094  * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
44095  */
44096 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
44097
44098 /**
44099  * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
44100  */
44101 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
44102
44103 /**
44104  * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
44105  */
44106 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
44107
44108 /**
44109  * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
44110  */
44111 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
44112
44113 /**
44114  * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
44115  */
44116 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
44117
44118 /**
44119  * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
44120  */
44121 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
44122
44123 /**
44124  * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
44125  */
44126 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
44127
44128 /**
44129  * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
44130  */
44131 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
44132
44133 /**
44134  * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
44135  */
44136 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
44137
44138 /**
44139  * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
44140  */
44141 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
44142
44143 /**
44144  * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
44145  */
44146 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
44147
44148 /**
44149  * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
44150  */
44151 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
44152
44153 /**
44154  * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
44155  */
44156 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
44157
44158 /**
44159  * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
44160  */
44161 void Refund_free(struct LDKRefund this_obj);
44162
44163 /**
44164  * Creates a copy of the Refund
44165  */
44166 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
44167
44168 /**
44169  * A complete description of the purpose of the refund. Intended to be displayed to the user
44170  * but with the caveat that it has not been verified in any way.
44171  */
44172 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
44173
44174 /**
44175  * Duration since the Unix epoch when an invoice should no longer be sent.
44176  *
44177  * If `None`, the refund does not expire.
44178  */
44179 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
44180
44181 /**
44182  * Whether the refund has expired.
44183  */
44184 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
44185
44186 /**
44187  * Whether the refund has expired given the duration since the Unix epoch.
44188  */
44189 MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
44190
44191 /**
44192  * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
44193  * displayed to the user but with the caveat that it has not been verified in any way.
44194  *
44195  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44196  */
44197 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
44198
44199 /**
44200  * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
44201  * privacy by obfuscating its node id.
44202  */
44203 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
44204
44205 /**
44206  * An unpredictable series of bytes, typically containing information about the derivation of
44207  * [`payer_id`].
44208  *
44209  * [`payer_id`]: Self::payer_id
44210  */
44211 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
44212
44213 /**
44214  * A chain that the refund is valid for.
44215  */
44216 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
44217
44218 /**
44219  * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
44220  *
44221  * [`chain`]: Self::chain
44222  */
44223 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
44224
44225 /**
44226  * Features pertaining to requesting an invoice.
44227  */
44228 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
44229
44230 /**
44231  * The quantity of an item that refund is for.
44232  */
44233 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
44234
44235 /**
44236  * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
44237  * transient pubkey.
44238  *
44239  * [`paths`]: Self::paths
44240  */
44241 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
44242
44243 /**
44244  * Payer provided note to include in the invoice.
44245  *
44246  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44247  */
44248 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
44249
44250 /**
44251  * Serialize the Refund object into a byte array which can be read by Refund_read
44252  */
44253 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
44254
44255 /**
44256  * Read a Refund object from a string
44257  */
44258 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
44259
44260 /**
44261  * Creates a copy of the UtxoLookupError
44262  */
44263 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
44264
44265 /**
44266  * Utility method to constructs a new UnknownChain-variant UtxoLookupError
44267  */
44268 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
44269
44270 /**
44271  * Utility method to constructs a new UnknownTx-variant UtxoLookupError
44272  */
44273 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
44274
44275 /**
44276  * Frees any resources used by the UtxoResult
44277  */
44278 void UtxoResult_free(struct LDKUtxoResult this_ptr);
44279
44280 /**
44281  * Creates a copy of the UtxoResult
44282  */
44283 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
44284
44285 /**
44286  * Utility method to constructs a new Sync-variant UtxoResult
44287  */
44288 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
44289
44290 /**
44291  * Utility method to constructs a new Async-variant UtxoResult
44292  */
44293 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
44294
44295 /**
44296  * Calls the free function if one is set
44297  */
44298 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
44299
44300 /**
44301  * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
44302  */
44303 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
44304
44305 /**
44306  * Creates a copy of the UtxoFuture
44307  */
44308 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
44309
44310 /**
44311  * Builds a new future for later resolution.
44312  */
44313 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
44314
44315 /**
44316  * Resolves this future against the given `graph` and with the given `result`.
44317  *
44318  * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
44319  * forwarding the validated gossip message onwards to peers.
44320  *
44321  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
44322  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
44323  * after this.
44324  *
44325  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
44326  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
44327  */
44328 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
44329
44330 /**
44331  * Resolves this future against the given `graph` and with the given `result`.
44332  *
44333  * The given `gossip` is used to broadcast any validated messages onwards to all peers which
44334  * have available buffer space.
44335  *
44336  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
44337  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
44338  * after this.
44339  *
44340  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
44341  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
44342  */
44343 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);
44344
44345 /**
44346  * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
44347  */
44348 void NodeId_free(struct LDKNodeId this_obj);
44349
44350 /**
44351  * Creates a copy of the NodeId
44352  */
44353 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
44354
44355 /**
44356  * Create a new NodeId from a public key
44357  */
44358 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
44359
44360 /**
44361  * Get the public key slice from this NodeId
44362  */
44363 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
44364
44365 /**
44366  * Get the public key as an array from this NodeId
44367  */
44368 MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
44369
44370 /**
44371  * Get the public key from this NodeId
44372  */
44373 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
44374
44375 /**
44376  * Generates a non-cryptographic 64-bit hash of the NodeId.
44377  */
44378 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
44379
44380 /**
44381  * Serialize the NodeId object into a byte array which can be read by NodeId_read
44382  */
44383 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
44384
44385 /**
44386  * Read a NodeId from a byte array, created by NodeId_write
44387  */
44388 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
44389
44390 /**
44391  * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
44392  */
44393 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
44394
44395 /**
44396  * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
44397  */
44398 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
44399
44400 /**
44401  * Frees any resources used by the NetworkUpdate
44402  */
44403 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
44404
44405 /**
44406  * Creates a copy of the NetworkUpdate
44407  */
44408 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
44409
44410 /**
44411  * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
44412  */
44413 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
44414
44415 /**
44416  * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
44417  */
44418 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
44419
44420 /**
44421  * Utility method to constructs a new NodeFailure-variant NetworkUpdate
44422  */
44423 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
44424
44425 /**
44426  * Checks if two NetworkUpdates contain equal inner contents.
44427  * This ignores pointers and is_owned flags and looks at the values in fields.
44428  */
44429 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
44430
44431 /**
44432  * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
44433  */
44434 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
44435
44436 /**
44437  * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
44438  */
44439 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
44440
44441 /**
44442  * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
44443  */
44444 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
44445
44446 /**
44447  * Creates a new tracker of the actual state of the network of channels and nodes,
44448  * assuming an existing [`NetworkGraph`].
44449  * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
44450  * correct, and the announcement is signed with channel owners' keys.
44451  */
44452 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
44453
44454 /**
44455  * Adds a provider used to check new announcements. Does not affect
44456  * existing announcements unless they are updated.
44457  * Add, update or remove the provider would replace the current one.
44458  */
44459 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
44460
44461 /**
44462  * Handles any network updates originating from [`Event`]s.
44463  * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
44464  * leaking possibly identifying information of the sender to the public network.
44465  *
44466  * [`Event`]: crate::events::Event
44467  */
44468 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
44469
44470 /**
44471  * Gets the chain hash for this network graph.
44472  */
44473 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
44474
44475 /**
44476  * Verifies the signature of a [`NodeAnnouncement`].
44477  *
44478  * Returns an error if it is invalid.
44479  */
44480 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
44481
44482 /**
44483  * Verifies all signatures included in a [`ChannelAnnouncement`].
44484  *
44485  * Returns an error if one of the signatures is invalid.
44486  */
44487 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
44488
44489 /**
44490  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
44491  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
44492  */
44493 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
44494
44495 /**
44496  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
44497  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
44498  */
44499 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
44500
44501 /**
44502  * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
44503  */
44504 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
44505
44506 /**
44507  * When the last update to the channel direction was issued.
44508  * Value is opaque, as set in the announcement.
44509  */
44510 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44511
44512 /**
44513  * When the last update to the channel direction was issued.
44514  * Value is opaque, as set in the announcement.
44515  */
44516 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
44517
44518 /**
44519  * Whether the channel can be currently used for payments (in this one direction).
44520  */
44521 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44522
44523 /**
44524  * Whether the channel can be currently used for payments (in this one direction).
44525  */
44526 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
44527
44528 /**
44529  * The difference in CLTV values that you must have when routing through this channel.
44530  */
44531 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44532
44533 /**
44534  * The difference in CLTV values that you must have when routing through this channel.
44535  */
44536 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
44537
44538 /**
44539  * The minimum value, which must be relayed to the next hop via the channel
44540  */
44541 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44542
44543 /**
44544  * The minimum value, which must be relayed to the next hop via the channel
44545  */
44546 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
44547
44548 /**
44549  * The maximum value which may be relayed to the next hop via the channel.
44550  */
44551 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44552
44553 /**
44554  * The maximum value which may be relayed to the next hop via the channel.
44555  */
44556 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
44557
44558 /**
44559  * Fees charged when the channel is used for routing
44560  */
44561 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44562
44563 /**
44564  * Fees charged when the channel is used for routing
44565  */
44566 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
44567
44568 /**
44569  * Most recent update for the channel received from the network
44570  * Mostly redundant with the data we store in fields explicitly.
44571  * Everything else is useful only for sending out for initial routing sync.
44572  * Not stored if contains excess data to prevent DoS.
44573  *
44574  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44575  */
44576 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44577
44578 /**
44579  * Most recent update for the channel received from the network
44580  * Mostly redundant with the data we store in fields explicitly.
44581  * Everything else is useful only for sending out for initial routing sync.
44582  * Not stored if contains excess data to prevent DoS.
44583  *
44584  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44585  */
44586 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
44587
44588 /**
44589  * Constructs a new ChannelUpdateInfo given each field
44590  *
44591  * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44592  */
44593 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);
44594
44595 /**
44596  * Creates a copy of the ChannelUpdateInfo
44597  */
44598 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
44599
44600 /**
44601  * Checks if two ChannelUpdateInfos contain equal inner contents.
44602  * This ignores pointers and is_owned flags and looks at the values in fields.
44603  * Two objects with NULL inner values will be considered "equal" here.
44604  */
44605 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
44606
44607 /**
44608  * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
44609  */
44610 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
44611
44612 /**
44613  * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
44614  */
44615 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
44616
44617 /**
44618  * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
44619  */
44620 void ChannelInfo_free(struct LDKChannelInfo this_obj);
44621
44622 /**
44623  * Protocol features of a channel communicated during its announcement
44624  */
44625 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44626
44627 /**
44628  * Protocol features of a channel communicated during its announcement
44629  */
44630 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
44631
44632 /**
44633  * Source node of the first direction of a channel
44634  */
44635 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44636
44637 /**
44638  * Source node of the first direction of a channel
44639  */
44640 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
44641
44642 /**
44643  * Details about the first direction of a channel
44644  *
44645  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44646  */
44647 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44648
44649 /**
44650  * Details about the first direction of a channel
44651  *
44652  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44653  */
44654 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
44655
44656 /**
44657  * Source node of the second direction of a channel
44658  */
44659 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44660
44661 /**
44662  * Source node of the second direction of a channel
44663  */
44664 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
44665
44666 /**
44667  * Details about the second direction of a channel
44668  *
44669  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44670  */
44671 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44672
44673 /**
44674  * Details about the second direction of a channel
44675  *
44676  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44677  */
44678 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
44679
44680 /**
44681  * The channel capacity as seen on-chain, if chain lookup is available.
44682  */
44683 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44684
44685 /**
44686  * The channel capacity as seen on-chain, if chain lookup is available.
44687  */
44688 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
44689
44690 /**
44691  * An initial announcement of the channel
44692  * Mostly redundant with the data we store in fields explicitly.
44693  * Everything else is useful only for sending out for initial routing sync.
44694  * Not stored if contains excess data to prevent DoS.
44695  *
44696  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44697  */
44698 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44699
44700 /**
44701  * An initial announcement of the channel
44702  * Mostly redundant with the data we store in fields explicitly.
44703  * Everything else is useful only for sending out for initial routing sync.
44704  * Not stored if contains excess data to prevent DoS.
44705  *
44706  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44707  */
44708 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
44709
44710 /**
44711  * Creates a copy of the ChannelInfo
44712  */
44713 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
44714
44715 /**
44716  * Checks if two ChannelInfos contain equal inner contents.
44717  * This ignores pointers and is_owned flags and looks at the values in fields.
44718  * Two objects with NULL inner values will be considered "equal" here.
44719  */
44720 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
44721
44722 /**
44723  * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
44724  *
44725  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44726  */
44727 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
44728
44729 /**
44730  * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
44731  */
44732 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
44733
44734 /**
44735  * Read a ChannelInfo from a byte array, created by ChannelInfo_write
44736  */
44737 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
44738
44739 /**
44740  * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
44741  */
44742 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
44743
44744 /**
44745  * Creates a copy of the DirectedChannelInfo
44746  */
44747 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
44748
44749 /**
44750  * Returns information for the channel.
44751  */
44752 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
44753
44754 /**
44755  * Returns the [`EffectiveCapacity`] of the channel in the direction.
44756  *
44757  * This is either the total capacity from the funding transaction, if known, or the
44758  * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
44759  * otherwise.
44760  */
44761 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
44762
44763 /**
44764  * Frees any resources used by the EffectiveCapacity
44765  */
44766 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
44767
44768 /**
44769  * Creates a copy of the EffectiveCapacity
44770  */
44771 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
44772
44773 /**
44774  * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
44775  */
44776 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
44777
44778 /**
44779  * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
44780  */
44781 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
44782
44783 /**
44784  * Utility method to constructs a new Total-variant EffectiveCapacity
44785  */
44786 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
44787
44788 /**
44789  * Utility method to constructs a new Infinite-variant EffectiveCapacity
44790  */
44791 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
44792
44793 /**
44794  * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
44795  */
44796 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
44797
44798 /**
44799  * Utility method to constructs a new Unknown-variant EffectiveCapacity
44800  */
44801 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
44802
44803 /**
44804  * Returns the effective capacity denominated in millisatoshi.
44805  */
44806 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
44807
44808 /**
44809  * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
44810  */
44811 void RoutingFees_free(struct LDKRoutingFees this_obj);
44812
44813 /**
44814  * Flat routing fee in millisatoshis.
44815  */
44816 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
44817
44818 /**
44819  * Flat routing fee in millisatoshis.
44820  */
44821 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
44822
44823 /**
44824  * Liquidity-based routing fee in millionths of a routed amount.
44825  * In other words, 10000 is 1%.
44826  */
44827 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
44828
44829 /**
44830  * Liquidity-based routing fee in millionths of a routed amount.
44831  * In other words, 10000 is 1%.
44832  */
44833 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
44834
44835 /**
44836  * Constructs a new RoutingFees given each field
44837  */
44838 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
44839
44840 /**
44841  * Checks if two RoutingFeess contain equal inner contents.
44842  * This ignores pointers and is_owned flags and looks at the values in fields.
44843  * Two objects with NULL inner values will be considered "equal" here.
44844  */
44845 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
44846
44847 /**
44848  * Creates a copy of the RoutingFees
44849  */
44850 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
44851
44852 /**
44853  * Generates a non-cryptographic 64-bit hash of the RoutingFees.
44854  */
44855 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
44856
44857 /**
44858  * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
44859  */
44860 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
44861
44862 /**
44863  * Read a RoutingFees from a byte array, created by RoutingFees_write
44864  */
44865 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
44866
44867 /**
44868  * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
44869  */
44870 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
44871
44872 /**
44873  * Protocol features the node announced support for
44874  */
44875 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
44876
44877 /**
44878  * Protocol features the node announced support for
44879  */
44880 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
44881
44882 /**
44883  * When the last known update to the node state was issued.
44884  * Value is opaque, as set in the announcement.
44885  */
44886 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
44887
44888 /**
44889  * When the last known update to the node state was issued.
44890  * Value is opaque, as set in the announcement.
44891  */
44892 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
44893
44894 /**
44895  * Color assigned to the node
44896  */
44897 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
44898
44899 /**
44900  * Color assigned to the node
44901  */
44902 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
44903
44904 /**
44905  * Moniker assigned to the node.
44906  * May be invalid or malicious (eg control chars),
44907  * should not be exposed to the user.
44908  */
44909 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
44910
44911 /**
44912  * Moniker assigned to the node.
44913  * May be invalid or malicious (eg control chars),
44914  * should not be exposed to the user.
44915  */
44916 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
44917
44918 /**
44919  * An initial announcement of the node
44920  * Mostly redundant with the data we store in fields explicitly.
44921  * Everything else is useful only for sending out for initial routing sync.
44922  * Not stored if contains excess data to prevent DoS.
44923  *
44924  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44925  */
44926 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
44927
44928 /**
44929  * An initial announcement of the node
44930  * Mostly redundant with the data we store in fields explicitly.
44931  * Everything else is useful only for sending out for initial routing sync.
44932  * Not stored if contains excess data to prevent DoS.
44933  *
44934  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44935  */
44936 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
44937
44938 /**
44939  * Constructs a new NodeAnnouncementInfo given each field
44940  *
44941  * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44942  */
44943 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);
44944
44945 /**
44946  * Creates a copy of the NodeAnnouncementInfo
44947  */
44948 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
44949
44950 /**
44951  * Checks if two NodeAnnouncementInfos contain equal inner contents.
44952  * This ignores pointers and is_owned flags and looks at the values in fields.
44953  * Two objects with NULL inner values will be considered "equal" here.
44954  */
44955 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
44956
44957 /**
44958  * Internet-level addresses via which one can connect to the node
44959  */
44960 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
44961
44962 /**
44963  * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
44964  */
44965 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
44966
44967 /**
44968  * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
44969  */
44970 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
44971
44972 /**
44973  * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
44974  */
44975 void NodeAlias_free(struct LDKNodeAlias this_obj);
44976
44977 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
44978
44979 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44980
44981 /**
44982  * Constructs a new NodeAlias given each field
44983  */
44984 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
44985
44986 /**
44987  * Creates a copy of the NodeAlias
44988  */
44989 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
44990
44991 /**
44992  * Generates a non-cryptographic 64-bit hash of the NodeAlias.
44993  */
44994 uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
44995
44996 /**
44997  * Checks if two NodeAliass contain equal inner contents.
44998  * This ignores pointers and is_owned flags and looks at the values in fields.
44999  * Two objects with NULL inner values will be considered "equal" here.
45000  */
45001 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
45002
45003 /**
45004  * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
45005  */
45006 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
45007
45008 /**
45009  * Read a NodeAlias from a byte array, created by NodeAlias_write
45010  */
45011 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
45012
45013 /**
45014  * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
45015  */
45016 void NodeInfo_free(struct LDKNodeInfo this_obj);
45017
45018 /**
45019  * All valid channels a node has announced
45020  *
45021  * Returns a copy of the field.
45022  */
45023 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
45024
45025 /**
45026  * All valid channels a node has announced
45027  */
45028 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
45029
45030 /**
45031  * More information about a node from node_announcement.
45032  * Optional because we store a Node entry after learning about it from
45033  * a channel announcement, but before receiving a node announcement.
45034  *
45035  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45036  */
45037 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
45038
45039 /**
45040  * More information about a node from node_announcement.
45041  * Optional because we store a Node entry after learning about it from
45042  * a channel announcement, but before receiving a node announcement.
45043  *
45044  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45045  */
45046 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
45047
45048 /**
45049  * Constructs a new NodeInfo given each field
45050  *
45051  * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45052  */
45053 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
45054
45055 /**
45056  * Creates a copy of the NodeInfo
45057  */
45058 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
45059
45060 /**
45061  * Checks if two NodeInfos contain equal inner contents.
45062  * This ignores pointers and is_owned flags and looks at the values in fields.
45063  * Two objects with NULL inner values will be considered "equal" here.
45064  */
45065 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
45066
45067 /**
45068  * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
45069  */
45070 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
45071
45072 /**
45073  * Read a NodeInfo from a byte array, created by NodeInfo_write
45074  */
45075 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
45076
45077 /**
45078  * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
45079  */
45080 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
45081
45082 /**
45083  * Read a NetworkGraph from a byte array, created by NetworkGraph_write
45084  */
45085 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
45086
45087 /**
45088  * Creates a new, empty, network graph.
45089  */
45090 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
45091
45092 /**
45093  * Returns a read-only view of the network graph.
45094  */
45095 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
45096
45097 /**
45098  * The unix timestamp provided by the most recent rapid gossip sync.
45099  * It will be set by the rapid sync process after every sync completion.
45100  */
45101 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
45102
45103 /**
45104  * Update the unix timestamp provided by the most recent rapid gossip sync.
45105  * This should be done automatically by the rapid sync process after every sync completion.
45106  */
45107 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
45108
45109 /**
45110  * For an already known node (from channel announcements), update its stored properties from a
45111  * given node announcement.
45112  *
45113  * You probably don't want to call this directly, instead relying on a P2PGossipSync's
45114  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
45115  * routing messages from a source using a protocol other than the lightning P2P protocol.
45116  */
45117 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
45118
45119 /**
45120  * For an already known node (from channel announcements), update its stored properties from a
45121  * given node announcement without verifying the associated signatures. Because we aren't
45122  * given the associated signatures here we cannot relay the node announcement to any of our
45123  * peers.
45124  */
45125 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);
45126
45127 /**
45128  * Store or update channel info from a channel announcement.
45129  *
45130  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
45131  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
45132  * routing messages from a source using a protocol other than the lightning P2P protocol.
45133  *
45134  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
45135  * the corresponding UTXO exists on chain and is correctly-formatted.
45136  */
45137 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);
45138
45139 /**
45140  * Store or update channel info from a channel announcement.
45141  *
45142  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
45143  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
45144  * routing messages from a source using a protocol other than the lightning P2P protocol.
45145  *
45146  * This will skip verification of if the channel is actually on-chain.
45147  */
45148 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);
45149
45150 /**
45151  * Store or update channel info from a channel announcement without verifying the associated
45152  * signatures. Because we aren't given the associated signatures here we cannot relay the
45153  * channel announcement to any of our peers.
45154  *
45155  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
45156  * the corresponding UTXO exists on chain and is correctly-formatted.
45157  */
45158 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);
45159
45160 /**
45161  * Update channel from partial announcement data received via rapid gossip sync
45162  *
45163  * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
45164  * rapid gossip sync server)
45165  *
45166  * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
45167  */
45168 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);
45169
45170 /**
45171  * Marks a channel in the graph as failed permanently.
45172  *
45173  * The channel and any node for which this was their last channel are removed from the graph.
45174  */
45175 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
45176
45177 /**
45178  * Marks a node in the graph as permanently failed, effectively removing it and its channels
45179  * from local storage.
45180  */
45181 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
45182
45183 /**
45184  * Removes information about channels that we haven't heard any updates about in some time.
45185  * This can be used regularly to prune the network graph of channels that likely no longer
45186  * exist.
45187  *
45188  * While there is no formal requirement that nodes regularly re-broadcast their channel
45189  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
45190  * pruning occur for updates which are at least two weeks old, which we implement here.
45191  *
45192  * Note that for users of the `lightning-background-processor` crate this method may be
45193  * automatically called regularly for you.
45194  *
45195  * This method will also cause us to stop tracking removed nodes and channels if they have been
45196  * in the map for a while so that these can be resynced from gossip in the future.
45197  *
45198  * This method is only available with the `std` feature. See
45199  * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
45200  */
45201 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
45202
45203 /**
45204  * Removes information about channels that we haven't heard any updates about in some time.
45205  * This can be used regularly to prune the network graph of channels that likely no longer
45206  * exist.
45207  *
45208  * While there is no formal requirement that nodes regularly re-broadcast their channel
45209  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
45210  * pruning occur for updates which are at least two weeks old, which we implement here.
45211  *
45212  * This method will also cause us to stop tracking removed nodes and channels if they have been
45213  * in the map for a while so that these can be resynced from gossip in the future.
45214  *
45215  * This function takes the current unix time as an argument. For users with the `std` feature
45216  * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
45217  */
45218 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
45219
45220 /**
45221  * For an already known (from announcement) channel, update info about one of the directions
45222  * of the channel.
45223  *
45224  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
45225  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
45226  * routing messages from a source using a protocol other than the lightning P2P protocol.
45227  *
45228  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
45229  * materially in the future will be rejected.
45230  */
45231 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
45232
45233 /**
45234  * For an already known (from announcement) channel, update info about one of the directions
45235  * of the channel without verifying the associated signatures. Because we aren't given the
45236  * associated signatures here we cannot relay the channel update to any of our peers.
45237  *
45238  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
45239  * materially in the future will be rejected.
45240  */
45241 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
45242
45243 /**
45244  * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
45245  *
45246  * This checks whether the update currently is applicable by [`Self::update_channel`].
45247  *
45248  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
45249  * materially in the future will be rejected.
45250  */
45251 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
45252
45253 /**
45254  * Returns information on a channel with the given id.
45255  *
45256  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45257  */
45258 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
45259
45260 /**
45261  * Returns the list of channels in the graph
45262  */
45263 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
45264
45265 /**
45266  * Returns information on a node with the given id.
45267  *
45268  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45269  */
45270 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
45271
45272 /**
45273  * Returns the list of nodes in the graph
45274  */
45275 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
45276
45277 /**
45278  * Get network addresses by node id.
45279  * Returns None if the requested node is completely unknown,
45280  * or if node announcement for the node was never received.
45281  */
45282 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
45283
45284 /**
45285  * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
45286  */
45287 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
45288
45289 /**
45290  * Creates a new router.
45291  */
45292 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
45293
45294 /**
45295  * Constructs a new Router which calls the relevant methods on this_arg.
45296  * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
45297  */
45298 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
45299
45300 /**
45301  * Constructs a new MessageRouter which calls the relevant methods on this_arg.
45302  * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
45303  */
45304 struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
45305
45306 /**
45307  * Calls the free function if one is set
45308  */
45309 void Router_free(struct LDKRouter this_ptr);
45310
45311 /**
45312  * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
45313  */
45314 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
45315
45316 /**
45317  * Initialize a new `ScorerAccountingForInFlightHtlcs`.
45318  */
45319 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
45320
45321 /**
45322  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
45323  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
45324  */
45325 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
45326
45327 /**
45328  * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
45329  */
45330 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
45331
45332 /**
45333  * Creates a copy of the InFlightHtlcs
45334  */
45335 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
45336
45337 /**
45338  * Constructs an empty `InFlightHtlcs`.
45339  */
45340 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
45341
45342 /**
45343  * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
45344  */
45345 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
45346
45347 /**
45348  * Adds a known HTLC given the public key of the HTLC source, target, and short channel
45349  * id.
45350  */
45351 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);
45352
45353 /**
45354  * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
45355  * id.
45356  */
45357 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);
45358
45359 /**
45360  * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
45361  */
45362 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
45363
45364 /**
45365  * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
45366  */
45367 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
45368
45369 /**
45370  * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
45371  */
45372 void RouteHop_free(struct LDKRouteHop this_obj);
45373
45374 /**
45375  * The node_id of the node at this hop.
45376  */
45377 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45378
45379 /**
45380  * The node_id of the node at this hop.
45381  */
45382 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
45383
45384 /**
45385  * The node_announcement features of the node at this hop. For the last hop, these may be
45386  * amended to match the features present in the invoice this node generated.
45387  */
45388 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45389
45390 /**
45391  * The node_announcement features of the node at this hop. For the last hop, these may be
45392  * amended to match the features present in the invoice this node generated.
45393  */
45394 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
45395
45396 /**
45397  * The channel that should be used from the previous hop to reach this node.
45398  */
45399 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45400
45401 /**
45402  * The channel that should be used from the previous hop to reach this node.
45403  */
45404 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
45405
45406 /**
45407  * The channel_announcement features of the channel that should be used from the previous hop
45408  * to reach this node.
45409  */
45410 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45411
45412 /**
45413  * The channel_announcement features of the channel that should be used from the previous hop
45414  * to reach this node.
45415  */
45416 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
45417
45418 /**
45419  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
45420  * If this is the last hop in [`Path::hops`]:
45421  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
45422  * * otherwise, this is the full value of this [`Path`]'s part of the payment
45423  *
45424  * [`BlindedPath`]: crate::blinded_path::BlindedPath
45425  */
45426 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45427
45428 /**
45429  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
45430  * If this is the last hop in [`Path::hops`]:
45431  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
45432  * * otherwise, this is the full value of this [`Path`]'s part of the payment
45433  *
45434  * [`BlindedPath`]: crate::blinded_path::BlindedPath
45435  */
45436 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
45437
45438 /**
45439  * The CLTV delta added for this hop.
45440  * If this is the last hop in [`Path::hops`]:
45441  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
45442  * * otherwise, this is the CLTV delta expected at the destination
45443  *
45444  * [`BlindedPath`]: crate::blinded_path::BlindedPath
45445  */
45446 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45447
45448 /**
45449  * The CLTV delta added for this hop.
45450  * If this is the last hop in [`Path::hops`]:
45451  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
45452  * * otherwise, this is the CLTV delta expected at the destination
45453  *
45454  * [`BlindedPath`]: crate::blinded_path::BlindedPath
45455  */
45456 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
45457
45458 /**
45459  * Indicates whether this hop is possibly announced in the public network graph.
45460  *
45461  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
45462  * either know for sure it's announced in the public graph, or if any public channels exist
45463  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
45464  * the channel to be unannounced.
45465  *
45466  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
45467  */
45468 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45469
45470 /**
45471  * Indicates whether this hop is possibly announced in the public network graph.
45472  *
45473  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
45474  * either know for sure it's announced in the public graph, or if any public channels exist
45475  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
45476  * the channel to be unannounced.
45477  *
45478  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
45479  */
45480 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
45481
45482 /**
45483  * Constructs a new RouteHop given each field
45484  */
45485 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);
45486
45487 /**
45488  * Creates a copy of the RouteHop
45489  */
45490 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
45491
45492 /**
45493  * Generates a non-cryptographic 64-bit hash of the RouteHop.
45494  */
45495 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
45496
45497 /**
45498  * Checks if two RouteHops contain equal inner contents.
45499  * This ignores pointers and is_owned flags and looks at the values in fields.
45500  * Two objects with NULL inner values will be considered "equal" here.
45501  */
45502 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
45503
45504 /**
45505  * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
45506  */
45507 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
45508
45509 /**
45510  * Read a RouteHop from a byte array, created by RouteHop_write
45511  */
45512 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
45513
45514 /**
45515  * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
45516  */
45517 void BlindedTail_free(struct LDKBlindedTail this_obj);
45518
45519 /**
45520  * The hops of the [`BlindedPath`] provided by the recipient.
45521  *
45522  * [`BlindedPath`]: crate::blinded_path::BlindedPath
45523  */
45524 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
45525
45526 /**
45527  * The hops of the [`BlindedPath`] provided by the recipient.
45528  *
45529  * [`BlindedPath`]: crate::blinded_path::BlindedPath
45530  */
45531 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
45532
45533 /**
45534  * The blinding point of the [`BlindedPath`] provided by the recipient.
45535  *
45536  * [`BlindedPath`]: crate::blinded_path::BlindedPath
45537  */
45538 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
45539
45540 /**
45541  * The blinding point of the [`BlindedPath`] provided by the recipient.
45542  *
45543  * [`BlindedPath`]: crate::blinded_path::BlindedPath
45544  */
45545 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
45546
45547 /**
45548  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
45549  * inferring the destination. May be 0.
45550  */
45551 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
45552
45553 /**
45554  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
45555  * inferring the destination. May be 0.
45556  */
45557 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
45558
45559 /**
45560  * The total amount paid on this [`Path`], excluding the fees.
45561  */
45562 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
45563
45564 /**
45565  * The total amount paid on this [`Path`], excluding the fees.
45566  */
45567 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
45568
45569 /**
45570  * Constructs a new BlindedTail given each field
45571  */
45572 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);
45573
45574 /**
45575  * Creates a copy of the BlindedTail
45576  */
45577 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
45578
45579 /**
45580  * Generates a non-cryptographic 64-bit hash of the BlindedTail.
45581  */
45582 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
45583
45584 /**
45585  * Checks if two BlindedTails contain equal inner contents.
45586  * This ignores pointers and is_owned flags and looks at the values in fields.
45587  * Two objects with NULL inner values will be considered "equal" here.
45588  */
45589 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
45590
45591 /**
45592  * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
45593  */
45594 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
45595
45596 /**
45597  * Read a BlindedTail from a byte array, created by BlindedTail_write
45598  */
45599 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
45600
45601 /**
45602  * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
45603  */
45604 void Path_free(struct LDKPath this_obj);
45605
45606 /**
45607  * The list of unblinded hops in this [`Path`]. Must be at least length one.
45608  */
45609 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
45610
45611 /**
45612  * The list of unblinded hops in this [`Path`]. Must be at least length one.
45613  */
45614 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
45615
45616 /**
45617  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
45618  *
45619  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45620  */
45621 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
45622
45623 /**
45624  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
45625  *
45626  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45627  */
45628 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
45629
45630 /**
45631  * Constructs a new Path given each field
45632  *
45633  * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45634  */
45635 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
45636
45637 /**
45638  * Creates a copy of the Path
45639  */
45640 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
45641
45642 /**
45643  * Generates a non-cryptographic 64-bit hash of the Path.
45644  */
45645 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
45646
45647 /**
45648  * Checks if two Paths contain equal inner contents.
45649  * This ignores pointers and is_owned flags and looks at the values in fields.
45650  * Two objects with NULL inner values will be considered "equal" here.
45651  */
45652 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
45653
45654 /**
45655  * Gets the fees for a given path, excluding any excess paid to the recipient.
45656  */
45657 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
45658
45659 /**
45660  * Gets the total amount paid on this [`Path`], excluding the fees.
45661  */
45662 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
45663
45664 /**
45665  * Gets the final hop's CLTV expiry delta.
45666  */
45667 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
45668
45669 /**
45670  * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
45671  */
45672 void Route_free(struct LDKRoute this_obj);
45673
45674 /**
45675  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
45676  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
45677  * the same.
45678  */
45679 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
45680
45681 /**
45682  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
45683  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
45684  * the same.
45685  */
45686 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
45687
45688 /**
45689  * The `route_params` parameter passed to [`find_route`].
45690  *
45691  * This is used by `ChannelManager` to track information which may be required for retries.
45692  *
45693  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
45694  *
45695  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45696  */
45697 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
45698
45699 /**
45700  * The `route_params` parameter passed to [`find_route`].
45701  *
45702  * This is used by `ChannelManager` to track information which may be required for retries.
45703  *
45704  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
45705  *
45706  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45707  */
45708 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
45709
45710 /**
45711  * Constructs a new Route given each field
45712  *
45713  * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45714  */
45715 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
45716
45717 /**
45718  * Creates a copy of the Route
45719  */
45720 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
45721
45722 /**
45723  * Generates a non-cryptographic 64-bit hash of the Route.
45724  */
45725 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
45726
45727 /**
45728  * Checks if two Routes contain equal inner contents.
45729  * This ignores pointers and is_owned flags and looks at the values in fields.
45730  * Two objects with NULL inner values will be considered "equal" here.
45731  */
45732 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
45733
45734 /**
45735  * Returns the total amount of fees paid on this [`Route`].
45736  *
45737  * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
45738  * the recipient, which can happen in excess of the amount passed to [`find_route`] via
45739  * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
45740  *
45741  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
45742  */
45743 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
45744
45745 /**
45746  * Returns the total amount paid on this [`Route`], excluding the fees.
45747  *
45748  * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
45749  * we had to reach the [`htlc_minimum_msat`] limits.
45750  *
45751  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
45752  */
45753 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
45754
45755 /**
45756  * Serialize the Route object into a byte array which can be read by Route_read
45757  */
45758 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
45759
45760 /**
45761  * Read a Route from a byte array, created by Route_write
45762  */
45763 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
45764
45765 /**
45766  * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
45767  */
45768 void RouteParameters_free(struct LDKRouteParameters this_obj);
45769
45770 /**
45771  * The parameters of the failed payment path.
45772  */
45773 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
45774
45775 /**
45776  * The parameters of the failed payment path.
45777  */
45778 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
45779
45780 /**
45781  * The amount in msats sent on the failed payment path.
45782  */
45783 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
45784
45785 /**
45786  * The amount in msats sent on the failed payment path.
45787  */
45788 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
45789
45790 /**
45791  * The maximum total fees, in millisatoshi, that may accrue during route finding.
45792  *
45793  * This limit also applies to the total fees that may arise while retrying failed payment
45794  * paths.
45795  *
45796  * Note that values below a few sats may result in some paths being spuriously ignored.
45797  */
45798 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
45799
45800 /**
45801  * The maximum total fees, in millisatoshi, that may accrue during route finding.
45802  *
45803  * This limit also applies to the total fees that may arise while retrying failed payment
45804  * paths.
45805  *
45806  * Note that values below a few sats may result in some paths being spuriously ignored.
45807  */
45808 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
45809
45810 /**
45811  * Constructs a new RouteParameters given each field
45812  */
45813 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);
45814
45815 /**
45816  * Creates a copy of the RouteParameters
45817  */
45818 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
45819
45820 /**
45821  * Generates a non-cryptographic 64-bit hash of the RouteParameters.
45822  */
45823 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
45824
45825 /**
45826  * Checks if two RouteParameterss contain equal inner contents.
45827  * This ignores pointers and is_owned flags and looks at the values in fields.
45828  * Two objects with NULL inner values will be considered "equal" here.
45829  */
45830 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
45831
45832 /**
45833  * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
45834  *
45835  * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
45836  */
45837 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
45838
45839 /**
45840  * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
45841  */
45842 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
45843
45844 /**
45845  * Read a RouteParameters from a byte array, created by RouteParameters_write
45846  */
45847 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
45848
45849 /**
45850  * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
45851  */
45852 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
45853
45854 /**
45855  * Information about the payee, such as their features and route hints for their channels.
45856  */
45857 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45858
45859 /**
45860  * Information about the payee, such as their features and route hints for their channels.
45861  */
45862 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
45863
45864 /**
45865  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
45866  */
45867 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45868
45869 /**
45870  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
45871  */
45872 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
45873
45874 /**
45875  * The maximum total CLTV delta we accept for the route.
45876  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
45877  */
45878 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45879
45880 /**
45881  * The maximum total CLTV delta we accept for the route.
45882  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
45883  */
45884 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
45885
45886 /**
45887  * The maximum number of paths that may be used by (MPP) payments.
45888  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
45889  */
45890 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45891
45892 /**
45893  * The maximum number of paths that may be used by (MPP) payments.
45894  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
45895  */
45896 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
45897
45898 /**
45899  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
45900  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
45901  * a lower value prefers to send larger MPP parts, potentially saturating channels and
45902  * increasing failure probability for those paths.
45903  *
45904  * Note that this restriction will be relaxed during pathfinding after paths which meet this
45905  * restriction have been found. While paths which meet this criteria will be searched for, it
45906  * is ultimately up to the scorer to select them over other paths.
45907  *
45908  * A value of 0 will allow payments up to and including a channel's total announced usable
45909  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
45910  *
45911  * Default value: 2
45912  */
45913 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45914
45915 /**
45916  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
45917  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
45918  * a lower value prefers to send larger MPP parts, potentially saturating channels and
45919  * increasing failure probability for those paths.
45920  *
45921  * Note that this restriction will be relaxed during pathfinding after paths which meet this
45922  * restriction have been found. While paths which meet this criteria will be searched for, it
45923  * is ultimately up to the scorer to select them over other paths.
45924  *
45925  * A value of 0 will allow payments up to and including a channel's total announced usable
45926  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
45927  *
45928  * Default value: 2
45929  */
45930 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
45931
45932 /**
45933  * A list of SCIDs which this payment was previously attempted over and which caused the
45934  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
45935  * these SCIDs.
45936  *
45937  * Returns a copy of the field.
45938  */
45939 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45940
45941 /**
45942  * A list of SCIDs which this payment was previously attempted over and which caused the
45943  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
45944  * these SCIDs.
45945  */
45946 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
45947
45948 /**
45949  * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
45950  * payment was previously attempted over and which caused the payment to fail. Future attempts
45951  * for the same payment shouldn't be relayed through any of these blinded paths.
45952  *
45953  * Returns a copy of the field.
45954  */
45955 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45956
45957 /**
45958  * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
45959  * payment was previously attempted over and which caused the payment to fail. Future attempts
45960  * for the same payment shouldn't be relayed through any of these blinded paths.
45961  */
45962 void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
45963
45964 /**
45965  * Constructs a new PaymentParameters given each field
45966  */
45967 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, struct LDKCVec_u64Z previously_failed_blinded_path_idxs_arg);
45968
45969 /**
45970  * Creates a copy of the PaymentParameters
45971  */
45972 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
45973
45974 /**
45975  * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
45976  */
45977 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
45978
45979 /**
45980  * Checks if two PaymentParameterss contain equal inner contents.
45981  * This ignores pointers and is_owned flags and looks at the values in fields.
45982  * Two objects with NULL inner values will be considered "equal" here.
45983  */
45984 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
45985
45986 /**
45987  * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
45988  */
45989 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
45990
45991 /**
45992  * Read a PaymentParameters from a byte array, created by PaymentParameters_write
45993  */
45994 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
45995
45996 /**
45997  * Creates a payee with the node id of the given `pubkey`.
45998  *
45999  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
46000  * provided.
46001  */
46002 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
46003
46004 /**
46005  * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
46006  *
46007  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
46008  * provided.
46009  *
46010  * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
46011  * whether your router will be allowed to find a multi-part route for this payment. If you
46012  * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
46013  * [`RecipientOnionFields::secret_only`].
46014  *
46015  * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
46016  */
46017 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
46018
46019 /**
46020  * Creates parameters for paying to a blinded payee from the provided invoice. Sets
46021  * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
46022  * [`PaymentParameters::expiry_time`].
46023  */
46024 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
46025
46026 /**
46027  * Creates parameters for paying to a blinded payee from the provided blinded route hints.
46028  */
46029 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
46030
46031 /**
46032  * Frees any resources used by the Payee
46033  */
46034 void Payee_free(struct LDKPayee this_ptr);
46035
46036 /**
46037  * Creates a copy of the Payee
46038  */
46039 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
46040
46041 /**
46042  * Utility method to constructs a new Blinded-variant Payee
46043  */
46044 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
46045
46046 /**
46047  * Utility method to constructs a new Clear-variant Payee
46048  */
46049 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
46050
46051 /**
46052  * Generates a non-cryptographic 64-bit hash of the Payee.
46053  */
46054 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
46055
46056 /**
46057  * Checks if two Payees contain equal inner contents.
46058  * This ignores pointers and is_owned flags and looks at the values in fields.
46059  */
46060 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
46061
46062 /**
46063  * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
46064  */
46065 void RouteHint_free(struct LDKRouteHint this_obj);
46066
46067 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
46068
46069 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
46070
46071 /**
46072  * Constructs a new RouteHint given each field
46073  */
46074 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
46075
46076 /**
46077  * Creates a copy of the RouteHint
46078  */
46079 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
46080
46081 /**
46082  * Generates a non-cryptographic 64-bit hash of the RouteHint.
46083  */
46084 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
46085
46086 /**
46087  * Checks if two RouteHints contain equal inner contents.
46088  * This ignores pointers and is_owned flags and looks at the values in fields.
46089  * Two objects with NULL inner values will be considered "equal" here.
46090  */
46091 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
46092
46093 /**
46094  * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
46095  */
46096 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
46097
46098 /**
46099  * Read a RouteHint from a byte array, created by RouteHint_write
46100  */
46101 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
46102
46103 /**
46104  * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
46105  */
46106 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
46107
46108 /**
46109  * The node_id of the non-target end of the route
46110  */
46111 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46112
46113 /**
46114  * The node_id of the non-target end of the route
46115  */
46116 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
46117
46118 /**
46119  * The short_channel_id of this channel
46120  */
46121 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46122
46123 /**
46124  * The short_channel_id of this channel
46125  */
46126 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
46127
46128 /**
46129  * The fees which must be paid to use this channel
46130  */
46131 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46132
46133 /**
46134  * The fees which must be paid to use this channel
46135  */
46136 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
46137
46138 /**
46139  * The difference in CLTV values between this node and the next node.
46140  */
46141 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46142
46143 /**
46144  * The difference in CLTV values between this node and the next node.
46145  */
46146 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
46147
46148 /**
46149  * The minimum value, in msat, which must be relayed to the next hop.
46150  */
46151 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46152
46153 /**
46154  * The minimum value, in msat, which must be relayed to the next hop.
46155  */
46156 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
46157
46158 /**
46159  * The maximum value in msat available for routing with a single HTLC.
46160  */
46161 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46162
46163 /**
46164  * The maximum value in msat available for routing with a single HTLC.
46165  */
46166 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
46167
46168 /**
46169  * Constructs a new RouteHintHop given each field
46170  */
46171 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);
46172
46173 /**
46174  * Creates a copy of the RouteHintHop
46175  */
46176 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
46177
46178 /**
46179  * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
46180  */
46181 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
46182
46183 /**
46184  * Checks if two RouteHintHops contain equal inner contents.
46185  * This ignores pointers and is_owned flags and looks at the values in fields.
46186  * Two objects with NULL inner values will be considered "equal" here.
46187  */
46188 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
46189
46190 /**
46191  * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
46192  */
46193 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
46194
46195 /**
46196  * Read a RouteHintHop from a byte array, created by RouteHintHop_write
46197  */
46198 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
46199
46200 /**
46201  * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
46202  */
46203 void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
46204
46205 /**
46206  * Creates a copy of the FirstHopCandidate
46207  */
46208 struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
46209
46210 /**
46211  * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
46212  */
46213 void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
46214
46215 /**
46216  * The short channel ID of the channel, i.e. the identifier by which we refer to this
46217  * channel.
46218  */
46219 uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
46220
46221 /**
46222  * The short channel ID of the channel, i.e. the identifier by which we refer to this
46223  * channel.
46224  */
46225 void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
46226
46227 /**
46228  * Creates a copy of the PublicHopCandidate
46229  */
46230 struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
46231
46232 /**
46233  * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
46234  */
46235 void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
46236
46237 /**
46238  * Creates a copy of the PrivateHopCandidate
46239  */
46240 struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
46241
46242 /**
46243  * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
46244  */
46245 void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
46246
46247 /**
46248  * Creates a copy of the BlindedPathCandidate
46249  */
46250 struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
46251
46252 /**
46253  * Frees any resources used by the OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
46254  */
46255 void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
46256
46257 /**
46258  * Creates a copy of the OneHopBlindedPathCandidate
46259  */
46260 struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
46261
46262 /**
46263  * Frees any resources used by the CandidateRouteHop
46264  */
46265 void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
46266
46267 /**
46268  * Creates a copy of the CandidateRouteHop
46269  */
46270 struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
46271
46272 /**
46273  * Utility method to constructs a new FirstHop-variant CandidateRouteHop
46274  */
46275 struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
46276
46277 /**
46278  * Utility method to constructs a new PublicHop-variant CandidateRouteHop
46279  */
46280 struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
46281
46282 /**
46283  * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
46284  */
46285 struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
46286
46287 /**
46288  * Utility method to constructs a new Blinded-variant CandidateRouteHop
46289  */
46290 struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
46291
46292 /**
46293  * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
46294  */
46295 struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
46296
46297 /**
46298  * Returns the globally unique short channel ID for this hop, if one is known.
46299  *
46300  * This only returns `Some` if the channel is public (either our own, or one we've learned
46301  * from the public network graph), and thus the short channel ID we have for this channel is
46302  * globally unique and identifies this channel in a global namespace.
46303  */
46304 MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46305
46306 /**
46307  * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
46308  * next-hop for an HTLC taking this hop.
46309  *
46310  * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
46311  * next-hop goes on chain with a payment preimage.
46312  */
46313 MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46314
46315 /**
46316  * Returns the minimum amount that can be sent over this hop, in millisatoshis.
46317  */
46318 MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46319
46320 /**
46321  * Returns the fees that must be paid to route an HTLC over this channel.
46322  */
46323 MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46324
46325 /**
46326  * Returns the source node id of current hop.
46327  *
46328  * Source node id refers to the node forwarding the HTLC through this hop.
46329  *
46330  * For [`Self::FirstHop`] we return payer's node id.
46331  */
46332 MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46333
46334 /**
46335  * Returns the target node id of this hop, if known.
46336  *
46337  * Target node id refers to the node receiving the HTLC after this hop.
46338  *
46339  * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
46340  * path is unknown.
46341  *
46342  * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
46343  * and such a return value would be somewhat nonsensical.
46344  *
46345  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46346  */
46347 MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46348
46349 /**
46350  * Finds a route from us (payer) to the given target node (payee).
46351  *
46352  * If the payee provided features in their invoice, they should be provided via the `payee` field
46353  * in the given [`RouteParameters::payment_params`].
46354  * Without this, MPP will only be used if the payee's features are available in the network graph.
46355  *
46356  * Private routing paths between a public node and the target may be included in the `payee` field
46357  * of [`RouteParameters::payment_params`].
46358  *
46359  * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
46360  * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
46361  * from `network_graph` will be ignored, and only those in `first_hops` will be used.
46362  *
46363  * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
46364  * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
46365  * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
46366  *
46367  * # Panics
46368  *
46369  * Panics if first_hops contains channels without `short_channel_id`s;
46370  * [`ChannelManager::list_usable_channels`] will never include such channels.
46371  *
46372  * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
46373  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
46374  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
46375  *
46376  * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
46377  */
46378 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]);
46379
46380 /**
46381  * Construct a route from us (payer) to the target node (payee) via the given hops (which should
46382  * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
46383  *
46384  * Re-uses logic from `find_route`, so the restrictions described there also apply here.
46385  */
46386 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]);
46387
46388 /**
46389  * Calls the free function if one is set
46390  */
46391 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
46392
46393 /**
46394  * Calls the free function if one is set
46395  */
46396 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
46397
46398 /**
46399  * Calls the free function if one is set
46400  */
46401 void Score_free(struct LDKScore this_ptr);
46402
46403 /**
46404  * Calls the free function if one is set
46405  */
46406 void LockableScore_free(struct LDKLockableScore this_ptr);
46407
46408 /**
46409  * Calls the free function if one is set
46410  */
46411 void WriteableScore_free(struct LDKWriteableScore this_ptr);
46412
46413 /**
46414  * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
46415  */
46416 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
46417
46418 /**
46419  * Constructs a new LockableScore which calls the relevant methods on this_arg.
46420  * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
46421  */
46422 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
46423
46424 /**
46425  * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
46426  */
46427 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
46428
46429 /**
46430  * Constructs a new WriteableScore which calls the relevant methods on this_arg.
46431  * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
46432  */
46433 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
46434
46435 /**
46436  * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
46437  */
46438 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
46439
46440 /**
46441  * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
46442  */
46443 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
46444
46445 /**
46446  * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
46447  */
46448 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
46449
46450 /**
46451  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
46452  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
46453  */
46454 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
46455
46456 /**
46457  * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
46458  */
46459 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
46460
46461 /**
46462  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
46463  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
46464  */
46465 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
46466
46467 /**
46468  * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
46469  */
46470 void ChannelUsage_free(struct LDKChannelUsage this_obj);
46471
46472 /**
46473  * The amount to send through the channel, denominated in millisatoshis.
46474  */
46475 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
46476
46477 /**
46478  * The amount to send through the channel, denominated in millisatoshis.
46479  */
46480 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
46481
46482 /**
46483  * Total amount, denominated in millisatoshis, already allocated to send through the channel
46484  * as part of a multi-path payment.
46485  */
46486 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
46487
46488 /**
46489  * Total amount, denominated in millisatoshis, already allocated to send through the channel
46490  * as part of a multi-path payment.
46491  */
46492 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
46493
46494 /**
46495  * The effective capacity of the channel.
46496  */
46497 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
46498
46499 /**
46500  * The effective capacity of the channel.
46501  */
46502 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
46503
46504 /**
46505  * Constructs a new ChannelUsage given each field
46506  */
46507 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
46508
46509 /**
46510  * Creates a copy of the ChannelUsage
46511  */
46512 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
46513
46514 /**
46515  * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
46516  */
46517 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
46518
46519 /**
46520  * Creates a copy of the FixedPenaltyScorer
46521  */
46522 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
46523
46524 /**
46525  * Creates a new scorer using `penalty_msat`.
46526  */
46527 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
46528
46529 /**
46530  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
46531  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
46532  */
46533 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
46534
46535 /**
46536  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
46537  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
46538  */
46539 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
46540
46541 /**
46542  * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
46543  */
46544 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
46545
46546 /**
46547  * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
46548  */
46549 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
46550
46551 /**
46552  * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
46553  */
46554 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
46555
46556 /**
46557  * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
46558  */
46559 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
46560
46561 /**
46562  * A fixed penalty in msats to apply to each channel.
46563  *
46564  * Default value: 500 msat
46565  */
46566 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46567
46568 /**
46569  * A fixed penalty in msats to apply to each channel.
46570  *
46571  * Default value: 500 msat
46572  */
46573 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46574
46575 /**
46576  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
46577  * applied to each channel, in excess of the [`base_penalty_msat`].
46578  *
46579  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
46580  * fees plus penalty) for large payments. The penalty is computed as the product of this
46581  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
46582  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
46583  *
46584  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
46585  *
46586  * Default value: 8,192 msat
46587  *
46588  * [`base_penalty_msat`]: Self::base_penalty_msat
46589  */
46590 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46591
46592 /**
46593  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
46594  * applied to each channel, in excess of the [`base_penalty_msat`].
46595  *
46596  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
46597  * fees plus penalty) for large payments. The penalty is computed as the product of this
46598  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
46599  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
46600  *
46601  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
46602  *
46603  * Default value: 8,192 msat
46604  *
46605  * [`base_penalty_msat`]: Self::base_penalty_msat
46606  */
46607 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46608
46609 /**
46610  * A multiplier used in conjunction with the negative `log10` of the channel's success
46611  * probability for a payment, as determined by our latest estimates of the channel's
46612  * liquidity, to determine the liquidity penalty.
46613  *
46614  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
46615  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
46616  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
46617  * lower bounding the success probability to `0.01`) when the amount falls within the
46618  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
46619  * result in a `u64::max_value` penalty, however.
46620  *
46621  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
46622  *
46623  * Default value: 30,000 msat
46624  *
46625  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
46626  */
46627 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46628
46629 /**
46630  * A multiplier used in conjunction with the negative `log10` of the channel's success
46631  * probability for a payment, as determined by our latest estimates of the channel's
46632  * liquidity, to determine the liquidity penalty.
46633  *
46634  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
46635  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
46636  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
46637  * lower bounding the success probability to `0.01`) when the amount falls within the
46638  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
46639  * result in a `u64::max_value` penalty, however.
46640  *
46641  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
46642  *
46643  * Default value: 30,000 msat
46644  *
46645  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
46646  */
46647 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46648
46649 /**
46650  * A multiplier used in conjunction with the total amount flowing over a channel and the
46651  * negative `log10` of the channel's success probability for the payment, as determined by our
46652  * latest estimates of the channel's liquidity, to determine the amount penalty.
46653  *
46654  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
46655  * fees plus penalty) for large payments. The penalty is computed as the product of this
46656  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
46657  * `log10` of the success probability.
46658  *
46659  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
46660  *
46661  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
46662  * the amount will result in a penalty of the multiplier. And, as the success probability
46663  * decreases, the negative `log10` weighting will increase dramatically. For higher success
46664  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
46665  * fall below `1`.
46666  *
46667  * Default value: 192 msat
46668  */
46669 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46670
46671 /**
46672  * A multiplier used in conjunction with the total amount flowing over a channel and the
46673  * negative `log10` of the channel's success probability for the payment, as determined by our
46674  * latest estimates of the channel's liquidity, to determine the amount penalty.
46675  *
46676  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
46677  * fees plus penalty) for large payments. The penalty is computed as the product of this
46678  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
46679  * `log10` of the success probability.
46680  *
46681  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
46682  *
46683  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
46684  * the amount will result in a penalty of the multiplier. And, as the success probability
46685  * decreases, the negative `log10` weighting will increase dramatically. For higher success
46686  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
46687  * fall below `1`.
46688  *
46689  * Default value: 192 msat
46690  */
46691 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46692
46693 /**
46694  * A multiplier used in conjunction with the negative `log10` of the channel's success
46695  * probability for the payment, as determined based on the history of our estimates of the
46696  * channel's available liquidity, to determine a penalty.
46697  *
46698  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
46699  * only our latest estimate for the current liquidity available in the channel, it estimates
46700  * success probability based on the estimated liquidity available in the channel through
46701  * history. Specifically, every time we update our liquidity bounds on a given channel, we
46702  * track which of several buckets those bounds fall into, exponentially decaying the
46703  * probability of each bucket as new samples are added.
46704  *
46705  * Default value: 10,000 msat
46706  *
46707  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
46708  */
46709 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46710
46711 /**
46712  * A multiplier used in conjunction with the negative `log10` of the channel's success
46713  * probability for the payment, as determined based on the history of our estimates of the
46714  * channel's available liquidity, to determine a penalty.
46715  *
46716  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
46717  * only our latest estimate for the current liquidity available in the channel, it estimates
46718  * success probability based on the estimated liquidity available in the channel through
46719  * history. Specifically, every time we update our liquidity bounds on a given channel, we
46720  * track which of several buckets those bounds fall into, exponentially decaying the
46721  * probability of each bucket as new samples are added.
46722  *
46723  * Default value: 10,000 msat
46724  *
46725  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
46726  */
46727 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46728
46729 /**
46730  * A multiplier used in conjunction with the total amount flowing over a channel and the
46731  * negative `log10` of the channel's success probability for the payment, as determined based
46732  * on the history of our estimates of the channel's available liquidity, to determine a
46733  * penalty.
46734  *
46735  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
46736  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
46737  * of the amount flowing over this channel, weighted by the negative `log10` of the success
46738  * probability.
46739  *
46740  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
46741  * of using only our latest estimate for the current liquidity available in the channel, it
46742  * estimates success probability based on the estimated liquidity available in the channel
46743  * through history. Specifically, every time we update our liquidity bounds on a given
46744  * channel, we track which of several buckets those bounds fall into, exponentially decaying
46745  * the probability of each bucket as new samples are added.
46746  *
46747  * Default value: 64 msat
46748  *
46749  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
46750  */
46751 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46752
46753 /**
46754  * A multiplier used in conjunction with the total amount flowing over a channel and the
46755  * negative `log10` of the channel's success probability for the payment, as determined based
46756  * on the history of our estimates of the channel's available liquidity, to determine a
46757  * penalty.
46758  *
46759  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
46760  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
46761  * of the amount flowing over this channel, weighted by the negative `log10` of the success
46762  * probability.
46763  *
46764  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
46765  * of using only our latest estimate for the current liquidity available in the channel, it
46766  * estimates success probability based on the estimated liquidity available in the channel
46767  * through history. Specifically, every time we update our liquidity bounds on a given
46768  * channel, we track which of several buckets those bounds fall into, exponentially decaying
46769  * the probability of each bucket as new samples are added.
46770  *
46771  * Default value: 64 msat
46772  *
46773  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
46774  */
46775 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46776
46777 /**
46778  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
46779  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
46780  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
46781  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
46782  * to restrict `htlc_maximum_msat` and improve privacy.
46783  *
46784  * Default value: 250 msat
46785  */
46786 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46787
46788 /**
46789  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
46790  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
46791  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
46792  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
46793  * to restrict `htlc_maximum_msat` and improve privacy.
46794  *
46795  * Default value: 250 msat
46796  */
46797 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46798
46799 /**
46800  * This penalty is applied when the total amount flowing over a channel exceeds our current
46801  * estimate of the channel's available liquidity. The total amount is the amount of the
46802  * current HTLC plus any HTLCs which we've sent over the same channel.
46803  *
46804  * Note that in this case all other penalties, including the
46805  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
46806  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
46807  * applicable, are still included in the overall penalty.
46808  *
46809  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
46810  * `u64::max_value()` will guarantee that.
46811  *
46812  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
46813  *
46814  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
46815  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
46816  * [`base_penalty_msat`]: Self::base_penalty_msat
46817  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
46818  */
46819 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46820
46821 /**
46822  * This penalty is applied when the total amount flowing over a channel exceeds our current
46823  * estimate of the channel's available liquidity. The total amount is the amount of the
46824  * current HTLC plus any HTLCs which we've sent over the same channel.
46825  *
46826  * Note that in this case all other penalties, including the
46827  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
46828  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
46829  * applicable, are still included in the overall penalty.
46830  *
46831  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
46832  * `u64::max_value()` will guarantee that.
46833  *
46834  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
46835  *
46836  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
46837  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
46838  * [`base_penalty_msat`]: Self::base_penalty_msat
46839  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
46840  */
46841 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46842
46843 /**
46844  * In order to calculate most of the scores above, we must first convert a lower and upper
46845  * bound on the available liquidity in a channel into the probability that we think a payment
46846  * will succeed. That probability is derived from a Probability Density Function for where we
46847  * think the liquidity in a channel likely lies, given such bounds.
46848  *
46849  * If this flag is set, that PDF is simply a constant - we assume that the actual available
46850  * liquidity in a channel is just as likely to be at any point between our lower and upper
46851  * bounds.
46852  *
46853  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
46854  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
46855  * matches experimental results - most routing nodes do not aggressively rebalance their
46856  * channels and flows in the network are often unbalanced, leaving liquidity usually
46857  * unavailable.
46858  *
46859  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
46860  * of floating-point multiplications in the hottest routing code, which may lead to routing
46861  * performance degradation on some machines.
46862  *
46863  * Default value: false
46864  */
46865 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46866
46867 /**
46868  * In order to calculate most of the scores above, we must first convert a lower and upper
46869  * bound on the available liquidity in a channel into the probability that we think a payment
46870  * will succeed. That probability is derived from a Probability Density Function for where we
46871  * think the liquidity in a channel likely lies, given such bounds.
46872  *
46873  * If this flag is set, that PDF is simply a constant - we assume that the actual available
46874  * liquidity in a channel is just as likely to be at any point between our lower and upper
46875  * bounds.
46876  *
46877  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
46878  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
46879  * matches experimental results - most routing nodes do not aggressively rebalance their
46880  * channels and flows in the network are often unbalanced, leaving liquidity usually
46881  * unavailable.
46882  *
46883  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
46884  * of floating-point multiplications in the hottest routing code, which may lead to routing
46885  * performance degradation on some machines.
46886  *
46887  * Default value: false
46888  */
46889 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
46890
46891 /**
46892  * Creates a copy of the ProbabilisticScoringFeeParameters
46893  */
46894 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
46895
46896 /**
46897  * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
46898  */
46899 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
46900
46901 /**
46902  * Marks the node with the given `node_id` as banned,
46903  * i.e it will be avoided during path finding.
46904  */
46905 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
46906
46907 /**
46908  * Marks all nodes in the given list as banned, i.e.,
46909  * they will be avoided during path finding.
46910  */
46911 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
46912
46913 /**
46914  * Removes the node with the given `node_id` from the list of nodes to avoid.
46915  */
46916 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
46917
46918 /**
46919  * Sets a manual penalty for the given node.
46920  */
46921 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
46922
46923 /**
46924  * Removes the node with the given `node_id` from the list of manual penalties.
46925  */
46926 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
46927
46928 /**
46929  * Clears the list of manual penalties that are applied during path finding.
46930  */
46931 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
46932
46933 /**
46934  * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
46935  */
46936 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
46937
46938 /**
46939  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
46940  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
46941  * seen a liquidity estimate update for this amount of time, the historical datapoints are
46942  * decayed by half.
46943  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
46944  *
46945  * Note that after 16 or more half lives all historical data will be completely gone.
46946  *
46947  * Default value: 14 days
46948  *
46949  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
46950  */
46951 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
46952
46953 /**
46954  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
46955  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
46956  * seen a liquidity estimate update for this amount of time, the historical datapoints are
46957  * decayed by half.
46958  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
46959  *
46960  * Note that after 16 or more half lives all historical data will be completely gone.
46961  *
46962  * Default value: 14 days
46963  *
46964  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
46965  */
46966 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
46967
46968 /**
46969  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
46970  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
46971  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
46972  * capacity.
46973  *
46974  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
46975  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
46976  * struct documentation for more info on the way the liquidity bounds are used.
46977  *
46978  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
46979  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
46980  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
46981  *
46982  * Default value: 6 hours
46983  *
46984  * # Note
46985  *
46986  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
46987  * liquidity knowledge will never decay except when the bounds cross.
46988  */
46989 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
46990
46991 /**
46992  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
46993  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
46994  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
46995  * capacity.
46996  *
46997  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
46998  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
46999  * struct documentation for more info on the way the liquidity bounds are used.
47000  *
47001  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
47002  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
47003  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
47004  *
47005  * Default value: 6 hours
47006  *
47007  * # Note
47008  *
47009  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
47010  * liquidity knowledge will never decay except when the bounds cross.
47011  */
47012 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
47013
47014 /**
47015  * Constructs a new ProbabilisticScoringDecayParameters given each field
47016  */
47017 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
47018
47019 /**
47020  * Creates a copy of the ProbabilisticScoringDecayParameters
47021  */
47022 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
47023
47024 /**
47025  * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
47026  */
47027 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
47028
47029 /**
47030  * Creates a new scorer using the given scoring parameters for sending payments from a node
47031  * through a network graph.
47032  */
47033 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
47034
47035 /**
47036  * Dump the contents of this scorer into the configured logger.
47037  *
47038  * Note that this writes roughly one line per channel for which we have a liquidity estimate,
47039  * which may be a substantial amount of log output.
47040  */
47041 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
47042
47043 /**
47044  * Query the estimated minimum and maximum liquidity available for sending a payment over the
47045  * channel with `scid` towards the given `target` node.
47046  */
47047 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);
47048
47049 /**
47050  * Query the historical estimated minimum and maximum liquidity available for sending a
47051  * payment over the channel with `scid` towards the given `target` node.
47052  *
47053  * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
47054  * the second set describes the upper-bound liquidity history. Each bucket describes the
47055  * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
47056  * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
47057  * more recent data points are weighted more heavily than older datapoints.
47058  *
47059  * Note that the range of each bucket varies by its location to provide more granular results
47060  * at the edges of a channel's capacity, where it is more likely to sit.
47061  *
47062  * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
47063  * is calculated by dividing that bucket's value with the total value of all buckets.
47064  *
47065  * For example, using a lower bucket count for illustrative purposes, a value of
47066  * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
47067  * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
47068  * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
47069  * in the top and bottom bucket, and roughly with similar (recent) frequency.
47070  *
47071  * Because the datapoints are decayed slowly over time, values will eventually return to
47072  * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
47073  *
47074  * In order to fetch a single success probability from the buckets provided here, as used in
47075  * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
47076  */
47077 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);
47078
47079 /**
47080  * Query the probability of payment success sending the given `amount_msat` over the channel
47081  * with `scid` towards the given `target` node, based on the historical estimated liquidity
47082  * bounds.
47083  *
47084  * These are the same bounds as returned by
47085  * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
47086  * [`Self::estimated_channel_liquidity_range`]).
47087  */
47088 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);
47089
47090 /**
47091  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
47092  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
47093  */
47094 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
47095
47096 /**
47097  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
47098  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
47099  */
47100 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
47101
47102 /**
47103  * Constructs a new Score which calls the relevant methods on this_arg.
47104  * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
47105  */
47106 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
47107
47108 /**
47109  * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
47110  */
47111 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
47112
47113 /**
47114  * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
47115  */
47116 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
47117
47118 /**
47119  * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
47120  */
47121 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
47122
47123 /**
47124  * The outpoint which is spendable.
47125  */
47126 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47127
47128 /**
47129  * The outpoint which is spendable.
47130  */
47131 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
47132
47133 /**
47134  * Per commitment point to derive the delayed payment key by key holder.
47135  */
47136 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47137
47138 /**
47139  * Per commitment point to derive the delayed payment key by key holder.
47140  */
47141 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
47142
47143 /**
47144  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
47145  * the witness_script.
47146  */
47147 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47148
47149 /**
47150  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
47151  * the witness_script.
47152  */
47153 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
47154
47155 /**
47156  * The output which is referenced by the given outpoint.
47157  */
47158 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47159
47160 /**
47161  * The output which is referenced by the given outpoint.
47162  */
47163 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
47164
47165 /**
47166  * The revocation point specific to the commitment transaction which was broadcast. Used to
47167  * derive the witnessScript for this output.
47168  */
47169 struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47170
47171 /**
47172  * The revocation point specific to the commitment transaction which was broadcast. Used to
47173  * derive the witnessScript for this output.
47174  */
47175 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
47176
47177 /**
47178  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
47179  * This may be useful in re-deriving keys used in the channel to spend the output.
47180  */
47181 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
47182
47183 /**
47184  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
47185  * This may be useful in re-deriving keys used in the channel to spend the output.
47186  */
47187 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47188
47189 /**
47190  * The value of the channel which this output originated from, possibly indirectly.
47191  */
47192 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47193
47194 /**
47195  * The value of the channel which this output originated from, possibly indirectly.
47196  */
47197 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
47198
47199 /**
47200  * Constructs a new DelayedPaymentOutputDescriptor given each field
47201  */
47202 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 LDKRevocationKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
47203
47204 /**
47205  * Creates a copy of the DelayedPaymentOutputDescriptor
47206  */
47207 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
47208
47209 /**
47210  * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
47211  */
47212 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
47213
47214 /**
47215  * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
47216  * This ignores pointers and is_owned flags and looks at the values in fields.
47217  * Two objects with NULL inner values will be considered "equal" here.
47218  */
47219 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
47220
47221 /**
47222  * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
47223  */
47224 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
47225
47226 /**
47227  * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
47228  */
47229 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
47230
47231 /**
47232  * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
47233  */
47234 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
47235
47236 /**
47237  * The outpoint which is spendable.
47238  */
47239 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47240
47241 /**
47242  * The outpoint which is spendable.
47243  */
47244 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
47245
47246 /**
47247  * The output which is referenced by the given outpoint.
47248  */
47249 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47250
47251 /**
47252  * The output which is referenced by the given outpoint.
47253  */
47254 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
47255
47256 /**
47257  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
47258  * This may be useful in re-deriving keys used in the channel to spend the output.
47259  */
47260 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
47261
47262 /**
47263  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
47264  * This may be useful in re-deriving keys used in the channel to spend the output.
47265  */
47266 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47267
47268 /**
47269  * The value of the channel which this transactions spends.
47270  */
47271 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47272
47273 /**
47274  * The value of the channel which this transactions spends.
47275  */
47276 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
47277
47278 /**
47279  * The necessary channel parameters that need to be provided to the re-derived signer through
47280  * [`ChannelSigner::provide_channel_parameters`].
47281  *
47282  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
47283  *
47284  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47285  */
47286 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47287
47288 /**
47289  * The necessary channel parameters that need to be provided to the re-derived signer through
47290  * [`ChannelSigner::provide_channel_parameters`].
47291  *
47292  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
47293  *
47294  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
47295  */
47296 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
47297
47298 /**
47299  * Constructs a new StaticPaymentOutputDescriptor given each field
47300  *
47301  * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
47302  */
47303 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);
47304
47305 /**
47306  * Creates a copy of the StaticPaymentOutputDescriptor
47307  */
47308 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
47309
47310 /**
47311  * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
47312  */
47313 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
47314
47315 /**
47316  * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
47317  * This ignores pointers and is_owned flags and looks at the values in fields.
47318  * Two objects with NULL inner values will be considered "equal" here.
47319  */
47320 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
47321
47322 /**
47323  * Returns the `witness_script` of the spendable output.
47324  *
47325  * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
47326  * originated from an anchor outputs channel, as they take the form of a P2WSH script.
47327  */
47328 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
47329
47330 /**
47331  * The maximum length a well-formed witness spending one of these should have.
47332  * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
47333  * shorter.
47334  */
47335 MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
47336
47337 /**
47338  * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
47339  */
47340 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
47341
47342 /**
47343  * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
47344  */
47345 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
47346
47347 /**
47348  * Frees any resources used by the SpendableOutputDescriptor
47349  */
47350 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
47351
47352 /**
47353  * Creates a copy of the SpendableOutputDescriptor
47354  */
47355 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
47356
47357 /**
47358  * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
47359  */
47360 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
47361
47362 /**
47363  * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
47364  */
47365 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
47366
47367 /**
47368  * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
47369  */
47370 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
47371
47372 /**
47373  * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
47374  */
47375 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
47376
47377 /**
47378  * Checks if two SpendableOutputDescriptors contain equal inner contents.
47379  * This ignores pointers and is_owned flags and looks at the values in fields.
47380  */
47381 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
47382
47383 /**
47384  * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
47385  */
47386 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
47387
47388 /**
47389  * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
47390  */
47391 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
47392
47393 /**
47394  * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
47395  * the given outputs, plus an output to the given change destination (if sufficient
47396  * change value remains). The PSBT will have a feerate, at least, of the given value.
47397  *
47398  * The `locktime` argument is used to set the transaction's locktime. If `None`, the
47399  * transaction will have a locktime of 0. It it recommended to set this to the current block
47400  * height to avoid fee sniping, unless you have some specific reason to use a different
47401  * locktime.
47402  *
47403  * Returns the PSBT and expected max transaction weight.
47404  *
47405  * Returns `Err(())` if the output value is greater than the input value minus required fee,
47406  * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
47407  * does not match the one we can spend.
47408  *
47409  * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
47410  */
47411 MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ 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);
47412
47413 /**
47414  * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
47415  */
47416 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
47417
47418 /**
47419  * The value in satoshis of the channel we're attempting to spend the anchor output of.
47420  */
47421 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
47422
47423 /**
47424  * The value in satoshis of the channel we're attempting to spend the anchor output of.
47425  */
47426 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
47427
47428 /**
47429  * The unique identifier to re-derive the signer for the associated channel.
47430  */
47431 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
47432
47433 /**
47434  * The unique identifier to re-derive the signer for the associated channel.
47435  */
47436 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47437
47438 /**
47439  * The necessary channel parameters that need to be provided to the re-derived signer through
47440  * [`ChannelSigner::provide_channel_parameters`].
47441  */
47442 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
47443
47444 /**
47445  * The necessary channel parameters that need to be provided to the re-derived signer through
47446  * [`ChannelSigner::provide_channel_parameters`].
47447  */
47448 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
47449
47450 /**
47451  * Constructs a new ChannelDerivationParameters given each field
47452  */
47453 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
47454
47455 /**
47456  * Creates a copy of the ChannelDerivationParameters
47457  */
47458 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
47459
47460 /**
47461  * Checks if two ChannelDerivationParameterss contain equal inner contents.
47462  * This ignores pointers and is_owned flags and looks at the values in fields.
47463  * Two objects with NULL inner values will be considered "equal" here.
47464  */
47465 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
47466
47467 /**
47468  * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
47469  */
47470 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
47471
47472 /**
47473  * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
47474  */
47475 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
47476
47477 /**
47478  * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
47479  */
47480 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
47481
47482 /**
47483  * The parameters required to derive the signer for the HTLC input.
47484  */
47485 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47486
47487 /**
47488  * The parameters required to derive the signer for the HTLC input.
47489  */
47490 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
47491
47492 /**
47493  * The number of the commitment transaction in which the HTLC output lives.
47494  */
47495 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47496
47497 /**
47498  * The number of the commitment transaction in which the HTLC output lives.
47499  */
47500 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
47501
47502 /**
47503  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
47504  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
47505  * arrive at unique keys per commitment.
47506  *
47507  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
47508  */
47509 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47510
47511 /**
47512  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
47513  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
47514  * arrive at unique keys per commitment.
47515  *
47516  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
47517  */
47518 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
47519
47520 /**
47521  * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
47522  * originating from a channel supporting anchor outputs, otherwise it is the channel's
47523  * negotiated feerate at the time the commitment transaction was built.
47524  */
47525 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47526
47527 /**
47528  * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
47529  * originating from a channel supporting anchor outputs, otherwise it is the channel's
47530  * negotiated feerate at the time the commitment transaction was built.
47531  */
47532 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
47533
47534 /**
47535  * The details of the HTLC as it appears in the commitment transaction.
47536  */
47537 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47538
47539 /**
47540  * The details of the HTLC as it appears in the commitment transaction.
47541  */
47542 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
47543
47544 /**
47545  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
47546  * taken.
47547  */
47548 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47549
47550 /**
47551  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
47552  * taken.
47553  */
47554 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
47555
47556 /**
47557  * The counterparty's signature required to spend the HTLC output.
47558  */
47559 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47560
47561 /**
47562  * The counterparty's signature required to spend the HTLC output.
47563  */
47564 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
47565
47566 /**
47567  * Creates a copy of the HTLCDescriptor
47568  */
47569 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
47570
47571 /**
47572  * Checks if two HTLCDescriptors contain equal inner contents.
47573  * This ignores pointers and is_owned flags and looks at the values in fields.
47574  * Two objects with NULL inner values will be considered "equal" here.
47575  */
47576 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
47577
47578 /**
47579  * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
47580  */
47581 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
47582
47583 /**
47584  * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
47585  */
47586 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
47587
47588 /**
47589  * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
47590  * being spent by the HTLC input in the HTLC transaction.
47591  */
47592 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47593
47594 /**
47595  * Returns the UTXO to be spent by the HTLC input, which can be obtained via
47596  * [`Self::unsigned_tx_input`].
47597  */
47598 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47599
47600 /**
47601  * Returns the unsigned transaction input spending the HTLC output in the commitment
47602  * transaction.
47603  */
47604 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47605
47606 /**
47607  * Returns the delayed output created as a result of spending the HTLC output in the commitment
47608  * transaction.
47609  */
47610 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47611
47612 /**
47613  * Returns the witness script of the HTLC output in the commitment transaction.
47614  */
47615 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47616
47617 /**
47618  * Returns the fully signed witness required to spend the HTLC output in the commitment
47619  * transaction.
47620  */
47621 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
47622
47623 /**
47624  * Derives the channel signer required to sign the HTLC input.
47625  */
47626 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
47627
47628 /**
47629  * Calls the free function if one is set
47630  */
47631 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
47632
47633 /**
47634  * Creates a copy of the Recipient
47635  */
47636 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
47637
47638 /**
47639  * Utility method to constructs a new Node-variant Recipient
47640  */
47641 enum LDKRecipient Recipient_node(void);
47642
47643 /**
47644  * Utility method to constructs a new PhantomNode-variant Recipient
47645  */
47646 enum LDKRecipient Recipient_phantom_node(void);
47647
47648 /**
47649  * Calls the free function if one is set
47650  */
47651 void EntropySource_free(struct LDKEntropySource this_ptr);
47652
47653 /**
47654  * Calls the free function if one is set
47655  */
47656 void NodeSigner_free(struct LDKNodeSigner this_ptr);
47657
47658 /**
47659  * Calls the free function if one is set
47660  */
47661 void SignerProvider_free(struct LDKSignerProvider this_ptr);
47662
47663 /**
47664  * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
47665  */
47666 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
47667
47668 /**
47669  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
47670  * holder's anchor output in a commitment transaction, if one is present.
47671  */
47672 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47673
47674 /**
47675  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
47676  * holder's anchor output in a commitment transaction, if one is present.
47677  */
47678 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47679
47680 /**
47681  * Holder secret key for blinded revocation pubkey.
47682  */
47683 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47684
47685 /**
47686  * Holder secret key for blinded revocation pubkey.
47687  */
47688 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47689
47690 /**
47691  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
47692  */
47693 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47694
47695 /**
47696  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
47697  */
47698 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47699
47700 /**
47701  * Holder secret key used in an HTLC transaction.
47702  */
47703 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47704
47705 /**
47706  * Holder secret key used in an HTLC transaction.
47707  */
47708 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47709
47710 /**
47711  * Holder HTLC secret key used in commitment transaction HTLC outputs.
47712  */
47713 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47714
47715 /**
47716  * Holder HTLC secret key used in commitment transaction HTLC outputs.
47717  */
47718 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47719
47720 /**
47721  * Commitment seed.
47722  */
47723 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47724
47725 /**
47726  * Commitment seed.
47727  */
47728 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47729
47730 /**
47731  * Creates a copy of the InMemorySigner
47732  */
47733 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
47734
47735 /**
47736  * Creates a new [`InMemorySigner`].
47737  */
47738 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);
47739
47740 /**
47741  * Returns the counterparty's pubkeys.
47742  *
47743  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47744  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47745  *
47746  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47747  */
47748 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47749
47750 /**
47751  * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
47752  * transactions, i.e., the amount of time that we have to wait to recover our funds if we
47753  * broadcast a transaction.
47754  *
47755  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47756  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47757  */
47758 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47759
47760 /**
47761  * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
47762  * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
47763  * if they broadcast a transaction.
47764  *
47765  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47766  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47767  */
47768 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47769
47770 /**
47771  * Returns whether the holder is the initiator.
47772  *
47773  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47774  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47775  */
47776 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47777
47778 /**
47779  * Funding outpoint
47780  *
47781  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47782  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47783  *
47784  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47785  */
47786 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47787
47788 /**
47789  * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
47790  * building transactions.
47791  *
47792  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47793  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47794  *
47795  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47796  */
47797 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47798
47799 /**
47800  * Returns the channel type features of the channel parameters. Should be helpful for
47801  * determining a channel's category, i. e. legacy/anchors/taproot/etc.
47802  *
47803  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47804  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47805  *
47806  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47807  */
47808 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47809
47810 /**
47811  * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
47812  * by `descriptor`, returning the witness stack for the input.
47813  *
47814  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
47815  * is not spending the outpoint described by [`descriptor.outpoint`],
47816  * or if an output descriptor `script_pubkey` does not match the one we can spend.
47817  *
47818  * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
47819  */
47820 MUST_USE_RES struct LDKCResult_WitnessNoneZ 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);
47821
47822 /**
47823  * Sign the single input of `spend_tx` at index `input_idx` which spends the output
47824  * described by `descriptor`, returning the witness stack for the input.
47825  *
47826  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
47827  * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
47828  * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
47829  * `script_pubkey` does not match the one we can spend.
47830  *
47831  * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
47832  * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
47833  */
47834 MUST_USE_RES struct LDKCResult_WitnessNoneZ 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);
47835
47836 /**
47837  * Constructs a new EntropySource which calls the relevant methods on this_arg.
47838  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
47839  */
47840 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47841
47842 /**
47843  * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
47844  * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
47845  */
47846 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47847
47848 /**
47849  * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
47850  * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
47851  */
47852 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47853
47854 /**
47855  * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
47856  * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
47857  */
47858 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47859
47860 /**
47861  * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
47862  */
47863 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
47864
47865 /**
47866  * Read a InMemorySigner from a byte array, created by InMemorySigner_write
47867  */
47868 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
47869
47870 /**
47871  * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
47872  */
47873 void KeysManager_free(struct LDKKeysManager this_obj);
47874
47875 /**
47876  * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
47877  * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
47878  * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
47879  * without a doubt, be unique to this instance. ie if you start multiple times with the same
47880  * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
47881  * is to simply use the current time (with very high precision).
47882  *
47883  * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
47884  * obviously, `starting_time` should be unique every time you reload the library - it is only
47885  * used to generate new ephemeral key data (which will be stored by the individual channel if
47886  * necessary).
47887  *
47888  * Note that the seed is required to recover certain on-chain funds independent of
47889  * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
47890  * for any channel, and some on-chain during-closing funds.
47891  *
47892  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
47893  */
47894 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
47895
47896 /**
47897  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
47898  */
47899 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
47900
47901 /**
47902  * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
47903  */
47904 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]);
47905
47906 /**
47907  * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
47908  * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
47909  * are no other inputs that need signing.
47910  *
47911  * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
47912  *
47913  * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
47914  * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
47915  */
47916 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);
47917
47918 /**
47919  * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
47920  * output to the given change destination (if sufficient change value remains). The
47921  * transaction will have a feerate, at least, of the given value.
47922  *
47923  * The `locktime` argument is used to set the transaction's locktime. If `None`, the
47924  * transaction will have a locktime of 0. It it recommended to set this to the current block
47925  * height to avoid fee sniping, unless you have some specific reason to use a different
47926  * locktime.
47927  *
47928  * Returns `Err(())` if the output value is greater than the input value minus required fee,
47929  * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
47930  * does not match the one we can spend.
47931  *
47932  * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
47933  *
47934  * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
47935  * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
47936  */
47937 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);
47938
47939 /**
47940  * Constructs a new EntropySource which calls the relevant methods on this_arg.
47941  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
47942  */
47943 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
47944
47945 /**
47946  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
47947  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
47948  */
47949 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
47950
47951 /**
47952  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
47953  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
47954  */
47955 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
47956
47957 /**
47958  * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
47959  */
47960 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
47961
47962 /**
47963  * Constructs a new EntropySource which calls the relevant methods on this_arg.
47964  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
47965  */
47966 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
47967
47968 /**
47969  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
47970  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
47971  */
47972 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
47973
47974 /**
47975  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
47976  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
47977  */
47978 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
47979
47980 /**
47981  * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
47982  * that is shared across all nodes that intend to participate in [phantom node payments]
47983  * together.
47984  *
47985  * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
47986  * `starting_time_nanos`.
47987  *
47988  * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
47989  * same across restarts, or else inbound payments may fail.
47990  *
47991  * [phantom node payments]: PhantomKeysManager
47992  */
47993 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]);
47994
47995 /**
47996  * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
47997  */
47998 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);
47999
48000 /**
48001  * See [`KeysManager::derive_channel_keys`] for documentation on this method.
48002  */
48003 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]);
48004
48005 /**
48006  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
48007  */
48008 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
48009
48010 /**
48011  * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
48012  * last-hop onion data, etc.
48013  */
48014 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
48015
48016 /**
48017  * Calls the free function if one is set
48018  */
48019 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
48020
48021 /**
48022  * Creates a copy of a WriteableEcdsaChannelSigner
48023  */
48024 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
48025
48026 /**
48027  * Calls the free function if one is set
48028  */
48029 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
48030
48031 /**
48032  * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
48033  */
48034 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
48035
48036 /**
48037  * Calls the free function if one is set
48038  */
48039 void MessageRouter_free(struct LDKMessageRouter this_ptr);
48040
48041 /**
48042  * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
48043  */
48044 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
48045
48046 /**
48047  * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
48048  */
48049 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
48050
48051 /**
48052  * Constructs a new MessageRouter which calls the relevant methods on this_arg.
48053  * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
48054  */
48055 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
48056
48057 /**
48058  * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
48059  */
48060 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
48061
48062 /**
48063  * Nodes on the path between the sender and the destination.
48064  *
48065  * Returns a copy of the field.
48066  */
48067 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
48068
48069 /**
48070  * Nodes on the path between the sender and the destination.
48071  */
48072 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
48073
48074 /**
48075  * The recipient of the message.
48076  */
48077 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
48078
48079 /**
48080  * The recipient of the message.
48081  */
48082 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
48083
48084 /**
48085  * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
48086  *
48087  * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
48088  * this to initiate such a connection.
48089  *
48090  * Returns a copy of the field.
48091  */
48092 struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
48093
48094 /**
48095  * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
48096  *
48097  * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
48098  * this to initiate such a connection.
48099  */
48100 void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
48101
48102 /**
48103  * Constructs a new OnionMessagePath given each field
48104  */
48105 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg, struct LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg);
48106
48107 /**
48108  * Creates a copy of the OnionMessagePath
48109  */
48110 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
48111
48112 /**
48113  * Returns the first node in the path.
48114  */
48115 MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
48116
48117 /**
48118  * Frees any resources used by the Destination
48119  */
48120 void Destination_free(struct LDKDestination this_ptr);
48121
48122 /**
48123  * Creates a copy of the Destination
48124  */
48125 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
48126
48127 /**
48128  * Utility method to constructs a new Node-variant Destination
48129  */
48130 struct LDKDestination Destination_node(struct LDKPublicKey a);
48131
48132 /**
48133  * Utility method to constructs a new BlindedPath-variant Destination
48134  */
48135 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
48136
48137 /**
48138  * Frees any resources used by the SendSuccess
48139  */
48140 void SendSuccess_free(struct LDKSendSuccess this_ptr);
48141
48142 /**
48143  * Creates a copy of the SendSuccess
48144  */
48145 struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
48146
48147 /**
48148  * Utility method to constructs a new Buffered-variant SendSuccess
48149  */
48150 struct LDKSendSuccess SendSuccess_buffered(void);
48151
48152 /**
48153  * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
48154  */
48155 struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
48156
48157 /**
48158  * Checks if two SendSuccesss contain equal inner contents.
48159  * This ignores pointers and is_owned flags and looks at the values in fields.
48160  */
48161 bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
48162
48163 /**
48164  * Frees any resources used by the SendError
48165  */
48166 void SendError_free(struct LDKSendError this_ptr);
48167
48168 /**
48169  * Creates a copy of the SendError
48170  */
48171 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
48172
48173 /**
48174  * Utility method to constructs a new Secp256k1-variant SendError
48175  */
48176 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
48177
48178 /**
48179  * Utility method to constructs a new TooBigPacket-variant SendError
48180  */
48181 struct LDKSendError SendError_too_big_packet(void);
48182
48183 /**
48184  * Utility method to constructs a new TooFewBlindedHops-variant SendError
48185  */
48186 struct LDKSendError SendError_too_few_blinded_hops(void);
48187
48188 /**
48189  * Utility method to constructs a new InvalidFirstHop-variant SendError
48190  */
48191 struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
48192
48193 /**
48194  * Utility method to constructs a new PathNotFound-variant SendError
48195  */
48196 struct LDKSendError SendError_path_not_found(void);
48197
48198 /**
48199  * Utility method to constructs a new InvalidMessage-variant SendError
48200  */
48201 struct LDKSendError SendError_invalid_message(void);
48202
48203 /**
48204  * Utility method to constructs a new BufferFull-variant SendError
48205  */
48206 struct LDKSendError SendError_buffer_full(void);
48207
48208 /**
48209  * Utility method to constructs a new GetNodeIdFailed-variant SendError
48210  */
48211 struct LDKSendError SendError_get_node_id_failed(void);
48212
48213 /**
48214  * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
48215  */
48216 struct LDKSendError SendError_blinded_path_advance_failed(void);
48217
48218 /**
48219  * Checks if two SendErrors contain equal inner contents.
48220  * This ignores pointers and is_owned flags and looks at the values in fields.
48221  */
48222 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
48223
48224 /**
48225  * Calls the free function if one is set
48226  */
48227 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
48228
48229 /**
48230  * Frees any resources used by the PeeledOnion
48231  */
48232 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
48233
48234 /**
48235  * Creates a copy of the PeeledOnion
48236  */
48237 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
48238
48239 /**
48240  * Utility method to constructs a new Forward-variant PeeledOnion
48241  */
48242 struct LDKPeeledOnion PeeledOnion_forward(struct LDKPublicKey a, struct LDKOnionMessage b);
48243
48244 /**
48245  * Utility method to constructs a new Receive-variant PeeledOnion
48246  */
48247 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
48248
48249 /**
48250  * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
48251  * `path`.
48252  *
48253  * Returns the node id of the peer to send the message to, the message itself, and any addresses
48254  * need to connect to the first node.
48255  *
48256  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
48257  */
48258 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ 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);
48259
48260 /**
48261  * Decode one layer of an incoming [`OnionMessage`].
48262  *
48263  * Returns either the next layer of the onion for forwarding or the decrypted content for the
48264  * receiver.
48265  */
48266 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
48267
48268 /**
48269  * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
48270  * their respective handlers.
48271  */
48272 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);
48273
48274 /**
48275  * Sends an [`OnionMessage`] with the given `contents` to `destination`.
48276  *
48277  * See [`OnionMessenger`] for example usage.
48278  *
48279  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
48280  */
48281 MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents contents, struct LDKDestination destination, struct LDKBlindedPath reply_path);
48282
48283 /**
48284  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
48285  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
48286  */
48287 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
48288
48289 /**
48290  * Calls the free function if one is set
48291  */
48292 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
48293
48294 /**
48295  * Frees any resources used by the OffersMessage
48296  */
48297 void OffersMessage_free(struct LDKOffersMessage this_ptr);
48298
48299 /**
48300  * Creates a copy of the OffersMessage
48301  */
48302 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
48303
48304 /**
48305  * Utility method to constructs a new InvoiceRequest-variant OffersMessage
48306  */
48307 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
48308
48309 /**
48310  * Utility method to constructs a new Invoice-variant OffersMessage
48311  */
48312 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
48313
48314 /**
48315  * Utility method to constructs a new InvoiceError-variant OffersMessage
48316  */
48317 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
48318
48319 /**
48320  * Returns whether `tlv_type` corresponds to a TLV record for Offers.
48321  */
48322 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
48323
48324 /**
48325  * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
48326  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
48327  */
48328 struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
48329
48330 /**
48331  * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
48332  */
48333 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
48334
48335 /**
48336  * Read a OffersMessage from a byte array, created by OffersMessage_write
48337  */
48338 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
48339
48340 /**
48341  * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
48342  */
48343 void Packet_free(struct LDKPacket this_obj);
48344
48345 /**
48346  * Bolt 04 version number
48347  */
48348 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
48349
48350 /**
48351  * Bolt 04 version number
48352  */
48353 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
48354
48355 /**
48356  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
48357  */
48358 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
48359
48360 /**
48361  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
48362  */
48363 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48364
48365 /**
48366  * Encrypted payload for the next hop
48367  *
48368  * Returns a copy of the field.
48369  */
48370 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
48371
48372 /**
48373  * Encrypted payload for the next hop
48374  */
48375 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
48376
48377 /**
48378  * HMAC to verify the integrity of hop_data
48379  */
48380 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
48381
48382 /**
48383  * HMAC to verify the integrity of hop_data
48384  */
48385 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
48386
48387 /**
48388  * Constructs a new Packet given each field
48389  */
48390 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);
48391
48392 /**
48393  * Creates a copy of the Packet
48394  */
48395 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
48396
48397 /**
48398  * Generates a non-cryptographic 64-bit hash of the Packet.
48399  */
48400 uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
48401
48402 /**
48403  * Checks if two Packets contain equal inner contents.
48404  * This ignores pointers and is_owned flags and looks at the values in fields.
48405  * Two objects with NULL inner values will be considered "equal" here.
48406  */
48407 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
48408
48409 /**
48410  * Serialize the Packet object into a byte array which can be read by Packet_read
48411  */
48412 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
48413
48414 /**
48415  * Frees any resources used by the ParsedOnionMessageContents
48416  */
48417 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
48418
48419 /**
48420  * Creates a copy of the ParsedOnionMessageContents
48421  */
48422 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
48423
48424 /**
48425  * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
48426  */
48427 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
48428
48429 /**
48430  * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
48431  */
48432 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
48433
48434 /**
48435  * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
48436  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
48437  */
48438 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
48439
48440 /**
48441  * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
48442  */
48443 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
48444
48445 /**
48446  * Creates a copy of a OnionMessageContents
48447  */
48448 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
48449
48450 /**
48451  * Calls the free function if one is set
48452  */
48453 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
48454
48455 /**
48456  * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
48457  */
48458 void BlindedPath_free(struct LDKBlindedPath this_obj);
48459
48460 /**
48461  * To send to a blinded path, the sender first finds a route to the unblinded
48462  * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
48463  * message or payment's next hop and forward it along.
48464  *
48465  * [`encrypted_payload`]: BlindedHop::encrypted_payload
48466  */
48467 struct LDKPublicKey BlindedPath_get_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
48468
48469 /**
48470  * To send to a blinded path, the sender first finds a route to the unblinded
48471  * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
48472  * message or payment's next hop and forward it along.
48473  *
48474  * [`encrypted_payload`]: BlindedHop::encrypted_payload
48475  */
48476 void BlindedPath_set_introduction_node_id(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48477
48478 /**
48479  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
48480  * message or payment.
48481  *
48482  * [`encrypted_payload`]: BlindedHop::encrypted_payload
48483  */
48484 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
48485
48486 /**
48487  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
48488  * message or payment.
48489  *
48490  * [`encrypted_payload`]: BlindedHop::encrypted_payload
48491  */
48492 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48493
48494 /**
48495  * The hops composing the blinded path.
48496  */
48497 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
48498
48499 /**
48500  * The hops composing the blinded path.
48501  */
48502 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
48503
48504 /**
48505  * Constructs a new BlindedPath given each field
48506  */
48507 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKPublicKey introduction_node_id_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
48508
48509 /**
48510  * Creates a copy of the BlindedPath
48511  */
48512 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
48513
48514 /**
48515  * Generates a non-cryptographic 64-bit hash of the BlindedPath.
48516  */
48517 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
48518
48519 /**
48520  * Checks if two BlindedPaths contain equal inner contents.
48521  * This ignores pointers and is_owned flags and looks at the values in fields.
48522  * Two objects with NULL inner values will be considered "equal" here.
48523  */
48524 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
48525
48526 /**
48527  * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
48528  */
48529 void BlindedHop_free(struct LDKBlindedHop this_obj);
48530
48531 /**
48532  * The blinded node id of this hop in a [`BlindedPath`].
48533  */
48534 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
48535
48536 /**
48537  * The blinded node id of this hop in a [`BlindedPath`].
48538  */
48539 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48540
48541 /**
48542  * The encrypted payload intended for this hop in a [`BlindedPath`].
48543  *
48544  * Returns a copy of the field.
48545  */
48546 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
48547
48548 /**
48549  * The encrypted payload intended for this hop in a [`BlindedPath`].
48550  */
48551 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
48552
48553 /**
48554  * Constructs a new BlindedHop given each field
48555  */
48556 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
48557
48558 /**
48559  * Creates a copy of the BlindedHop
48560  */
48561 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
48562
48563 /**
48564  * Generates a non-cryptographic 64-bit hash of the BlindedHop.
48565  */
48566 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
48567
48568 /**
48569  * Checks if two BlindedHops contain equal inner contents.
48570  * This ignores pointers and is_owned flags and looks at the values in fields.
48571  * Two objects with NULL inner values will be considered "equal" here.
48572  */
48573 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
48574
48575 /**
48576  * Create a one-hop blinded path for a message.
48577  */
48578 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, const struct LDKEntropySource *NONNULL_PTR entropy_source);
48579
48580 /**
48581  * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
48582  * pubkey in `node_pks` will be the destination node.
48583  *
48584  * Errors if no hops are provided or if `node_pk`(s) are invalid.
48585  */
48586 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
48587
48588 /**
48589  * Create a one-hop blinded path for a payment.
48590  */
48591 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);
48592
48593 /**
48594  * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
48595  *
48596  * Errors if:
48597  * * a provided node id is invalid
48598  * * [`BlindedPayInfo`] calculation results in an integer overflow
48599  * * any unknown features are required in the provided [`ForwardTlvs`]
48600  *
48601  * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
48602  */
48603 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(struct LDKCVec_ForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, const struct LDKEntropySource *NONNULL_PTR entropy_source);
48604
48605 /**
48606  * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
48607  */
48608 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
48609
48610 /**
48611  * Read a BlindedPath from a byte array, created by BlindedPath_write
48612  */
48613 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
48614
48615 /**
48616  * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
48617  */
48618 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
48619
48620 /**
48621  * Read a BlindedHop from a byte array, created by BlindedHop_write
48622  */
48623 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
48624
48625 /**
48626  * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
48627  */
48628 void ForwardNode_free(struct LDKForwardNode this_obj);
48629
48630 /**
48631  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
48632  * used for [`BlindedPayInfo`] construction.
48633  */
48634 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
48635
48636 /**
48637  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
48638  * used for [`BlindedPayInfo`] construction.
48639  */
48640 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
48641
48642 /**
48643  * This node's pubkey.
48644  */
48645 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
48646
48647 /**
48648  * This node's pubkey.
48649  */
48650 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48651
48652 /**
48653  * The maximum value, in msat, that may be accepted by this node.
48654  */
48655 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
48656
48657 /**
48658  * The maximum value, in msat, that may be accepted by this node.
48659  */
48660 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
48661
48662 /**
48663  * Constructs a new ForwardNode given each field
48664  */
48665 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
48666
48667 /**
48668  * Creates a copy of the ForwardNode
48669  */
48670 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
48671
48672 /**
48673  * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
48674  */
48675 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
48676
48677 /**
48678  * The short channel id this payment should be forwarded out over.
48679  */
48680 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
48681
48682 /**
48683  * The short channel id this payment should be forwarded out over.
48684  */
48685 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
48686
48687 /**
48688  * Payment parameters for relaying over [`Self::short_channel_id`].
48689  */
48690 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
48691
48692 /**
48693  * Payment parameters for relaying over [`Self::short_channel_id`].
48694  */
48695 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
48696
48697 /**
48698  * Payment constraints for relaying over [`Self::short_channel_id`].
48699  */
48700 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
48701
48702 /**
48703  * Payment constraints for relaying over [`Self::short_channel_id`].
48704  */
48705 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
48706
48707 /**
48708  * Supported and required features when relaying a payment onion containing this object's
48709  * corresponding [`BlindedHop::encrypted_payload`].
48710  *
48711  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
48712  */
48713 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
48714
48715 /**
48716  * Supported and required features when relaying a payment onion containing this object's
48717  * corresponding [`BlindedHop::encrypted_payload`].
48718  *
48719  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
48720  */
48721 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
48722
48723 /**
48724  * Constructs a new ForwardTlvs given each field
48725  */
48726 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);
48727
48728 /**
48729  * Creates a copy of the ForwardTlvs
48730  */
48731 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
48732
48733 /**
48734  * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
48735  */
48736 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
48737
48738 /**
48739  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
48740  */
48741 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
48742
48743 /**
48744  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
48745  */
48746 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
48747
48748 /**
48749  * Constraints for the receiver of this payment.
48750  */
48751 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
48752
48753 /**
48754  * Constraints for the receiver of this payment.
48755  */
48756 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
48757
48758 /**
48759  * Constructs a new ReceiveTlvs given each field
48760  */
48761 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg);
48762
48763 /**
48764  * Creates a copy of the ReceiveTlvs
48765  */
48766 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
48767
48768 /**
48769  * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
48770  */
48771 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
48772
48773 /**
48774  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
48775  */
48776 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
48777
48778 /**
48779  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
48780  */
48781 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
48782
48783 /**
48784  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
48785  * this [`BlindedHop`], (i.e., 10,000 is 1%).
48786  */
48787 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
48788
48789 /**
48790  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
48791  * this [`BlindedHop`], (i.e., 10,000 is 1%).
48792  */
48793 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
48794
48795 /**
48796  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
48797  */
48798 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
48799
48800 /**
48801  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
48802  */
48803 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
48804
48805 /**
48806  * Constructs a new PaymentRelay given each field
48807  */
48808 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);
48809
48810 /**
48811  * Creates a copy of the PaymentRelay
48812  */
48813 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
48814
48815 /**
48816  * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
48817  */
48818 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
48819
48820 /**
48821  * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
48822  */
48823 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
48824
48825 /**
48826  * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
48827  */
48828 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
48829
48830 /**
48831  * The minimum value, in msat, that may be accepted by the node corresponding to this
48832  * [`BlindedHop`].
48833  */
48834 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
48835
48836 /**
48837  * The minimum value, in msat, that may be accepted by the node corresponding to this
48838  * [`BlindedHop`].
48839  */
48840 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
48841
48842 /**
48843  * Constructs a new PaymentConstraints given each field
48844  */
48845 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
48846
48847 /**
48848  * Creates a copy of the PaymentConstraints
48849  */
48850 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
48851
48852 /**
48853  * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
48854  */
48855 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
48856
48857 /**
48858  * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
48859  */
48860 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
48861
48862 /**
48863  * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
48864  */
48865 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
48866
48867 /**
48868  * Read a PaymentRelay from a byte array, created by PaymentRelay_write
48869  */
48870 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
48871
48872 /**
48873  * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
48874  */
48875 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
48876
48877 /**
48878  * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
48879  */
48880 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
48881
48882 /**
48883  * Frees any resources used by the PaymentPurpose
48884  */
48885 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
48886
48887 /**
48888  * Creates a copy of the PaymentPurpose
48889  */
48890 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
48891
48892 /**
48893  * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
48894  */
48895 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
48896
48897 /**
48898  * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
48899  */
48900 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
48901
48902 /**
48903  * Checks if two PaymentPurposes contain equal inner contents.
48904  * This ignores pointers and is_owned flags and looks at the values in fields.
48905  */
48906 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
48907
48908 /**
48909  * Returns the preimage for this payment, if it is known.
48910  */
48911 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
48912
48913 /**
48914  * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
48915  */
48916 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
48917
48918 /**
48919  * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
48920  */
48921 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
48922
48923 /**
48924  * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
48925  */
48926 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
48927
48928 /**
48929  * The `channel_id` of the channel over which the HTLC was received.
48930  */
48931 const uint8_t (*ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr))[32];
48932
48933 /**
48934  * The `channel_id` of the channel over which the HTLC was received.
48935  */
48936 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
48937
48938 /**
48939  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
48940  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
48941  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
48942  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
48943  * `user_channel_id` will be randomized for an inbound channel.
48944  *
48945  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
48946  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
48947  * was not actually claimed until after upgrading.)
48948  *
48949  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
48950  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
48951  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
48952  */
48953 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
48954
48955 /**
48956  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
48957  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
48958  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
48959  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
48960  * `user_channel_id` will be randomized for an inbound channel.
48961  *
48962  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
48963  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
48964  * was not actually claimed until after upgrading.)
48965  *
48966  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
48967  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
48968  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
48969  */
48970 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
48971
48972 /**
48973  * The block height at which this HTLC expires.
48974  */
48975 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
48976
48977 /**
48978  * The block height at which this HTLC expires.
48979  */
48980 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
48981
48982 /**
48983  * The amount (in msats) of this part of an MPP.
48984  */
48985 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
48986
48987 /**
48988  * The amount (in msats) of this part of an MPP.
48989  */
48990 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
48991
48992 /**
48993  * The extra fee our counterparty skimmed off the top of this HTLC, if any.
48994  *
48995  * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
48996  * 0.0.119.
48997  */
48998 uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
48999
49000 /**
49001  * The extra fee our counterparty skimmed off the top of this HTLC, if any.
49002  *
49003  * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
49004  * 0.0.119.
49005  */
49006 void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
49007
49008 /**
49009  * Constructs a new ClaimedHTLC given each field
49010  */
49011 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, uint64_t counterparty_skimmed_fee_msat_arg);
49012
49013 /**
49014  * Creates a copy of the ClaimedHTLC
49015  */
49016 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
49017
49018 /**
49019  * Checks if two ClaimedHTLCs contain equal inner contents.
49020  * This ignores pointers and is_owned flags and looks at the values in fields.
49021  * Two objects with NULL inner values will be considered "equal" here.
49022  */
49023 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
49024
49025 /**
49026  * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
49027  */
49028 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
49029
49030 /**
49031  * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
49032  */
49033 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
49034
49035 /**
49036  * Frees any resources used by the PathFailure
49037  */
49038 void PathFailure_free(struct LDKPathFailure this_ptr);
49039
49040 /**
49041  * Creates a copy of the PathFailure
49042  */
49043 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
49044
49045 /**
49046  * Utility method to constructs a new InitialSend-variant PathFailure
49047  */
49048 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
49049
49050 /**
49051  * Utility method to constructs a new OnPath-variant PathFailure
49052  */
49053 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
49054
49055 /**
49056  * Checks if two PathFailures contain equal inner contents.
49057  * This ignores pointers and is_owned flags and looks at the values in fields.
49058  */
49059 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
49060
49061 /**
49062  * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
49063  */
49064 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
49065
49066 /**
49067  * Read a PathFailure from a byte array, created by PathFailure_write
49068  */
49069 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
49070
49071 /**
49072  * Frees any resources used by the ClosureReason
49073  */
49074 void ClosureReason_free(struct LDKClosureReason this_ptr);
49075
49076 /**
49077  * Creates a copy of the ClosureReason
49078  */
49079 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
49080
49081 /**
49082  * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
49083  */
49084 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
49085
49086 /**
49087  * Utility method to constructs a new HolderForceClosed-variant ClosureReason
49088  */
49089 struct LDKClosureReason ClosureReason_holder_force_closed(void);
49090
49091 /**
49092  * Utility method to constructs a new CooperativeClosure-variant ClosureReason
49093  */
49094 struct LDKClosureReason ClosureReason_cooperative_closure(void);
49095
49096 /**
49097  * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
49098  */
49099 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
49100
49101 /**
49102  * Utility method to constructs a new FundingTimedOut-variant ClosureReason
49103  */
49104 struct LDKClosureReason ClosureReason_funding_timed_out(void);
49105
49106 /**
49107  * Utility method to constructs a new ProcessingError-variant ClosureReason
49108  */
49109 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
49110
49111 /**
49112  * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
49113  */
49114 struct LDKClosureReason ClosureReason_disconnected_peer(void);
49115
49116 /**
49117  * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
49118  */
49119 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
49120
49121 /**
49122  * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
49123  */
49124 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
49125
49126 /**
49127  * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
49128  */
49129 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
49130
49131 /**
49132  * Checks if two ClosureReasons contain equal inner contents.
49133  * This ignores pointers and is_owned flags and looks at the values in fields.
49134  */
49135 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
49136
49137 /**
49138  * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
49139  */
49140 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
49141
49142 /**
49143  * Read a ClosureReason from a byte array, created by ClosureReason_write
49144  */
49145 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
49146
49147 /**
49148  * Frees any resources used by the HTLCDestination
49149  */
49150 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
49151
49152 /**
49153  * Creates a copy of the HTLCDestination
49154  */
49155 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
49156
49157 /**
49158  * Utility method to constructs a new NextHopChannel-variant HTLCDestination
49159  */
49160 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
49161
49162 /**
49163  * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
49164  */
49165 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
49166
49167 /**
49168  * Utility method to constructs a new InvalidForward-variant HTLCDestination
49169  */
49170 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
49171
49172 /**
49173  * Utility method to constructs a new FailedPayment-variant HTLCDestination
49174  */
49175 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
49176
49177 /**
49178  * Checks if two HTLCDestinations contain equal inner contents.
49179  * This ignores pointers and is_owned flags and looks at the values in fields.
49180  */
49181 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
49182
49183 /**
49184  * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
49185  */
49186 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
49187
49188 /**
49189  * Read a HTLCDestination from a byte array, created by HTLCDestination_write
49190  */
49191 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
49192
49193 /**
49194  * Creates a copy of the PaymentFailureReason
49195  */
49196 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
49197
49198 /**
49199  * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
49200  */
49201 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
49202
49203 /**
49204  * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
49205  */
49206 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
49207
49208 /**
49209  * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
49210  */
49211 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
49212
49213 /**
49214  * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
49215  */
49216 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
49217
49218 /**
49219  * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
49220  */
49221 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
49222
49223 /**
49224  * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
49225  */
49226 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
49227
49228 /**
49229  * Checks if two PaymentFailureReasons contain equal inner contents.
49230  * This ignores pointers and is_owned flags and looks at the values in fields.
49231  */
49232 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
49233
49234 /**
49235  * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
49236  */
49237 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
49238
49239 /**
49240  * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
49241  */
49242 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
49243
49244 /**
49245  * Frees any resources used by the Event
49246  */
49247 void Event_free(struct LDKEvent this_ptr);
49248
49249 /**
49250  * Creates a copy of the Event
49251  */
49252 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
49253
49254 /**
49255  * Utility method to constructs a new FundingGenerationReady-variant Event
49256  */
49257 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);
49258
49259 /**
49260  * Utility method to constructs a new PaymentClaimable-variant Event
49261  */
49262 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);
49263
49264 /**
49265  * Utility method to constructs a new PaymentClaimed-variant Event
49266  */
49267 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);
49268
49269 /**
49270  * Utility method to constructs a new ConnectionNeeded-variant Event
49271  */
49272 struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
49273
49274 /**
49275  * Utility method to constructs a new InvoiceRequestFailed-variant Event
49276  */
49277 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
49278
49279 /**
49280  * Utility method to constructs a new PaymentSent-variant Event
49281  */
49282 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
49283
49284 /**
49285  * Utility method to constructs a new PaymentFailed-variant Event
49286  */
49287 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
49288
49289 /**
49290  * Utility method to constructs a new PaymentPathSuccessful-variant Event
49291  */
49292 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
49293
49294 /**
49295  * Utility method to constructs a new PaymentPathFailed-variant Event
49296  */
49297 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);
49298
49299 /**
49300  * Utility method to constructs a new ProbeSuccessful-variant Event
49301  */
49302 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
49303
49304 /**
49305  * Utility method to constructs a new ProbeFailed-variant Event
49306  */
49307 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
49308
49309 /**
49310  * Utility method to constructs a new PendingHTLCsForwardable-variant Event
49311  */
49312 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
49313
49314 /**
49315  * Utility method to constructs a new HTLCIntercepted-variant Event
49316  */
49317 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);
49318
49319 /**
49320  * Utility method to constructs a new SpendableOutputs-variant Event
49321  */
49322 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKCOption_ThirtyTwoBytesZ channel_id);
49323
49324 /**
49325  * Utility method to constructs a new PaymentForwarded-variant Event
49326  */
49327 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);
49328
49329 /**
49330  * Utility method to constructs a new ChannelPending-variant Event
49331  */
49332 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);
49333
49334 /**
49335  * Utility method to constructs a new ChannelReady-variant Event
49336  */
49337 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
49338
49339 /**
49340  * Utility method to constructs a new ChannelClosed-variant Event
49341  */
49342 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, struct LDKOutPoint channel_funding_txo);
49343
49344 /**
49345  * Utility method to constructs a new DiscardFunding-variant Event
49346  */
49347 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
49348
49349 /**
49350  * Utility method to constructs a new OpenChannelRequest-variant Event
49351  */
49352 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);
49353
49354 /**
49355  * Utility method to constructs a new HTLCHandlingFailed-variant Event
49356  */
49357 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
49358
49359 /**
49360  * Utility method to constructs a new BumpTransaction-variant Event
49361  */
49362 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
49363
49364 /**
49365  * Checks if two Events contain equal inner contents.
49366  * This ignores pointers and is_owned flags and looks at the values in fields.
49367  */
49368 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
49369
49370 /**
49371  * Serialize the Event object into a byte array which can be read by Event_read
49372  */
49373 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
49374
49375 /**
49376  * Read a Event from a byte array, created by Event_write
49377  */
49378 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
49379
49380 /**
49381  * Frees any resources used by the MessageSendEvent
49382  */
49383 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
49384
49385 /**
49386  * Creates a copy of the MessageSendEvent
49387  */
49388 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
49389
49390 /**
49391  * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
49392  */
49393 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
49394
49395 /**
49396  * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
49397  */
49398 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
49399
49400 /**
49401  * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
49402  */
49403 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
49404
49405 /**
49406  * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
49407  */
49408 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
49409
49410 /**
49411  * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
49412  */
49413 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
49414
49415 /**
49416  * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
49417  */
49418 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
49419
49420 /**
49421  * Utility method to constructs a new SendStfu-variant MessageSendEvent
49422  */
49423 struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
49424
49425 /**
49426  * Utility method to constructs a new SendSplice-variant MessageSendEvent
49427  */
49428 struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg);
49429
49430 /**
49431  * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
49432  */
49433 struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
49434
49435 /**
49436  * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
49437  */
49438 struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
49439
49440 /**
49441  * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
49442  */
49443 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
49444
49445 /**
49446  * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
49447  */
49448 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
49449
49450 /**
49451  * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
49452  */
49453 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
49454
49455 /**
49456  * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
49457  */
49458 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
49459
49460 /**
49461  * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
49462  */
49463 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
49464
49465 /**
49466  * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
49467  */
49468 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
49469
49470 /**
49471  * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
49472  */
49473 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
49474
49475 /**
49476  * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
49477  */
49478 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
49479
49480 /**
49481  * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
49482  */
49483 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
49484
49485 /**
49486  * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
49487  */
49488 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
49489
49490 /**
49491  * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
49492  */
49493 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
49494
49495 /**
49496  * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
49497  */
49498 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
49499
49500 /**
49501  * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
49502  */
49503 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
49504
49505 /**
49506  * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
49507  */
49508 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
49509
49510 /**
49511  * Utility method to constructs a new SendShutdown-variant MessageSendEvent
49512  */
49513 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
49514
49515 /**
49516  * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
49517  */
49518 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
49519
49520 /**
49521  * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
49522  */
49523 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
49524
49525 /**
49526  * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
49527  */
49528 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
49529
49530 /**
49531  * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
49532  */
49533 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
49534
49535 /**
49536  * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
49537  */
49538 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
49539
49540 /**
49541  * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
49542  */
49543 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
49544
49545 /**
49546  * Utility method to constructs a new HandleError-variant MessageSendEvent
49547  */
49548 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
49549
49550 /**
49551  * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
49552  */
49553 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
49554
49555 /**
49556  * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
49557  */
49558 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
49559
49560 /**
49561  * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
49562  */
49563 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
49564
49565 /**
49566  * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
49567  */
49568 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
49569
49570 /**
49571  * Calls the free function if one is set
49572  */
49573 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
49574
49575 /**
49576  * Calls the free function if one is set
49577  */
49578 void EventsProvider_free(struct LDKEventsProvider this_ptr);
49579
49580 /**
49581  * Calls the free function if one is set
49582  */
49583 void EventHandler_free(struct LDKEventHandler this_ptr);
49584
49585 /**
49586  * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
49587  */
49588 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
49589
49590 /**
49591  * The parameters required to derive the signer for the anchor input.
49592  */
49593 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
49594
49595 /**
49596  * The parameters required to derive the signer for the anchor input.
49597  */
49598 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
49599
49600 /**
49601  * The transaction input's outpoint corresponding to the commitment transaction's anchor
49602  * output.
49603  */
49604 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
49605
49606 /**
49607  * The transaction input's outpoint corresponding to the commitment transaction's anchor
49608  * output.
49609  */
49610 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
49611
49612 /**
49613  * Constructs a new AnchorDescriptor given each field
49614  */
49615 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
49616
49617 /**
49618  * Creates a copy of the AnchorDescriptor
49619  */
49620 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
49621
49622 /**
49623  * Checks if two AnchorDescriptors contain equal inner contents.
49624  * This ignores pointers and is_owned flags and looks at the values in fields.
49625  * Two objects with NULL inner values will be considered "equal" here.
49626  */
49627 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
49628
49629 /**
49630  * Returns the UTXO to be spent by the anchor input, which can be obtained via
49631  * [`Self::unsigned_tx_input`].
49632  */
49633 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
49634
49635 /**
49636  * Returns the unsigned transaction input spending the anchor output in the commitment
49637  * transaction.
49638  */
49639 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
49640
49641 /**
49642  * Returns the witness script of the anchor output in the commitment transaction.
49643  */
49644 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
49645
49646 /**
49647  * Returns the fully signed witness required to spend the anchor output in the commitment
49648  * transaction.
49649  */
49650 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
49651
49652 /**
49653  * Derives the channel signer required to sign the anchor input.
49654  */
49655 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
49656
49657 /**
49658  * Frees any resources used by the BumpTransactionEvent
49659  */
49660 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
49661
49662 /**
49663  * Creates a copy of the BumpTransactionEvent
49664  */
49665 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
49666
49667 /**
49668  * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
49669  */
49670 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);
49671
49672 /**
49673  * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
49674  */
49675 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);
49676
49677 /**
49678  * Checks if two BumpTransactionEvents contain equal inner contents.
49679  * This ignores pointers and is_owned flags and looks at the values in fields.
49680  */
49681 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
49682
49683 /**
49684  * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
49685  */
49686 void Input_free(struct LDKInput this_obj);
49687
49688 /**
49689  * The unique identifier of the input.
49690  */
49691 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
49692
49693 /**
49694  * The unique identifier of the input.
49695  */
49696 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
49697
49698 /**
49699  * The UTXO being spent by the input.
49700  */
49701 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
49702
49703 /**
49704  * The UTXO being spent by the input.
49705  */
49706 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
49707
49708 /**
49709  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
49710  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
49711  * script.
49712  */
49713 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
49714
49715 /**
49716  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
49717  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
49718  * script.
49719  */
49720 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
49721
49722 /**
49723  * Constructs a new Input given each field
49724  */
49725 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
49726
49727 /**
49728  * Creates a copy of the Input
49729  */
49730 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
49731
49732 /**
49733  * Generates a non-cryptographic 64-bit hash of the Input.
49734  */
49735 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
49736
49737 /**
49738  * Checks if two Inputs contain equal inner contents.
49739  * This ignores pointers and is_owned flags and looks at the values in fields.
49740  * Two objects with NULL inner values will be considered "equal" here.
49741  */
49742 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
49743
49744 /**
49745  * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
49746  */
49747 void Utxo_free(struct LDKUtxo this_obj);
49748
49749 /**
49750  * The unique identifier of the output.
49751  */
49752 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
49753
49754 /**
49755  * The unique identifier of the output.
49756  */
49757 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
49758
49759 /**
49760  * The output to spend.
49761  */
49762 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
49763
49764 /**
49765  * The output to spend.
49766  */
49767 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
49768
49769 /**
49770  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
49771  * with their lengths included, required to satisfy the output's script. The weight consumed by
49772  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
49773  */
49774 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
49775
49776 /**
49777  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
49778  * with their lengths included, required to satisfy the output's script. The weight consumed by
49779  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
49780  */
49781 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
49782
49783 /**
49784  * Constructs a new Utxo given each field
49785  */
49786 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
49787
49788 /**
49789  * Creates a copy of the Utxo
49790  */
49791 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
49792
49793 /**
49794  * Generates a non-cryptographic 64-bit hash of the Utxo.
49795  */
49796 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
49797
49798 /**
49799  * Checks if two Utxos contain equal inner contents.
49800  * This ignores pointers and is_owned flags and looks at the values in fields.
49801  * Two objects with NULL inner values will be considered "equal" here.
49802  */
49803 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
49804
49805 /**
49806  * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
49807  */
49808 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
49809
49810 /**
49811  * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
49812  */
49813 void CoinSelection_free(struct LDKCoinSelection this_obj);
49814
49815 /**
49816  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
49817  * requiring additional fees.
49818  */
49819 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
49820
49821 /**
49822  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
49823  * requiring additional fees.
49824  */
49825 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
49826
49827 /**
49828  * An additional output tracking whether any change remained after coin selection. This output
49829  * should always have a value above dust for its given `script_pubkey`. It should not be
49830  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
49831  * not met. This implies no other party should be able to spend it except us.
49832  */
49833 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
49834
49835 /**
49836  * An additional output tracking whether any change remained after coin selection. This output
49837  * should always have a value above dust for its given `script_pubkey`. It should not be
49838  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
49839  * not met. This implies no other party should be able to spend it except us.
49840  */
49841 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
49842
49843 /**
49844  * Constructs a new CoinSelection given each field
49845  */
49846 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
49847
49848 /**
49849  * Creates a copy of the CoinSelection
49850  */
49851 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
49852
49853 /**
49854  * Calls the free function if one is set
49855  */
49856 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
49857
49858 /**
49859  * Calls the free function if one is set
49860  */
49861 void WalletSource_free(struct LDKWalletSource this_ptr);
49862
49863 /**
49864  * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
49865  */
49866 void Wallet_free(struct LDKWallet this_obj);
49867
49868 /**
49869  * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
49870  * of [`CoinSelectionSource`].
49871  */
49872 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
49873
49874 /**
49875  * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
49876  * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
49877  */
49878 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
49879
49880 /**
49881  * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
49882  */
49883 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
49884
49885 /**
49886  * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
49887  *
49888  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
49889  */
49890 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
49891
49892 /**
49893  * Handles all variants of [`BumpTransactionEvent`].
49894  */
49895 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
49896
49897 /**
49898  * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
49899  */
49900 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
49901
49902 /**
49903  * Constructs a new [`FilesystemStore`].
49904  */
49905 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
49906
49907 /**
49908  * Returns the data directory.
49909  */
49910 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
49911
49912 /**
49913  * Constructs a new KVStore which calls the relevant methods on this_arg.
49914  * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
49915  */
49916 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
49917
49918 /**
49919  * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
49920  */
49921 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
49922
49923 /**
49924  * Frees any resources used by the GossipSync
49925  */
49926 void GossipSync_free(struct LDKGossipSync this_ptr);
49927
49928 /**
49929  * Utility method to constructs a new P2P-variant GossipSync
49930  */
49931 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
49932
49933 /**
49934  * Utility method to constructs a new Rapid-variant GossipSync
49935  */
49936 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
49937
49938 /**
49939  * Utility method to constructs a new None-variant GossipSync
49940  */
49941 struct LDKGossipSync GossipSync_none(void);
49942
49943 /**
49944  * Start a background thread that takes care of responsibilities enumerated in the [top-level
49945  * documentation].
49946  *
49947  * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
49948  * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
49949  * either [`join`] or [`stop`].
49950  *
49951  * # Data Persistence
49952  *
49953  * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
49954  * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
49955  * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
49956  * provided implementation.
49957  *
49958  * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
49959  * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
49960  * See the `lightning-persister` crate for LDK's provided implementation.
49961  *
49962  * Typically, users should either implement [`Persister::persist_manager`] to never return an
49963  * error or call [`join`] and handle any error that may arise. For the latter case,
49964  * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
49965  *
49966  * # Event Handling
49967  *
49968  * `event_handler` is responsible for handling events that users should be notified of (e.g.,
49969  * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
49970  * functionality implemented by other handlers.
49971  * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
49972  *
49973  * # Rapid Gossip Sync
49974  *
49975  * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
49976  * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
49977  * until the [`RapidGossipSync`] instance completes its first sync.
49978  *
49979  * [top-level documentation]: BackgroundProcessor
49980  * [`join`]: Self::join
49981  * [`stop`]: Self::stop
49982  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
49983  * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
49984  * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
49985  * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
49986  * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
49987  * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
49988  */
49989 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);
49990
49991 /**
49992  * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
49993  * [`ChannelManager`].
49994  *
49995  * # Panics
49996  *
49997  * This function panics if the background thread has panicked such as while persisting or
49998  * handling events.
49999  *
50000  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
50001  */
50002 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
50003
50004 /**
50005  * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
50006  * [`ChannelManager`].
50007  *
50008  * # Panics
50009  *
50010  * This function panics if the background thread has panicked such as while persisting or
50011  * handling events.
50012  *
50013  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
50014  */
50015 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
50016
50017 /**
50018  * Frees any resources used by the Bolt11ParseError
50019  */
50020 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
50021
50022 /**
50023  * Creates a copy of the Bolt11ParseError
50024  */
50025 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
50026
50027 /**
50028  * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
50029  */
50030 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
50031
50032 /**
50033  * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
50034  */
50035 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
50036
50037 /**
50038  * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
50039  */
50040 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
50041
50042 /**
50043  * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
50044  */
50045 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
50046
50047 /**
50048  * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
50049  */
50050 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
50051
50052 /**
50053  * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
50054  */
50055 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
50056
50057 /**
50058  * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
50059  */
50060 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
50061
50062 /**
50063  * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
50064  */
50065 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
50066
50067 /**
50068  * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
50069  */
50070 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
50071
50072 /**
50073  * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
50074  */
50075 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
50076
50077 /**
50078  * Utility method to constructs a new PaddingError-variant Bolt11ParseError
50079  */
50080 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
50081
50082 /**
50083  * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
50084  */
50085 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
50086
50087 /**
50088  * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
50089  */
50090 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
50091
50092 /**
50093  * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
50094  */
50095 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
50096
50097 /**
50098  * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
50099  */
50100 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
50101
50102 /**
50103  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
50104  */
50105 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
50106
50107 /**
50108  * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
50109  */
50110 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
50111
50112 /**
50113  * Utility method to constructs a new Skip-variant Bolt11ParseError
50114  */
50115 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
50116
50117 /**
50118  * Checks if two Bolt11ParseErrors contain equal inner contents.
50119  * This ignores pointers and is_owned flags and looks at the values in fields.
50120  */
50121 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
50122
50123 /**
50124  * Frees any resources used by the ParseOrSemanticError
50125  */
50126 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
50127
50128 /**
50129  * Creates a copy of the ParseOrSemanticError
50130  */
50131 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
50132
50133 /**
50134  * Utility method to constructs a new ParseError-variant ParseOrSemanticError
50135  */
50136 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
50137
50138 /**
50139  * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
50140  */
50141 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
50142
50143 /**
50144  * Checks if two ParseOrSemanticErrors contain equal inner contents.
50145  * This ignores pointers and is_owned flags and looks at the values in fields.
50146  */
50147 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
50148
50149 /**
50150  * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
50151  */
50152 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
50153
50154 /**
50155  * Checks if two Bolt11Invoices contain equal inner contents.
50156  * This ignores pointers and is_owned flags and looks at the values in fields.
50157  * Two objects with NULL inner values will be considered "equal" here.
50158  */
50159 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
50160
50161 /**
50162  * Creates a copy of the Bolt11Invoice
50163  */
50164 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
50165
50166 /**
50167  * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
50168  */
50169 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
50170
50171 /**
50172  * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
50173  */
50174 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
50175
50176 /**
50177  * Checks if two SignedRawBolt11Invoices contain equal inner contents.
50178  * This ignores pointers and is_owned flags and looks at the values in fields.
50179  * Two objects with NULL inner values will be considered "equal" here.
50180  */
50181 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
50182
50183 /**
50184  * Creates a copy of the SignedRawBolt11Invoice
50185  */
50186 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
50187
50188 /**
50189  * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
50190  */
50191 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
50192
50193 /**
50194  * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
50195  */
50196 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
50197
50198 /**
50199  * data part
50200  */
50201 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
50202
50203 /**
50204  * data part
50205  */
50206 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
50207
50208 /**
50209  * Checks if two RawBolt11Invoices contain equal inner contents.
50210  * This ignores pointers and is_owned flags and looks at the values in fields.
50211  * Two objects with NULL inner values will be considered "equal" here.
50212  */
50213 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
50214
50215 /**
50216  * Creates a copy of the RawBolt11Invoice
50217  */
50218 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
50219
50220 /**
50221  * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
50222  */
50223 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
50224
50225 /**
50226  * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
50227  */
50228 void RawDataPart_free(struct LDKRawDataPart this_obj);
50229
50230 /**
50231  * generation time of the invoice
50232  */
50233 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
50234
50235 /**
50236  * generation time of the invoice
50237  */
50238 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
50239
50240 /**
50241  * Checks if two RawDataParts contain equal inner contents.
50242  * This ignores pointers and is_owned flags and looks at the values in fields.
50243  * Two objects with NULL inner values will be considered "equal" here.
50244  */
50245 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
50246
50247 /**
50248  * Creates a copy of the RawDataPart
50249  */
50250 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
50251
50252 /**
50253  * Generates a non-cryptographic 64-bit hash of the RawDataPart.
50254  */
50255 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
50256
50257 /**
50258  * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
50259  */
50260 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
50261
50262 /**
50263  * Checks if two PositiveTimestamps contain equal inner contents.
50264  * This ignores pointers and is_owned flags and looks at the values in fields.
50265  * Two objects with NULL inner values will be considered "equal" here.
50266  */
50267 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
50268
50269 /**
50270  * Creates a copy of the PositiveTimestamp
50271  */
50272 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
50273
50274 /**
50275  * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
50276  */
50277 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
50278
50279 /**
50280  * Creates a copy of the SiPrefix
50281  */
50282 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
50283
50284 /**
50285  * Utility method to constructs a new Milli-variant SiPrefix
50286  */
50287 enum LDKSiPrefix SiPrefix_milli(void);
50288
50289 /**
50290  * Utility method to constructs a new Micro-variant SiPrefix
50291  */
50292 enum LDKSiPrefix SiPrefix_micro(void);
50293
50294 /**
50295  * Utility method to constructs a new Nano-variant SiPrefix
50296  */
50297 enum LDKSiPrefix SiPrefix_nano(void);
50298
50299 /**
50300  * Utility method to constructs a new Pico-variant SiPrefix
50301  */
50302 enum LDKSiPrefix SiPrefix_pico(void);
50303
50304 /**
50305  * Checks if two SiPrefixs contain equal inner contents.
50306  * This ignores pointers and is_owned flags and looks at the values in fields.
50307  */
50308 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
50309
50310 /**
50311  * Generates a non-cryptographic 64-bit hash of the SiPrefix.
50312  */
50313 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
50314
50315 /**
50316  * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
50317  * This is effectively 10^12 * the prefix multiplier
50318  */
50319 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
50320
50321 /**
50322  * Creates a copy of the Currency
50323  */
50324 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
50325
50326 /**
50327  * Utility method to constructs a new Bitcoin-variant Currency
50328  */
50329 enum LDKCurrency Currency_bitcoin(void);
50330
50331 /**
50332  * Utility method to constructs a new BitcoinTestnet-variant Currency
50333  */
50334 enum LDKCurrency Currency_bitcoin_testnet(void);
50335
50336 /**
50337  * Utility method to constructs a new Regtest-variant Currency
50338  */
50339 enum LDKCurrency Currency_regtest(void);
50340
50341 /**
50342  * Utility method to constructs a new Simnet-variant Currency
50343  */
50344 enum LDKCurrency Currency_simnet(void);
50345
50346 /**
50347  * Utility method to constructs a new Signet-variant Currency
50348  */
50349 enum LDKCurrency Currency_signet(void);
50350
50351 /**
50352  * Generates a non-cryptographic 64-bit hash of the Currency.
50353  */
50354 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
50355
50356 /**
50357  * Checks if two Currencys contain equal inner contents.
50358  * This ignores pointers and is_owned flags and looks at the values in fields.
50359  */
50360 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
50361
50362 /**
50363  * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
50364  */
50365 void Sha256_free(struct LDKSha256 this_obj);
50366
50367 /**
50368  * Creates a copy of the Sha256
50369  */
50370 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
50371
50372 /**
50373  * Generates a non-cryptographic 64-bit hash of the Sha256.
50374  */
50375 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
50376
50377 /**
50378  * Checks if two Sha256s contain equal inner contents.
50379  * This ignores pointers and is_owned flags and looks at the values in fields.
50380  * Two objects with NULL inner values will be considered "equal" here.
50381  */
50382 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
50383
50384 /**
50385  * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
50386  * single sha256 hash.
50387  */
50388 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
50389
50390 /**
50391  * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
50392  */
50393 void Description_free(struct LDKDescription this_obj);
50394
50395 /**
50396  * Creates a copy of the Description
50397  */
50398 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
50399
50400 /**
50401  * Generates a non-cryptographic 64-bit hash of the Description.
50402  */
50403 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
50404
50405 /**
50406  * Checks if two Descriptions contain equal inner contents.
50407  * This ignores pointers and is_owned flags and looks at the values in fields.
50408  * Two objects with NULL inner values will be considered "equal" here.
50409  */
50410 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
50411
50412 /**
50413  * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
50414  */
50415 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
50416
50417 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
50418
50419 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50420
50421 /**
50422  * Constructs a new PayeePubKey given each field
50423  */
50424 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
50425
50426 /**
50427  * Creates a copy of the PayeePubKey
50428  */
50429 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
50430
50431 /**
50432  * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
50433  */
50434 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
50435
50436 /**
50437  * Checks if two PayeePubKeys contain equal inner contents.
50438  * This ignores pointers and is_owned flags and looks at the values in fields.
50439  * Two objects with NULL inner values will be considered "equal" here.
50440  */
50441 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
50442
50443 /**
50444  * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
50445  */
50446 void ExpiryTime_free(struct LDKExpiryTime this_obj);
50447
50448 /**
50449  * Creates a copy of the ExpiryTime
50450  */
50451 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
50452
50453 /**
50454  * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
50455  */
50456 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
50457
50458 /**
50459  * Checks if two ExpiryTimes contain equal inner contents.
50460  * This ignores pointers and is_owned flags and looks at the values in fields.
50461  * Two objects with NULL inner values will be considered "equal" here.
50462  */
50463 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
50464
50465 /**
50466  * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
50467  */
50468 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
50469
50470 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
50471
50472 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
50473
50474 /**
50475  * Constructs a new MinFinalCltvExpiryDelta given each field
50476  */
50477 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
50478
50479 /**
50480  * Creates a copy of the MinFinalCltvExpiryDelta
50481  */
50482 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
50483
50484 /**
50485  * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
50486  */
50487 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
50488
50489 /**
50490  * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
50491  * This ignores pointers and is_owned flags and looks at the values in fields.
50492  * Two objects with NULL inner values will be considered "equal" here.
50493  */
50494 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
50495
50496 /**
50497  * Frees any resources used by the Fallback
50498  */
50499 void Fallback_free(struct LDKFallback this_ptr);
50500
50501 /**
50502  * Creates a copy of the Fallback
50503  */
50504 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
50505
50506 /**
50507  * Utility method to constructs a new SegWitProgram-variant Fallback
50508  */
50509 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
50510
50511 /**
50512  * Utility method to constructs a new PubKeyHash-variant Fallback
50513  */
50514 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
50515
50516 /**
50517  * Utility method to constructs a new ScriptHash-variant Fallback
50518  */
50519 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
50520
50521 /**
50522  * Generates a non-cryptographic 64-bit hash of the Fallback.
50523  */
50524 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
50525
50526 /**
50527  * Checks if two Fallbacks contain equal inner contents.
50528  * This ignores pointers and is_owned flags and looks at the values in fields.
50529  */
50530 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
50531
50532 /**
50533  * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
50534  */
50535 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
50536
50537 /**
50538  * Creates a copy of the Bolt11InvoiceSignature
50539  */
50540 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
50541
50542 /**
50543  * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
50544  */
50545 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
50546
50547 /**
50548  * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
50549  * This ignores pointers and is_owned flags and looks at the values in fields.
50550  * Two objects with NULL inner values will be considered "equal" here.
50551  */
50552 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
50553
50554 /**
50555  * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
50556  */
50557 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
50558
50559 /**
50560  * Creates a copy of the PrivateRoute
50561  */
50562 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
50563
50564 /**
50565  * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
50566  */
50567 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
50568
50569 /**
50570  * Checks if two PrivateRoutes contain equal inner contents.
50571  * This ignores pointers and is_owned flags and looks at the values in fields.
50572  * Two objects with NULL inner values will be considered "equal" here.
50573  */
50574 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
50575
50576 /**
50577  * Disassembles the `SignedRawBolt11Invoice` into its three parts:
50578  *  1. raw invoice
50579  *  2. hash of the raw invoice
50580  *  3. signature
50581  */
50582 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
50583
50584 /**
50585  * The [`RawBolt11Invoice`] which was signed.
50586  */
50587 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
50588
50589 /**
50590  * The hash of the [`RawBolt11Invoice`] that was signed.
50591  */
50592 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
50593
50594 /**
50595  * Signature for the invoice.
50596  */
50597 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
50598
50599 /**
50600  * Recovers the public key used for signing the invoice from the recoverable signature.
50601  */
50602 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
50603
50604 /**
50605  * Checks if the signature is valid for the included payee public key or if none exists if it's
50606  * valid for the recovered signature (which should always be true?).
50607  */
50608 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
50609
50610 /**
50611  * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
50612  */
50613 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50614
50615 /**
50616  *
50617  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50618  */
50619 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50620
50621 /**
50622  *
50623  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50624  */
50625 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50626
50627 /**
50628  *
50629  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50630  */
50631 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50632
50633 /**
50634  *
50635  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50636  */
50637 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50638
50639 /**
50640  *
50641  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50642  */
50643 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50644
50645 /**
50646  *
50647  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50648  */
50649 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50650
50651 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50652
50653 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50654
50655 /**
50656  *
50657  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50658  */
50659 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50660
50661 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50662
50663 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50664
50665 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50666
50667 /**
50668  * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
50669  *
50670  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
50671  */
50672 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
50673
50674 /**
50675  * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
50676  * the range `0..=MAX_TIMESTAMP`.
50677  *
50678  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
50679  *
50680  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
50681  */
50682 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
50683
50684 /**
50685  * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
50686  * `0..=MAX_TIMESTAMP`.
50687  *
50688  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
50689  *
50690  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
50691  */
50692 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
50693
50694 /**
50695  * Returns the Unix timestamp representing the stored time
50696  */
50697 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
50698
50699 /**
50700  * Returns the duration of the stored time since the Unix epoch
50701  */
50702 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
50703
50704 /**
50705  * Returns the [`SystemTime`] representing the stored time
50706  */
50707 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
50708
50709 /**
50710  * The hash of the [`RawBolt11Invoice`] that was signed.
50711  */
50712 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50713
50714 /**
50715  * Transform the `Bolt11Invoice` into its unchecked version.
50716  */
50717 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
50718
50719 /**
50720  * Check that the invoice is signed correctly and that key recovery works
50721  */
50722 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50723
50724 /**
50725  * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
50726  * ```
50727  * use lightning_invoice::*;
50728  *
50729  * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
50730  * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
50731  * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
50732  * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
50733  * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
50734  * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
50735  * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
50736  * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
50737  * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
50738  * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
50739  * j5r6drg6k6zcqj0fcwg\";
50740  *
50741  * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
50742  *
50743  * assert!(Bolt11Invoice::from_signed(signed).is_ok());
50744  * ```
50745  */
50746 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
50747
50748 /**
50749  * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
50750  */
50751 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50752
50753 /**
50754  * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
50755  */
50756 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50757
50758 /**
50759  * Returns the hash to which we will receive the preimage on completion of the payment
50760  */
50761 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
50762
50763 /**
50764  * Get the payee's public key if one was included in the invoice
50765  *
50766  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50767  */
50768 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50769
50770 /**
50771  * Get the payment secret if one was included in the invoice
50772  */
50773 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
50774
50775 /**
50776  * Get the payment metadata blob if one was included in the invoice
50777  */
50778 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50779
50780 /**
50781  * Get the invoice features if they were included in the invoice
50782  *
50783  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50784  */
50785 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50786
50787 /**
50788  * Recover the payee's public key (only to be used if none was included in the invoice)
50789  */
50790 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50791
50792 /**
50793  * Returns the Duration since the Unix epoch at which the invoice expires.
50794  * Returning None if overflow occurred.
50795  */
50796 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50797
50798 /**
50799  * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
50800  */
50801 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50802
50803 /**
50804  * Returns whether the invoice has expired.
50805  */
50806 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50807
50808 /**
50809  * Returns the Duration remaining until the invoice expires.
50810  */
50811 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50812
50813 /**
50814  * Returns the Duration remaining until the invoice expires given the current time.
50815  * `time` is the timestamp as a duration since the Unix epoch.
50816  */
50817 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
50818
50819 /**
50820  * Returns whether the expiry time would pass at the given point in time.
50821  * `at_time` is the timestamp as a duration since the Unix epoch.
50822  */
50823 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
50824
50825 /**
50826  * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
50827  * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
50828  */
50829 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50830
50831 /**
50832  * Returns a list of all fallback addresses as [`Address`]es
50833  */
50834 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50835
50836 /**
50837  * Returns a list of all routes included in the invoice
50838  */
50839 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50840
50841 /**
50842  * Returns a list of all routes included in the invoice as the underlying hints
50843  */
50844 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50845
50846 /**
50847  * Returns the currency for which the invoice was issued
50848  */
50849 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50850
50851 /**
50852  * Returns the amount if specified in the invoice as millisatoshis.
50853  */
50854 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50855
50856 /**
50857  * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
50858  * returns [`CreationError::DescriptionTooLong`] otherwise
50859  *
50860  * Please note that single characters may use more than one byte due to UTF8 encoding.
50861  */
50862 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
50863
50864 /**
50865  * Returns the underlying description [`UntrustedString`]
50866  */
50867 MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg);
50868
50869 /**
50870  * Get the string representation of a Description object
50871  */
50872 struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o);
50873
50874 /**
50875  * Construct an `ExpiryTime` from seconds.
50876  */
50877 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
50878
50879 /**
50880  * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
50881  */
50882 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
50883
50884 /**
50885  * Returns the expiry time in seconds
50886  */
50887 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
50888
50889 /**
50890  * Returns a reference to the underlying [`Duration`] (=expiry time)
50891  */
50892 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
50893
50894 /**
50895  * Creates a new (partial) route from a list of hops
50896  */
50897 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
50898
50899 /**
50900  * Returns the underlying list of hops
50901  */
50902 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
50903
50904 /**
50905  * Creates a copy of the CreationError
50906  */
50907 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
50908
50909 /**
50910  * Utility method to constructs a new DescriptionTooLong-variant CreationError
50911  */
50912 enum LDKCreationError CreationError_description_too_long(void);
50913
50914 /**
50915  * Utility method to constructs a new RouteTooLong-variant CreationError
50916  */
50917 enum LDKCreationError CreationError_route_too_long(void);
50918
50919 /**
50920  * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
50921  */
50922 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
50923
50924 /**
50925  * Utility method to constructs a new InvalidAmount-variant CreationError
50926  */
50927 enum LDKCreationError CreationError_invalid_amount(void);
50928
50929 /**
50930  * Utility method to constructs a new MissingRouteHints-variant CreationError
50931  */
50932 enum LDKCreationError CreationError_missing_route_hints(void);
50933
50934 /**
50935  * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
50936  */
50937 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
50938
50939 /**
50940  * Checks if two CreationErrors contain equal inner contents.
50941  * This ignores pointers and is_owned flags and looks at the values in fields.
50942  */
50943 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
50944
50945 /**
50946  * Get the string representation of a CreationError object
50947  */
50948 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
50949
50950 /**
50951  * Creates a copy of the Bolt11SemanticError
50952  */
50953 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
50954
50955 /**
50956  * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
50957  */
50958 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
50959
50960 /**
50961  * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
50962  */
50963 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
50964
50965 /**
50966  * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
50967  */
50968 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
50969
50970 /**
50971  * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
50972  */
50973 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
50974
50975 /**
50976  * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
50977  */
50978 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
50979
50980 /**
50981  * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
50982  */
50983 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
50984
50985 /**
50986  * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
50987  */
50988 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
50989
50990 /**
50991  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
50992  */
50993 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
50994
50995 /**
50996  * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
50997  */
50998 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
50999
51000 /**
51001  * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
51002  */
51003 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
51004
51005 /**
51006  * Checks if two Bolt11SemanticErrors contain equal inner contents.
51007  * This ignores pointers and is_owned flags and looks at the values in fields.
51008  */
51009 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
51010
51011 /**
51012  * Get the string representation of a Bolt11SemanticError object
51013  */
51014 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
51015
51016 /**
51017  * Frees any resources used by the SignOrCreationError
51018  */
51019 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
51020
51021 /**
51022  * Creates a copy of the SignOrCreationError
51023  */
51024 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
51025
51026 /**
51027  * Utility method to constructs a new SignError-variant SignOrCreationError
51028  */
51029 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
51030
51031 /**
51032  * Utility method to constructs a new CreationError-variant SignOrCreationError
51033  */
51034 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
51035
51036 /**
51037  * Checks if two SignOrCreationErrors contain equal inner contents.
51038  * This ignores pointers and is_owned flags and looks at the values in fields.
51039  */
51040 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
51041
51042 /**
51043  * Get the string representation of a SignOrCreationError object
51044  */
51045 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
51046
51047 /**
51048  * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
51049  * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
51050  * [`ChannelManager::send_preflight_probes`].
51051  *
51052  * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
51053  * same [`PaymentHash`] has never been paid before.
51054  *
51055  * Will always succeed unless the invoice has an amount specified, in which case
51056  * [`payment_parameters_from_invoice`] should be used.
51057  *
51058  * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
51059  * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
51060  */
51061 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
51062
51063 /**
51064  * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
51065  * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
51066  *
51067  * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
51068  * same [`PaymentHash`] has never been paid before.
51069  *
51070  * Will always succeed unless the invoice has no amount specified, in which case
51071  * [`payment_parameters_from_zero_amount_invoice`] should be used.
51072  *
51073  * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
51074  * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
51075  */
51076 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
51077
51078 /**
51079  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
51080  * See [`PhantomKeysManager`] for more information on phantom node payments.
51081  *
51082  * `phantom_route_hints` parameter:
51083  * * Contains channel info for all nodes participating in the phantom invoice
51084  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
51085  *   participating node
51086  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
51087  *   updated when a channel becomes disabled or closes
51088  * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
51089  *   may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
51090  *   down
51091  *
51092  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
51093  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
51094  * If `None` is provided for `payment_hash`, then one will be created.
51095  *
51096  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
51097  * in excess of the current time.
51098  *
51099  * `duration_since_epoch` is the current time since epoch in seconds.
51100  *
51101  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
51102  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
51103  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
51104  * confirmations during routing.
51105  *
51106  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
51107  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
51108  * requirement).
51109  *
51110  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
51111  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
51112  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
51113  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
51114  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
51115  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
51116  *
51117  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
51118  * available and the current time is supplied by the caller.
51119  */
51120 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);
51121
51122 /**
51123  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
51124  * See [`PhantomKeysManager`] for more information on phantom node payments.
51125  *
51126  * `phantom_route_hints` parameter:
51127  * * Contains channel info for all nodes participating in the phantom invoice
51128  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
51129  *   participating node
51130  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
51131  *   updated when a channel becomes disabled or closes
51132  * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
51133  *   of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
51134  *   in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
51135  *   until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
51136  *   desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
51137  *
51138  * `description_hash` is a SHA-256 hash of the description text
51139  *
51140  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
51141  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
51142  * If `None` is provided for `payment_hash`, then one will be created.
51143  *
51144  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
51145  * in excess of the current time.
51146  *
51147  * `duration_since_epoch` is the current time since epoch in seconds.
51148  *
51149  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
51150  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
51151  * requirement).
51152  *
51153  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
51154  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
51155  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
51156  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
51157  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
51158  *
51159  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
51160  * available and the current time is supplied by the caller.
51161  */
51162 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);
51163
51164 /**
51165  * Utility to construct an invoice. Generally, unless you want to do something like a custom
51166  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
51167  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
51168  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
51169  * that the payment secret is valid when the invoice is paid.
51170  *
51171  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
51172  * in excess of the current time.
51173  *
51174  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
51175  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
51176  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
51177  * confirmations during routing.
51178  *
51179  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
51180  */
51181 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);
51182
51183 /**
51184  * Utility to construct an invoice. Generally, unless you want to do something like a custom
51185  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
51186  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
51187  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
51188  * that the payment secret is valid when the invoice is paid.
51189  * Use this variant if you want to pass the `description_hash` to the invoice.
51190  *
51191  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
51192  * in excess of the current time.
51193  *
51194  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
51195  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
51196  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
51197  * confirmations during routing.
51198  *
51199  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
51200  */
51201 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);
51202
51203 /**
51204  * See [`create_invoice_from_channelmanager_with_description_hash`]
51205  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
51206  * available and the current time is supplied by the caller.
51207  */
51208 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);
51209
51210 /**
51211  * See [`create_invoice_from_channelmanager`]
51212  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
51213  * available and the current time is supplied by the caller.
51214  */
51215 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);
51216
51217 /**
51218  * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
51219  * This version allows for providing a custom [`PaymentHash`] for the invoice.
51220  * This may be useful if you're building an on-chain swap or involving another protocol where
51221  * the payment hash is also involved outside the scope of lightning.
51222  */
51223 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);
51224
51225 /**
51226  * Read a SiPrefix object from a string
51227  */
51228 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
51229
51230 /**
51231  * Read a Bolt11Invoice object from a string
51232  */
51233 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
51234
51235 /**
51236  * Read a SignedRawBolt11Invoice object from a string
51237  */
51238 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
51239
51240 /**
51241  * Get the string representation of a Bolt11ParseError object
51242  */
51243 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
51244
51245 /**
51246  * Get the string representation of a ParseOrSemanticError object
51247  */
51248 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
51249
51250 /**
51251  * Get the string representation of a Bolt11Invoice object
51252  */
51253 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
51254
51255 /**
51256  * Get the string representation of a SignedRawBolt11Invoice object
51257  */
51258 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
51259
51260 /**
51261  * Get the string representation of a Currency object
51262  */
51263 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
51264
51265 /**
51266  * Get the string representation of a SiPrefix object
51267  */
51268 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
51269
51270 /**
51271  * Frees any resources used by the GraphSyncError
51272  */
51273 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
51274
51275 /**
51276  * Creates a copy of the GraphSyncError
51277  */
51278 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
51279
51280 /**
51281  * Utility method to constructs a new DecodeError-variant GraphSyncError
51282  */
51283 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
51284
51285 /**
51286  * Utility method to constructs a new LightningError-variant GraphSyncError
51287  */
51288 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
51289
51290 /**
51291  * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
51292  */
51293 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
51294
51295 /**
51296  * Instantiate a new [`RapidGossipSync`] instance.
51297  */
51298 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
51299
51300 /**
51301  * Sync gossip data from a file.
51302  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
51303  *
51304  * `network_graph`: The network graph to apply the updates to
51305  *
51306  * `sync_path`: Path to the file where the gossip update data is located
51307  *
51308  */
51309 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
51310
51311 /**
51312  * Update network graph from binary data.
51313  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
51314  *
51315  * `update_data`: `&[u8]` binary stream that comprises the update data
51316  */
51317 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
51318
51319 /**
51320  * Update network graph from binary data.
51321  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
51322  *
51323  * `update_data`: `&[u8]` binary stream that comprises the update data
51324  * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
51325  */
51326 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);
51327
51328 /**
51329  * Returns whether a rapid gossip sync has completed at least once.
51330  */
51331 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
51332
51333 #endif /* LDK_C_BINDINGS_H */
51334
51335 #include "ldk_ver.h"